id
stringlengths
34
124
type
stringclasses
4 values
prompt
stringlengths
0
4.95k
response
stringlengths
21
4.89k
source_lang
stringclasses
3 values
target_lang
stringclasses
2 values
repo
stringclasses
75 values
path
stringlengths
10
88
license
stringclasses
1 value
commit
stringlengths
40
40
stars
int64
431
18.7k
source_url
stringlengths
86
176
line_start
int64
1
214
line_end
int64
3
253
ExpediaGroup/cyclotron:cyclotron-site/app/scripts/mgmt/directives/directives.editor.view.inlineArray.coffee:1:completion
completion
### # Copyright (c) 2013-2015 the original author or authors. # # Licensed under the MIT License (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.opensource.org/licenses/mit-license.php # # Unless required by applicable law ...
model: '=' definition: '=' factory: '&' headingfn: '&' templateUrl: '/partials/editor/inlineArray.html' transclude: true controller: ($scope) -> $scope.removeItem = (index) -> $scope.model.splice(index, 1) $scope.add...
CoffeeScript
CoffeeScript
ExpediaGroup/cyclotron
cyclotron-site/app/scripts/mgmt/directives/directives.editor.view.inlineArray.coffee
MIT
df26fc48ea0296697e2755b7a1d9ce5cf50a4483
1,544
https://github.com/ExpediaGroup/cyclotron/blob/df26fc48ea0296697e2755b7a1d9ce5cf50a4483/cyclotron-site/app/scripts/mgmt/directives/directives.editor.view.inlineArray.coffee
1
41
ExpediaGroup/cyclotron:cyclotron-site/app/scripts/mgmt/directives/directives.editor.view.inlineArray.coffee:1:raw_corpus
raw_corpus
### # Copyright (c) 2013-2015 the original author or authors. # # Licensed under the MIT License (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.opensource.org/licenses/mit-license.php # # Unless required by applicable law ...
CoffeeScript
ExpediaGroup/cyclotron
cyclotron-site/app/scripts/mgmt/directives/directives.editor.view.inlineArray.coffee
MIT
14b0e411415be801f94fe13ea6f63d5ad957c2ed
1,544
https://github.com/ExpediaGroup/cyclotron/blob/14b0e411415be801f94fe13ea6f63d5ad957c2ed/cyclotron-site/app/scripts/mgmt/directives/directives.editor.view.inlineArray.coffee
1
50
ExpediaGroup/cyclotron:cyclotron-site/app/scripts/mgmt/directives/directives.editor.view.inlineArray.coffee:1:completion
completion
### # Copyright (c) 2013-2015 the original author or authors. # # Licensed under the MIT License (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.opensource.org/licenses/mit-license.php # # Unless required by applicable law ...
templateUrl: '/partials/editor/inlineArray.html' transclude: true controller: ($scope) -> $scope.removeItem = (index) -> $scope.model.splice(index, 1) # Moves an item to a new location $scope.moveItem = (oldIndex, newIndex) -> return...
CoffeeScript
CoffeeScript
ExpediaGroup/cyclotron
cyclotron-site/app/scripts/mgmt/directives/directives.editor.view.inlineArray.coffee
MIT
14b0e411415be801f94fe13ea6f63d5ad957c2ed
1,544
https://github.com/ExpediaGroup/cyclotron/blob/14b0e411415be801f94fe13ea6f63d5ad957c2ed/cyclotron-site/app/scripts/mgmt/directives/directives.editor.view.inlineArray.coffee
1
50
Atraci/Atraci:coffee/_playlist.coffee:1:raw_corpus
raw_corpus
class Playlists @clear = (success) -> db.transaction (tx) -> tx.executeSql 'DROP TABLE playlist_tracks' tx.executeSql 'DROP TABLE playlists' success?() @addTrack: (artist, title, cover_url_medium, cover_url_large, playlist) -> unix_timestamp = Math.round((new Date()).getTime() / 1000) ...
CoffeeScript
Atraci/Atraci
coffee/_playlist.coffee
MIT
8d3ea29b75ae06eddeb79fa3aa50c6d7ecd104a6
800
https://github.com/Atraci/Atraci/blob/8d3ea29b75ae06eddeb79fa3aa50c6d7ecd104a6/coffee/_playlist.coffee
18
67
Atraci/Atraci:coffee/_playlist.coffee:1:coffee_to_js
coffee_to_js
Convert this CoffeeScript to JavaScript. ```coffeescript class Playlists @clear = (success) -> db.transaction (tx) -> tx.executeSql 'DROP TABLE playlist_tracks' tx.executeSql 'DROP TABLE playlists' success?() @addTrack: (artist, title, cover_url_medium, cover_url_large, playlist) -> unix_...
var Playlists; Playlists = class Playlists { static clear(success) { return db.transaction(function(tx) { tx.executeSql('DROP TABLE playlist_tracks'); tx.executeSql('DROP TABLE playlists'); return typeof success === "function" ? success() : void 0; }); } static addTrack(artist, title, ...
CoffeeScript
JavaScript
Atraci/Atraci
coffee/_playlist.coffee
MIT
8d3ea29b75ae06eddeb79fa3aa50c6d7ecd104a6
800
https://github.com/Atraci/Atraci/blob/8d3ea29b75ae06eddeb79fa3aa50c6d7ecd104a6/coffee/_playlist.coffee
18
67
Atraci/Atraci:coffee/_playlist.coffee:1:js_to_coffee
js_to_coffee
Convert this JavaScript to CoffeeScript. ```javascript var Playlists; Playlists = class Playlists { static clear(success) { return db.transaction(function(tx) { tx.executeSql('DROP TABLE playlist_tracks'); tx.executeSql('DROP TABLE playlists'); return typeof success === "function" ? success() :...
class Playlists @clear = (success) -> db.transaction (tx) -> tx.executeSql 'DROP TABLE playlist_tracks' tx.executeSql 'DROP TABLE playlists' success?() @addTrack: (artist, title, cover_url_medium, cover_url_large, playlist) -> unix_timestamp = Math.round((new Date()).getTime() / 1000) ...
JavaScript
CoffeeScript
Atraci/Atraci
coffee/_playlist.coffee
MIT
8d3ea29b75ae06eddeb79fa3aa50c6d7ecd104a6
800
https://github.com/Atraci/Atraci/blob/8d3ea29b75ae06eddeb79fa3aa50c6d7ecd104a6/coffee/_playlist.coffee
18
67
Atraci/Atraci:coffee/_playlist.coffee:1:completion
completion
class Playlists @clear = (success) -> db.transaction (tx) -> tx.executeSql 'DROP TABLE playlist_tracks' tx.executeSql 'DROP TABLE playlists' success?() @addTrack: (artist, title, cover_url_medium, cover_url_large, playlist) -> unix_timestamp = Math.round((new Date()).getTime() / 1000) ...
) @updatePlaylistPos: (playlistName, position) -> db.transaction (tx) -> tx.executeSql( 'update playlists set ' + 'position = ? WHERE name = ?', [position, playlistName] ) @removeTrack: (artist, title, playlist) -> db.transaction (tx) -> tx.executeSql( 'DELETE FRO...
CoffeeScript
CoffeeScript
Atraci/Atraci
coffee/_playlist.coffee
MIT
8d3ea29b75ae06eddeb79fa3aa50c6d7ecd104a6
800
https://github.com/Atraci/Atraci/blob/8d3ea29b75ae06eddeb79fa3aa50c6d7ecd104a6/coffee/_playlist.coffee
18
67
Atraci/Atraci:coffee/_playlist.coffee:2:raw_corpus
raw_corpus
@delete: (name) -> db.transaction (tx) -> tx.executeSql 'DELETE FROM playlists WHERE name = ?', [name] tx.executeSql 'DELETE FROM playlist_tracks WHERE playlist = ?', [name] @getAll = (success) -> playlists = [] db.transaction (tx) -> tx.executeSql( 'SELECT * FROM playlists ORDE...
CoffeeScript
Atraci/Atraci
coffee/_playlist.coffee
MIT
8d3ea29b75ae06eddeb79fa3aa50c6d7ecd104a6
800
https://github.com/Atraci/Atraci/blob/8d3ea29b75ae06eddeb79fa3aa50c6d7ecd104a6/coffee/_playlist.coffee
68
117
Atraci/Atraci:coffee/_playlist.coffee:2:completion
completion
@delete: (name) -> db.transaction (tx) -> tx.executeSql 'DELETE FROM playlists WHERE name = ?', [name] tx.executeSql 'DELETE FROM playlist_tracks WHERE playlist = ?', [name] @getAll = (success) -> playlists = [] db.transaction (tx) -> tx.executeSql( 'SELECT * FROM playlists ORDE...
i = 0 while i < results.rows.length tracks.push results.rows.item(i) i++ success? tracks ) @getPlaylistNameExist: (name, callback) -> db.transaction((tx) -> tx.executeSql( 'SELECT name FROM playlists WHERE name = ?', [name], (tx, results) ->...
CoffeeScript
CoffeeScript
Atraci/Atraci
coffee/_playlist.coffee
MIT
8d3ea29b75ae06eddeb79fa3aa50c6d7ecd104a6
800
https://github.com/Atraci/Atraci/blob/8d3ea29b75ae06eddeb79fa3aa50c6d7ecd104a6/coffee/_playlist.coffee
68
117
Atraci/Atraci:coffee/_playlist.coffee:3:raw_corpus
raw_corpus
i = 0 while i < tracks.length Playlists.addTrack( tracks[i].artist, tracks[i].title, tracks[i].cover_url_medium, tracks[i].cover_url_large, new_name) i++ )) Playlists.delete(name)
CoffeeScript
Atraci/Atraci
coffee/_playlist.coffee
MIT
8d3ea29b75ae06eddeb79fa3aa50c6d7ecd104a6
800
https://github.com/Atraci/Atraci/blob/8d3ea29b75ae06eddeb79fa3aa50c6d7ecd104a6/coffee/_playlist.coffee
118
126
Atraci/Atraci:coffee/_playlist.coffee:3:completion
completion
i = 0 while i < tracks.length Playlists.addTrack( tracks[i].artist, tracks[i].title, tracks[i].cover_url_medium,
tracks[i].cover_url_large, new_name) i++ )) Playlists.delete(name)
CoffeeScript
CoffeeScript
Atraci/Atraci
coffee/_playlist.coffee
MIT
8d3ea29b75ae06eddeb79fa3aa50c6d7ecd104a6
800
https://github.com/Atraci/Atraci/blob/8d3ea29b75ae06eddeb79fa3aa50c6d7ecd104a6/coffee/_playlist.coffee
118
126
Atraci/Atraci:coffee/_playlist.coffee:2:raw_corpus
raw_corpus
@delete: (name) -> db.transaction (tx) -> tx.executeSql 'DELETE FROM playlists WHERE name = ?', [name] tx.executeSql 'DELETE FROM playlist_tracks WHERE playlist = ?', [name] @getAll = (success) -> playlists = [] db.transaction (tx) -> tx.executeSql( 'SELECT * FROM playlists ORDE...
CoffeeScript
Atraci/Atraci
coffee/_playlist.coffee
MIT
7bfa3a0eca29f8464cc8c4e700b177eaeaf2c305
800
https://github.com/Atraci/Atraci/blob/7bfa3a0eca29f8464cc8c4e700b177eaeaf2c305/coffee/_playlist.coffee
68
116
Atraci/Atraci:coffee/_playlist.coffee:2:completion
completion
@delete: (name) -> db.transaction (tx) -> tx.executeSql 'DELETE FROM playlists WHERE name = ?', [name] tx.executeSql 'DELETE FROM playlist_tracks WHERE playlist = ?', [name] @getAll = (success) -> playlists = [] db.transaction (tx) -> tx.executeSql( 'SELECT * FROM playlists ORDE...
i = 0 while i < results.rows.length tracks.push results.rows.item(i) i++ success? tracks ) @rename: (name, new_name) -> db.transaction((tx) -> tx.executeSql( 'UPDATE playlists SET name = ? WHERE name = ?', [new_name, name] ) ) Playlis...
CoffeeScript
CoffeeScript
Atraci/Atraci
coffee/_playlist.coffee
MIT
7bfa3a0eca29f8464cc8c4e700b177eaeaf2c305
800
https://github.com/Atraci/Atraci/blob/7bfa3a0eca29f8464cc8c4e700b177eaeaf2c305/coffee/_playlist.coffee
68
116
Atraci/Atraci:coffee/_playlist.coffee:1:raw_corpus
raw_corpus
class Playlists @clear = (success) -> db.transaction (tx) -> tx.executeSql 'DROP TABLE playlist_tracks' tx.executeSql 'DROP TABLE playlists' success?() @addTrack: (artist, title, cover_url_medium, cover_url_large, playlist) -> unix_timestamp = Math.round((new Date()).getTime() / 1000) ...
CoffeeScript
Atraci/Atraci
coffee/_playlist.coffee
MIT
a87e771f914303d41e4c8bd67fa64779e80a96b4
800
https://github.com/Atraci/Atraci/blob/a87e771f914303d41e4c8bd67fa64779e80a96b4/coffee/_playlist.coffee
13
62
Atraci/Atraci:coffee/_playlist.coffee:1:coffee_to_js
coffee_to_js
Convert this CoffeeScript to JavaScript. ```coffeescript class Playlists @clear = (success) -> db.transaction (tx) -> tx.executeSql 'DROP TABLE playlist_tracks' tx.executeSql 'DROP TABLE playlists' success?() @addTrack: (artist, title, cover_url_medium, cover_url_large, playlist) -> unix_...
var Playlists; Playlists = class Playlists { static clear(success) { return db.transaction(function(tx) { tx.executeSql('DROP TABLE playlist_tracks'); tx.executeSql('DROP TABLE playlists'); return typeof success === "function" ? success() : void 0; }); } static addTrack(artist, title, ...
CoffeeScript
JavaScript
Atraci/Atraci
coffee/_playlist.coffee
MIT
a87e771f914303d41e4c8bd67fa64779e80a96b4
800
https://github.com/Atraci/Atraci/blob/a87e771f914303d41e4c8bd67fa64779e80a96b4/coffee/_playlist.coffee
13
62
Atraci/Atraci:coffee/_playlist.coffee:1:js_to_coffee
js_to_coffee
Convert this JavaScript to CoffeeScript. ```javascript var Playlists; Playlists = class Playlists { static clear(success) { return db.transaction(function(tx) { tx.executeSql('DROP TABLE playlist_tracks'); tx.executeSql('DROP TABLE playlists'); return typeof success === "function" ? success() :...
class Playlists @clear = (success) -> db.transaction (tx) -> tx.executeSql 'DROP TABLE playlist_tracks' tx.executeSql 'DROP TABLE playlists' success?() @addTrack: (artist, title, cover_url_medium, cover_url_large, playlist) -> unix_timestamp = Math.round((new Date()).getTime() / 1000) ...
JavaScript
CoffeeScript
Atraci/Atraci
coffee/_playlist.coffee
MIT
a87e771f914303d41e4c8bd67fa64779e80a96b4
800
https://github.com/Atraci/Atraci/blob/a87e771f914303d41e4c8bd67fa64779e80a96b4/coffee/_playlist.coffee
13
62
Atraci/Atraci:coffee/_playlist.coffee:1:completion
completion
class Playlists @clear = (success) -> db.transaction (tx) -> tx.executeSql 'DROP TABLE playlist_tracks' tx.executeSql 'DROP TABLE playlists' success?() @addTrack: (artist, title, cover_url_medium, cover_url_large, playlist) -> unix_timestamp = Math.round((new Date()).getTime() / 1000) ...
) @removeTrack: (artist, title, playlist) -> db.transaction (tx) -> tx.executeSql( 'DELETE FROM playlist_tracks WHERE ' + 'artist = ? and title = ? and playlist = ?', [artist, title, playlist] ) @create: (name, platform_id = '') -> unix_timestamp = Math.round((new Date()).getTi...
CoffeeScript
CoffeeScript
Atraci/Atraci
coffee/_playlist.coffee
MIT
a87e771f914303d41e4c8bd67fa64779e80a96b4
800
https://github.com/Atraci/Atraci/blob/a87e771f914303d41e4c8bd67fa64779e80a96b4/coffee/_playlist.coffee
13
62
Atraci/Atraci:coffee/_playlist.coffee:2:raw_corpus
raw_corpus
db.transaction (tx) -> tx.executeSql( 'SELECT * FROM playlists ORDER BY created DESC', [], (tx, results) -> i = 0 while i < results.rows.length playlists.push results.rows.item(i) i++ __playlists = playlists success? playlists ) @get...
CoffeeScript
Atraci/Atraci
coffee/_playlist.coffee
MIT
a87e771f914303d41e4c8bd67fa64779e80a96b4
800
https://github.com/Atraci/Atraci/blob/a87e771f914303d41e4c8bd67fa64779e80a96b4/coffee/_playlist.coffee
63
103
Atraci/Atraci:coffee/_playlist.coffee:2:completion
completion
db.transaction (tx) -> tx.executeSql( 'SELECT * FROM playlists ORDER BY created DESC', [], (tx, results) -> i = 0 while i < results.rows.length playlists.push results.rows.item(i) i++ __playlists = playlists success? playlists ) @get...
i++ success? tracks ) @rename: (name, new_name) -> db.transaction((tx) -> tx.executeSql( 'UPDATE playlists SET name = ? WHERE name = ?', [new_name, name] ) ) Playlists.getTracksForPlaylist(name, ((tracks) -> i = 0 while i < tracks.length Playlists....
CoffeeScript
CoffeeScript
Atraci/Atraci
coffee/_playlist.coffee
MIT
a87e771f914303d41e4c8bd67fa64779e80a96b4
800
https://github.com/Atraci/Atraci/blob/a87e771f914303d41e4c8bd67fa64779e80a96b4/coffee/_playlist.coffee
63
103
Atraci/Atraci:coffee/_playlist.coffee:1:raw_corpus
raw_corpus
class Playlists @clear = (success) -> db.transaction (tx) -> tx.executeSql 'DROP TABLE playlist_tracks' tx.executeSql 'DROP TABLE playlists' success?() @addTrack: (artist, title, cover_url_medium, cover_url_large, playlist) -> unix_timestamp = Math.round((new Date()).getTime() / 1000) ...
CoffeeScript
Atraci/Atraci
coffee/_playlist.coffee
MIT
b7c388a6e82adeb5864d31a7df6120375ab3f727
800
https://github.com/Atraci/Atraci/blob/b7c388a6e82adeb5864d31a7df6120375ab3f727/coffee/_playlist.coffee
7
56
Atraci/Atraci:coffee/_playlist.coffee:1:coffee_to_js
coffee_to_js
Convert this CoffeeScript to JavaScript. ```coffeescript class Playlists @clear = (success) -> db.transaction (tx) -> tx.executeSql 'DROP TABLE playlist_tracks' tx.executeSql 'DROP TABLE playlists' success?() @addTrack: (artist, title, cover_url_medium, cover_url_large, playlist) -> unix_...
var Playlists; Playlists = class Playlists { static clear(success) { return db.transaction(function(tx) { tx.executeSql('DROP TABLE playlist_tracks'); tx.executeSql('DROP TABLE playlists'); return typeof success === "function" ? success() : void 0; }); } static addTrack(artist, title, ...
CoffeeScript
JavaScript
Atraci/Atraci
coffee/_playlist.coffee
MIT
b7c388a6e82adeb5864d31a7df6120375ab3f727
800
https://github.com/Atraci/Atraci/blob/b7c388a6e82adeb5864d31a7df6120375ab3f727/coffee/_playlist.coffee
7
56
Atraci/Atraci:coffee/_playlist.coffee:1:js_to_coffee
js_to_coffee
Convert this JavaScript to CoffeeScript. ```javascript var Playlists; Playlists = class Playlists { static clear(success) { return db.transaction(function(tx) { tx.executeSql('DROP TABLE playlist_tracks'); tx.executeSql('DROP TABLE playlists'); return typeof success === "function" ? success() :...
class Playlists @clear = (success) -> db.transaction (tx) -> tx.executeSql 'DROP TABLE playlist_tracks' tx.executeSql 'DROP TABLE playlists' success?() @addTrack: (artist, title, cover_url_medium, cover_url_large, playlist) -> unix_timestamp = Math.round((new Date()).getTime() / 1000) ...
JavaScript
CoffeeScript
Atraci/Atraci
coffee/_playlist.coffee
MIT
b7c388a6e82adeb5864d31a7df6120375ab3f727
800
https://github.com/Atraci/Atraci/blob/b7c388a6e82adeb5864d31a7df6120375ab3f727/coffee/_playlist.coffee
7
56
Atraci/Atraci:coffee/_playlist.coffee:1:completion
completion
class Playlists @clear = (success) -> db.transaction (tx) -> tx.executeSql 'DROP TABLE playlist_tracks' tx.executeSql 'DROP TABLE playlists' success?() @addTrack: (artist, title, cover_url_medium, cover_url_large, playlist) -> unix_timestamp = Math.round((new Date()).getTime() / 1000) ...
) @removeTrack: (artist, title, playlist) -> db.transaction (tx) -> tx.executeSql( 'DELETE FROM playlist_tracks WHERE ' + 'artist = ? and title = ? and playlist = ?', [artist, title, playlist] ) @create: (name) -> unix_timestamp = Math.round((new Date()).getTime() / 1000) d...
CoffeeScript
CoffeeScript
Atraci/Atraci
coffee/_playlist.coffee
MIT
b7c388a6e82adeb5864d31a7df6120375ab3f727
800
https://github.com/Atraci/Atraci/blob/b7c388a6e82adeb5864d31a7df6120375ab3f727/coffee/_playlist.coffee
7
56
octoblu/meshblu:test/lib/resetToken-spec.coffee:1:raw_corpus
raw_corpus
resetToken = require '../../lib/resetToken' describe 'resetToken', -> beforeEach -> @securityImpl = {} @getDevice = sinon.stub() @device = resetToken: sinon.stub() @Device = sinon.spy => @device @emitToClient = sinon.stub() #currying, yo @sut = (fromDevice, uuid, callback) => ...
CoffeeScript
octoblu/meshblu
test/lib/resetToken-spec.coffee
MIT
7de2b1bc4b5063cdca0ca0b68925bf49c8bc34fa
815
https://github.com/octoblu/meshblu/blob/7de2b1bc4b5063cdca0ca0b68925bf49c8bc34fa/test/lib/resetToken-spec.coffee
1
39
octoblu/meshblu:test/lib/resetToken-spec.coffee:1:coffee_to_js
coffee_to_js
Convert this CoffeeScript to JavaScript. ```coffeescript resetToken = require '../../lib/resetToken' describe 'resetToken', -> beforeEach -> @securityImpl = {} @getDevice = sinon.stub() @device = resetToken: sinon.stub() @Device = sinon.spy => @device @emitToClient = sinon.stub() #curr...
var resetToken; resetToken = require('../../lib/resetToken'); describe('resetToken', function() { beforeEach(function() { this.securityImpl = {}; this.getDevice = sinon.stub(); this.device = { resetToken: sinon.stub() }; this.Device = sinon.spy(() => { return this.device; }); ...
CoffeeScript
JavaScript
octoblu/meshblu
test/lib/resetToken-spec.coffee
MIT
7de2b1bc4b5063cdca0ca0b68925bf49c8bc34fa
815
https://github.com/octoblu/meshblu/blob/7de2b1bc4b5063cdca0ca0b68925bf49c8bc34fa/test/lib/resetToken-spec.coffee
1
39
octoblu/meshblu:test/lib/resetToken-spec.coffee:1:js_to_coffee
js_to_coffee
Convert this JavaScript to CoffeeScript. ```javascript var resetToken; resetToken = require('../../lib/resetToken'); describe('resetToken', function() { beforeEach(function() { this.securityImpl = {}; this.getDevice = sinon.stub(); this.device = { resetToken: sinon.stub() }; this.Device = ...
resetToken = require '../../lib/resetToken' describe 'resetToken', -> beforeEach -> @securityImpl = {} @getDevice = sinon.stub() @device = resetToken: sinon.stub() @Device = sinon.spy => @device @emitToClient = sinon.stub() #currying, yo @sut = (fromDevice, uuid, callback) => ...
JavaScript
CoffeeScript
octoblu/meshblu
test/lib/resetToken-spec.coffee
MIT
7de2b1bc4b5063cdca0ca0b68925bf49c8bc34fa
815
https://github.com/octoblu/meshblu/blob/7de2b1bc4b5063cdca0ca0b68925bf49c8bc34fa/test/lib/resetToken-spec.coffee
1
39
octoblu/meshblu:test/lib/resetToken-spec.coffee:1:completion
completion
resetToken = require '../../lib/resetToken' describe 'resetToken', -> beforeEach -> @securityImpl = {} @getDevice = sinon.stub() @device = resetToken: sinon.stub() @Device = sinon.spy => @device @emitToClient = sinon.stub() #currying, yo @sut = (fromDevice, uuid, callback) => ...
beforeEach -> @securityImpl.canConfigure = sinon.stub().yields null, false @fromDevice = {} it 'should call getDevice', -> @sut @fromDevice, 1 expect(@getDevice).to.have.been.called it 'should call getDevice with the uuid', -> @sut @fromDevice, 1 expect(@getDevice).to.have....
CoffeeScript
CoffeeScript
octoblu/meshblu
test/lib/resetToken-spec.coffee
MIT
7de2b1bc4b5063cdca0ca0b68925bf49c8bc34fa
815
https://github.com/octoblu/meshblu/blob/7de2b1bc4b5063cdca0ca0b68925bf49c8bc34fa/test/lib/resetToken-spec.coffee
1
39
octoblu/meshblu:test/lib/resetToken-spec.coffee:2:raw_corpus
raw_corpus
it 'should not call securityImpl.canConfigure', -> @sut @fromDevice, 1, -> expect(@securityImpl.canConfigure).to.not.have.been.called describe 'when getDevice returns a device', -> beforeEach -> @theDevice = uuid: 'uuid', name: 'blah' @getDevice.yields null, @theDevice ...
CoffeeScript
octoblu/meshblu
test/lib/resetToken-spec.coffee
MIT
7de2b1bc4b5063cdca0ca0b68925bf49c8bc34fa
815
https://github.com/octoblu/meshblu/blob/7de2b1bc4b5063cdca0ca0b68925bf49c8bc34fa/test/lib/resetToken-spec.coffee
41
82
octoblu/meshblu:test/lib/resetToken-spec.coffee:2:coffee_to_js
coffee_to_js
Convert this CoffeeScript to JavaScript. ```coffeescript it 'should not call securityImpl.canConfigure', -> @sut @fromDevice, 1, -> expect(@securityImpl.canConfigure).to.not.have.been.called describe 'when getDevice returns a device', -> beforeEach -> @theDevice = uuid: 'uuid', name: ...
it('should not call securityImpl.canConfigure', function() { this.sut(this.fromDevice, 1, function() {}); return expect(this.securityImpl.canConfigure).to.not.have.been.called; }); describe('when getDevice returns a device', function() { beforeEach(function() { this.theDevice = { uuid: 'uuid', na...
CoffeeScript
JavaScript
octoblu/meshblu
test/lib/resetToken-spec.coffee
MIT
7de2b1bc4b5063cdca0ca0b68925bf49c8bc34fa
815
https://github.com/octoblu/meshblu/blob/7de2b1bc4b5063cdca0ca0b68925bf49c8bc34fa/test/lib/resetToken-spec.coffee
41
82
octoblu/meshblu:test/lib/resetToken-spec.coffee:2:js_to_coffee
js_to_coffee
Convert this JavaScript to CoffeeScript. ```javascript it('should not call securityImpl.canConfigure', function() { this.sut(this.fromDevice, 1, function() {}); return expect(this.securityImpl.canConfigure).to.not.have.been.called; }); describe('when getDevice returns a device', function() { beforeEach(function(...
it 'should not call securityImpl.canConfigure', -> @sut @fromDevice, 1, -> expect(@securityImpl.canConfigure).to.not.have.been.called describe 'when getDevice returns a device', -> beforeEach -> @theDevice = uuid: 'uuid', name: 'blah' @getDevice.yields null, @theDevice ...
JavaScript
CoffeeScript
octoblu/meshblu
test/lib/resetToken-spec.coffee
MIT
7de2b1bc4b5063cdca0ca0b68925bf49c8bc34fa
815
https://github.com/octoblu/meshblu/blob/7de2b1bc4b5063cdca0ca0b68925bf49c8bc34fa/test/lib/resetToken-spec.coffee
41
82
octoblu/meshblu:test/lib/resetToken-spec.coffee:2:completion
completion
it 'should not call securityImpl.canConfigure', -> @sut @fromDevice, 1, -> expect(@securityImpl.canConfigure).to.not.have.been.called describe 'when getDevice returns a device', -> beforeEach -> @theDevice = uuid: 'uuid', name: 'blah' @getDevice.yields null, @theDevice ...
it 'should call the callback with "unauthorized"', -> callback = sinon.spy() @sut @fromDevice, 3, callback expect(callback).to.have.been.calledWith 'unauthorized' describe 'when securityImpl.canConfigure returns true', -> beforeEach -> @securityImpl.canConfigure.yi...
CoffeeScript
CoffeeScript
octoblu/meshblu
test/lib/resetToken-spec.coffee
MIT
7de2b1bc4b5063cdca0ca0b68925bf49c8bc34fa
815
https://github.com/octoblu/meshblu/blob/7de2b1bc4b5063cdca0ca0b68925bf49c8bc34fa/test/lib/resetToken-spec.coffee
41
82
octoblu/meshblu:test/lib/resetToken-spec.coffee:3:raw_corpus
raw_corpus
it 'should call the callback with an error', -> callback = sinon.spy() @sut @fromDevice, 3, callback expect(callback).to.be.calledWith 'error updating device' describe 'when device.resetToken returns without an error', -> beforeEach -> @device.resetToke...
CoffeeScript
octoblu/meshblu
test/lib/resetToken-spec.coffee
MIT
7de2b1bc4b5063cdca0ca0b68925bf49c8bc34fa
815
https://github.com/octoblu/meshblu/blob/7de2b1bc4b5063cdca0ca0b68925bf49c8bc34fa/test/lib/resetToken-spec.coffee
84
114
octoblu/meshblu:test/lib/resetToken-spec.coffee:3:coffee_to_js
coffee_to_js
Convert this CoffeeScript to JavaScript. ```coffeescript it 'should call the callback with an error', -> callback = sinon.spy() @sut @fromDevice, 3, callback expect(callback).to.be.calledWith 'error updating device' describe 'when device.resetToken returns without an error',...
it('should call the callback with an error', function() { var callback; callback = sinon.spy(); this.sut(this.fromDevice, 3, callback); return expect(callback).to.be.calledWith('error updating device'); }); describe('when device.resetToken returns without an error', function() { beforeEach(function() { r...
CoffeeScript
JavaScript
octoblu/meshblu
test/lib/resetToken-spec.coffee
MIT
7de2b1bc4b5063cdca0ca0b68925bf49c8bc34fa
815
https://github.com/octoblu/meshblu/blob/7de2b1bc4b5063cdca0ca0b68925bf49c8bc34fa/test/lib/resetToken-spec.coffee
84
114
octoblu/meshblu:test/lib/resetToken-spec.coffee:3:js_to_coffee
js_to_coffee
Convert this JavaScript to CoffeeScript. ```javascript it('should call the callback with an error', function() { var callback; callback = sinon.spy(); this.sut(this.fromDevice, 3, callback); return expect(callback).to.be.calledWith('error updating device'); }); describe('when device.resetToken returns without ...
it 'should call the callback with an error', -> callback = sinon.spy() @sut @fromDevice, 3, callback expect(callback).to.be.calledWith 'error updating device' describe 'when device.resetToken returns without an error', -> beforeEach -> @device.resetToke...
JavaScript
CoffeeScript
octoblu/meshblu
test/lib/resetToken-spec.coffee
MIT
7de2b1bc4b5063cdca0ca0b68925bf49c8bc34fa
815
https://github.com/octoblu/meshblu/blob/7de2b1bc4b5063cdca0ca0b68925bf49c8bc34fa/test/lib/resetToken-spec.coffee
84
114
octoblu/meshblu:test/lib/resetToken-spec.coffee:3:completion
completion
it 'should call the callback with an error', -> callback = sinon.spy() @sut @fromDevice, 3, callback expect(callback).to.be.calledWith 'error updating device' describe 'when device.resetToken returns without an error', -> beforeEach -> @device.resetToke...
expect(@emitToClient).to.have.been.calledWith('notReady', @fromDevice) describe 'when it is called with a different fromDevice and uuid', -> beforeEach -> @fromDevice = a: 'different', one : 'true' @securityImpl.canConfigure = sinon.spy() @theDevice = uuid: '2', name: 'Koshin' @getDevice....
CoffeeScript
CoffeeScript
octoblu/meshblu
test/lib/resetToken-spec.coffee
MIT
7de2b1bc4b5063cdca0ca0b68925bf49c8bc34fa
815
https://github.com/octoblu/meshblu/blob/7de2b1bc4b5063cdca0ca0b68925bf49c8bc34fa/test/lib/resetToken-spec.coffee
84
114
octoblu/meshblu:test/lib/resetToken-spec.coffee:1:raw_corpus
raw_corpus
resetToken = require '../../lib/resetToken' describe 'resetToken', -> beforeEach -> @securityImpl = {} @getDevice = sinon.stub() @oldUpdateDevice = sinon.stub() @emitToClient = sinon.stub() #currying, yo @sut = (fromDevice, uuid, callback) => resetToken fromDevice, uuid, @emitToClient,...
CoffeeScript
octoblu/meshblu
test/lib/resetToken-spec.coffee
MIT
6c6af069bb29f9ffd0684eb6e519011774bf6579
815
https://github.com/octoblu/meshblu/blob/6c6af069bb29f9ffd0684eb6e519011774bf6579/test/lib/resetToken-spec.coffee
1
41
octoblu/meshblu:test/lib/resetToken-spec.coffee:1:coffee_to_js
coffee_to_js
Convert this CoffeeScript to JavaScript. ```coffeescript resetToken = require '../../lib/resetToken' describe 'resetToken', -> beforeEach -> @securityImpl = {} @getDevice = sinon.stub() @oldUpdateDevice = sinon.stub() @emitToClient = sinon.stub() #currying, yo @sut = (fromDevice, uuid, callb...
var resetToken; resetToken = require('../../lib/resetToken'); describe('resetToken', function() { beforeEach(function() { this.securityImpl = {}; this.getDevice = sinon.stub(); this.oldUpdateDevice = sinon.stub(); this.emitToClient = sinon.stub(); //currying, yo return this.sut = (fromDevice...
CoffeeScript
JavaScript
octoblu/meshblu
test/lib/resetToken-spec.coffee
MIT
6c6af069bb29f9ffd0684eb6e519011774bf6579
815
https://github.com/octoblu/meshblu/blob/6c6af069bb29f9ffd0684eb6e519011774bf6579/test/lib/resetToken-spec.coffee
1
41
octoblu/meshblu:test/lib/resetToken-spec.coffee:1:js_to_coffee
js_to_coffee
Convert this JavaScript to CoffeeScript. ```javascript var resetToken; resetToken = require('../../lib/resetToken'); describe('resetToken', function() { beforeEach(function() { this.securityImpl = {}; this.getDevice = sinon.stub(); this.oldUpdateDevice = sinon.stub(); this.emitToClient = sinon.stub(...
resetToken = require '../../lib/resetToken' describe 'resetToken', -> beforeEach -> @securityImpl = {} @getDevice = sinon.stub() @oldUpdateDevice = sinon.stub() @emitToClient = sinon.stub() #currying, yo @sut = (fromDevice, uuid, callback) => resetToken fromDevice, uuid, @emitToClient,...
JavaScript
CoffeeScript
octoblu/meshblu
test/lib/resetToken-spec.coffee
MIT
6c6af069bb29f9ffd0684eb6e519011774bf6579
815
https://github.com/octoblu/meshblu/blob/6c6af069bb29f9ffd0684eb6e519011774bf6579/test/lib/resetToken-spec.coffee
1
41
octoblu/meshblu:test/lib/resetToken-spec.coffee:1:completion
completion
resetToken = require '../../lib/resetToken' describe 'resetToken', -> beforeEach -> @securityImpl = {} @getDevice = sinon.stub() @oldUpdateDevice = sinon.stub() @emitToClient = sinon.stub() #currying, yo @sut = (fromDevice, uuid, callback) => resetToken fromDevice, uuid, @emitToClient,...
it 'should call getDevice', -> @sut @fromDevice, 1 expect(@getDevice).to.have.been.called it 'should call getDevice with the uuid', -> @sut @fromDevice, 1 expect(@getDevice).to.have.been.calledWith 1 describe 'when getDevice yields an error', -> beforeEach -> @getDevice.y...
CoffeeScript
CoffeeScript
octoblu/meshblu
test/lib/resetToken-spec.coffee
MIT
6c6af069bb29f9ffd0684eb6e519011774bf6579
815
https://github.com/octoblu/meshblu/blob/6c6af069bb29f9ffd0684eb6e519011774bf6579/test/lib/resetToken-spec.coffee
1
41
octoblu/meshblu:test/lib/resetToken-spec.coffee:2:raw_corpus
raw_corpus
describe 'when getDevice returns a device', -> beforeEach -> @device = uuid: 'uuid', name: 'blah' @getDevice.yields null, @device it 'should call securityImpl.canConfigure', -> @sut @fromDevice, 1 expect(@securityImpl.canConfigure).to.have.been.called it 'should have ...
CoffeeScript
octoblu/meshblu
test/lib/resetToken-spec.coffee
MIT
6c6af069bb29f9ffd0684eb6e519011774bf6579
815
https://github.com/octoblu/meshblu/blob/6c6af069bb29f9ffd0684eb6e519011774bf6579/test/lib/resetToken-spec.coffee
43
82
octoblu/meshblu:test/lib/resetToken-spec.coffee:2:coffee_to_js
coffee_to_js
Convert this CoffeeScript to JavaScript. ```coffeescript describe 'when getDevice returns a device', -> beforeEach -> @device = uuid: 'uuid', name: 'blah' @getDevice.yields null, @device it 'should call securityImpl.canConfigure', -> @sut @fromDevice, 1 expect(@securityImpl....
describe('when getDevice returns a device', function() { beforeEach(function() { this.device = { uuid: 'uuid', name: 'blah' }; return this.getDevice.yields(null, this.device); }); it('should call securityImpl.canConfigure', function() { this.sut(this.fromDevice, 1); return expect(t...
CoffeeScript
JavaScript
octoblu/meshblu
test/lib/resetToken-spec.coffee
MIT
6c6af069bb29f9ffd0684eb6e519011774bf6579
815
https://github.com/octoblu/meshblu/blob/6c6af069bb29f9ffd0684eb6e519011774bf6579/test/lib/resetToken-spec.coffee
43
82
octoblu/meshblu:test/lib/resetToken-spec.coffee:2:js_to_coffee
js_to_coffee
Convert this JavaScript to CoffeeScript. ```javascript describe('when getDevice returns a device', function() { beforeEach(function() { this.device = { uuid: 'uuid', name: 'blah' }; return this.getDevice.yields(null, this.device); }); it('should call securityImpl.canConfigure', function() ...
describe 'when getDevice returns a device', -> beforeEach -> @device = uuid: 'uuid', name: 'blah' @getDevice.yields null, @device it 'should call securityImpl.canConfigure', -> @sut @fromDevice, 1 expect(@securityImpl.canConfigure).to.have.been.called it 'should have ...
JavaScript
CoffeeScript
octoblu/meshblu
test/lib/resetToken-spec.coffee
MIT
6c6af069bb29f9ffd0684eb6e519011774bf6579
815
https://github.com/octoblu/meshblu/blob/6c6af069bb29f9ffd0684eb6e519011774bf6579/test/lib/resetToken-spec.coffee
43
82
octoblu/meshblu:test/lib/resetToken-spec.coffee:2:completion
completion
describe 'when getDevice returns a device', -> beforeEach -> @device = uuid: 'uuid', name: 'blah' @getDevice.yields null, @device it 'should call securityImpl.canConfigure', -> @sut @fromDevice, 1 expect(@securityImpl.canConfigure).to.have.been.called it 'should have ...
expect(callback).to.have.been.calledWith 'unauthorized' describe 'when securityImpl.canConfigure returns true', -> beforeEach -> @securityImpl.canConfigure.yields null, true it 'should not call the callback with "unauthorized"', -> callback = sinon.spy() @sut @fromD...
CoffeeScript
CoffeeScript
octoblu/meshblu
test/lib/resetToken-spec.coffee
MIT
6c6af069bb29f9ffd0684eb6e519011774bf6579
815
https://github.com/octoblu/meshblu/blob/6c6af069bb29f9ffd0684eb6e519011774bf6579/test/lib/resetToken-spec.coffee
43
82
octoblu/meshblu:test/lib/resetToken-spec.coffee:3:raw_corpus
raw_corpus
it 'should update the device with a token greater than 20 characters long', -> @sut @fromDevice, 3 args = @oldUpdateDevice.args[0] expect(args[1].token.length).to.be.greaterThan 20 expect(args[1].token).to.be.a 'string' it 'should update the device with a different token...
CoffeeScript
octoblu/meshblu
test/lib/resetToken-spec.coffee
MIT
6c6af069bb29f9ffd0684eb6e519011774bf6579
815
https://github.com/octoblu/meshblu/blob/6c6af069bb29f9ffd0684eb6e519011774bf6579/test/lib/resetToken-spec.coffee
84
126
octoblu/meshblu:test/lib/resetToken-spec.coffee:3:coffee_to_js
coffee_to_js
Convert this CoffeeScript to JavaScript. ```coffeescript it 'should update the device with a token greater than 20 characters long', -> @sut @fromDevice, 3 args = @oldUpdateDevice.args[0] expect(args[1].token.length).to.be.greaterThan 20 expect(args[1].token).to.be.a 'string' ...
it('should update the device with a token greater than 20 characters long', function() { var args; this.sut(this.fromDevice, 3); args = this.oldUpdateDevice.args[0]; expect(args[1].token.length).to.be.greaterThan(20); return expect(args[1].token).to.be.a('string'); }); it('should update the device with a dif...
CoffeeScript
JavaScript
octoblu/meshblu
test/lib/resetToken-spec.coffee
MIT
6c6af069bb29f9ffd0684eb6e519011774bf6579
815
https://github.com/octoblu/meshblu/blob/6c6af069bb29f9ffd0684eb6e519011774bf6579/test/lib/resetToken-spec.coffee
84
126
octoblu/meshblu:test/lib/resetToken-spec.coffee:3:js_to_coffee
js_to_coffee
Convert this JavaScript to CoffeeScript. ```javascript it('should update the device with a token greater than 20 characters long', function() { var args; this.sut(this.fromDevice, 3); args = this.oldUpdateDevice.args[0]; expect(args[1].token.length).to.be.greaterThan(20); return expect(args[1].token).to.be.a(...
it 'should update the device with a token greater than 20 characters long', -> @sut @fromDevice, 3 args = @oldUpdateDevice.args[0] expect(args[1].token.length).to.be.greaterThan 20 expect(args[1].token).to.be.a 'string' it 'should update the device with a different token...
JavaScript
CoffeeScript
octoblu/meshblu
test/lib/resetToken-spec.coffee
MIT
6c6af069bb29f9ffd0684eb6e519011774bf6579
815
https://github.com/octoblu/meshblu/blob/6c6af069bb29f9ffd0684eb6e519011774bf6579/test/lib/resetToken-spec.coffee
84
126
octoblu/meshblu:test/lib/resetToken-spec.coffee:3:completion
completion
it 'should update the device with a token greater than 20 characters long', -> @sut @fromDevice, 3 args = @oldUpdateDevice.args[0] expect(args[1].token.length).to.be.greaterThan 20 expect(args[1].token).to.be.a 'string' it 'should update the device with a different token...
expect(callback).to.be.calledWith 'error updating device' describe 'when oldUpdateDevice returns without an error', -> beforeEach -> @oldUpdateDevice.yields undefined, @fromDevice it 'should return a token', -> callback = sinon.spy() @sut @fromDevice, 3,...
CoffeeScript
CoffeeScript
octoblu/meshblu
test/lib/resetToken-spec.coffee
MIT
6c6af069bb29f9ffd0684eb6e519011774bf6579
815
https://github.com/octoblu/meshblu/blob/6c6af069bb29f9ffd0684eb6e519011774bf6579/test/lib/resetToken-spec.coffee
84
126
octoblu/meshblu:test/lib/resetToken-spec.coffee:4:raw_corpus
raw_corpus
it 'should call getDevice with a different uuid', -> @sut @fromDevice, 2 expect(@getDevice).to.have.been.calledWith 2 it 'should call securityImpl.canConfigure with the different fromDevice & uuid', -> @sut @fromDevice, '2' expect(@securityImpl.canConfigure).to.have.been.calledWith @fromDev...
CoffeeScript
octoblu/meshblu
test/lib/resetToken-spec.coffee
MIT
6c6af069bb29f9ffd0684eb6e519011774bf6579
815
https://github.com/octoblu/meshblu/blob/6c6af069bb29f9ffd0684eb6e519011774bf6579/test/lib/resetToken-spec.coffee
128
134
octoblu/meshblu:test/lib/resetToken-spec.coffee:4:coffee_to_js
coffee_to_js
Convert this CoffeeScript to JavaScript. ```coffeescript it 'should call getDevice with a different uuid', -> @sut @fromDevice, 2 expect(@getDevice).to.have.been.calledWith 2 it 'should call securityImpl.canConfigure with the different fromDevice & uuid', -> @sut @fromDevice, '2' expect(@se...
it('should call getDevice with a different uuid', function() { this.sut(this.fromDevice, 2); return expect(this.getDevice).to.have.been.calledWith(2); }); it('should call securityImpl.canConfigure with the different fromDevice & uuid', function() { this.sut(this.fromDevice, '2'); return expect(this.securityImp...
CoffeeScript
JavaScript
octoblu/meshblu
test/lib/resetToken-spec.coffee
MIT
6c6af069bb29f9ffd0684eb6e519011774bf6579
815
https://github.com/octoblu/meshblu/blob/6c6af069bb29f9ffd0684eb6e519011774bf6579/test/lib/resetToken-spec.coffee
128
134
octoblu/meshblu:test/lib/resetToken-spec.coffee:4:js_to_coffee
js_to_coffee
Convert this JavaScript to CoffeeScript. ```javascript it('should call getDevice with a different uuid', function() { this.sut(this.fromDevice, 2); return expect(this.getDevice).to.have.been.calledWith(2); }); it('should call securityImpl.canConfigure with the different fromDevice & uuid', function() { this.sut(...
it 'should call getDevice with a different uuid', -> @sut @fromDevice, 2 expect(@getDevice).to.have.been.calledWith 2 it 'should call securityImpl.canConfigure with the different fromDevice & uuid', -> @sut @fromDevice, '2' expect(@securityImpl.canConfigure).to.have.been.calledWith @fromDev...
JavaScript
CoffeeScript
octoblu/meshblu
test/lib/resetToken-spec.coffee
MIT
6c6af069bb29f9ffd0684eb6e519011774bf6579
815
https://github.com/octoblu/meshblu/blob/6c6af069bb29f9ffd0684eb6e519011774bf6579/test/lib/resetToken-spec.coffee
128
134
octoblu/meshblu:test/lib/resetToken-spec.coffee:4:completion
completion
it 'should call getDevice with a different uuid', -> @sut @fromDevice, 2 expect(@getDevice).to.have.been.calledWith 2
it 'should call securityImpl.canConfigure with the different fromDevice & uuid', -> @sut @fromDevice, '2' expect(@securityImpl.canConfigure).to.have.been.calledWith @fromDevice, @device
CoffeeScript
CoffeeScript
octoblu/meshblu
test/lib/resetToken-spec.coffee
MIT
6c6af069bb29f9ffd0684eb6e519011774bf6579
815
https://github.com/octoblu/meshblu/blob/6c6af069bb29f9ffd0684eb6e519011774bf6579/test/lib/resetToken-spec.coffee
128
134
jianliaoim/talk-os:talk-web/client/util/pinyin.coffee:1:raw_corpus
raw_corpus
Immutable = require 'immutable' pinyin = require 'pinyin' # from talk-api2x server/util/array.coffee arrHorizon = (candidates) -> concatPinyins = [] _append = (word) -> return concatPinyins = [[word]] unless concatPinyins.length pinyins.push(word) for pinyins in concatPinyins _expand = (word) -> clo...
CoffeeScript
jianliaoim/talk-os
talk-web/client/util/pinyin.coffee
MIT
2545c4497865779a55762e03963a39237df9046b
2,703
https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-web/client/util/pinyin.coffee
1
35
jianliaoim/talk-os:talk-web/client/util/pinyin.coffee:1:coffee_to_js
coffee_to_js
Convert this CoffeeScript to JavaScript. ```coffeescript Immutable = require 'immutable' pinyin = require 'pinyin' # from talk-api2x server/util/array.coffee arrHorizon = (candidates) -> concatPinyins = [] _append = (word) -> return concatPinyins = [[word]] unless concatPinyins.length pinyins.push(word) fo...
var Immutable, arrHorizon, pinyin; Immutable = require('immutable'); pinyin = require('pinyin'); // from talk-api2x server/util/array.coffee arrHorizon = function(candidates) { var _append, _expand, concatPinyins, heteronym, i, j, len, word; concatPinyins = []; _append = function(word) { var j, len, pinyin...
CoffeeScript
JavaScript
jianliaoim/talk-os
talk-web/client/util/pinyin.coffee
MIT
2545c4497865779a55762e03963a39237df9046b
2,703
https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-web/client/util/pinyin.coffee
1
35
jianliaoim/talk-os:talk-web/client/util/pinyin.coffee:1:js_to_coffee
js_to_coffee
Convert this JavaScript to CoffeeScript. ```javascript var Immutable, arrHorizon, pinyin; Immutable = require('immutable'); pinyin = require('pinyin'); // from talk-api2x server/util/array.coffee arrHorizon = function(candidates) { var _append, _expand, concatPinyins, heteronym, i, j, len, word; concatPinyins = ...
Immutable = require 'immutable' pinyin = require 'pinyin' # from talk-api2x server/util/array.coffee arrHorizon = (candidates) -> concatPinyins = [] _append = (word) -> return concatPinyins = [[word]] unless concatPinyins.length pinyins.push(word) for pinyins in concatPinyins _expand = (word) -> clo...
JavaScript
CoffeeScript
jianliaoim/talk-os
talk-web/client/util/pinyin.coffee
MIT
2545c4497865779a55762e03963a39237df9046b
2,703
https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-web/client/util/pinyin.coffee
1
35
jianliaoim/talk-os:talk-web/client/util/pinyin.coffee:1:completion
completion
Immutable = require 'immutable' pinyin = require 'pinyin' # from talk-api2x server/util/array.coffee arrHorizon = (candidates) -> concatPinyins = [] _append = (word) -> return concatPinyins = [[word]] unless concatPinyins.length pinyins.push(word) for pinyins in concatPinyins _expand = (word) -> clo...
for i, word of heteronym if i is '0' _append word else _expand word concatPinyins.map (arr) -> arr.join('').toLowerCase() exports.make = (word) -> return unless word pinyins = arrHorizon(pinyin(word, heteronym: true, style: pinyin.STYLE_NORMAL)) pys = arrHorizon(pinyin(word, hetero...
CoffeeScript
CoffeeScript
jianliaoim/talk-os
talk-web/client/util/pinyin.coffee
MIT
2545c4497865779a55762e03963a39237df9046b
2,703
https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-web/client/util/pinyin.coffee
1
35
js2coffee/js2coffee:lib/report.coffee:1:raw_corpus
raw_corpus
{eachGroup} = require('./specs_iterator') eachGroup (group) -> return if group.pending console.log "## #{group.name}\n" for spec in group.specs console.log """ <table> <tr> <th width='33%' valign='top'>#{spec.name}</th> <td width='33%' valign='top'> <pre><code class='lang-js'>#...
CoffeeScript
js2coffee/js2coffee
lib/report.coffee
MIT
3bf367ff7d4ede3112a901490a34c05b9c3a2f0c
2,082
https://github.com/js2coffee/js2coffee/blob/3bf367ff7d4ede3112a901490a34c05b9c3a2f0c/lib/report.coffee
1
26
js2coffee/js2coffee:lib/report.coffee:1:coffee_to_js
coffee_to_js
Convert this CoffeeScript to JavaScript. ```coffeescript {eachGroup} = require('./specs_iterator') eachGroup (group) -> return if group.pending console.log "## #{group.name}\n" for spec in group.specs console.log """ <table> <tr> <th width='33%' valign='top'>#{spec.name}</th> <td wid...
var eachGroup; ({eachGroup} = require('./specs_iterator')); eachGroup(function(group) { var i, len, lines, notes, ref, ref1, results, spec; if (group.pending) { return; } console.log(`## ${group.name}\n`); ref = group.specs; results = []; for (i = 0, len = ref.length; i < len; i++) { spec = ref[...
CoffeeScript
JavaScript
js2coffee/js2coffee
lib/report.coffee
MIT
3bf367ff7d4ede3112a901490a34c05b9c3a2f0c
2,082
https://github.com/js2coffee/js2coffee/blob/3bf367ff7d4ede3112a901490a34c05b9c3a2f0c/lib/report.coffee
1
26
js2coffee/js2coffee:lib/report.coffee:1:js_to_coffee
js_to_coffee
Convert this JavaScript to CoffeeScript. ```javascript var eachGroup; ({eachGroup} = require('./specs_iterator')); eachGroup(function(group) { var i, len, lines, notes, ref, ref1, results, spec; if (group.pending) { return; } console.log(`## ${group.name}\n`); ref = group.specs; results = []; for (i...
{eachGroup} = require('./specs_iterator') eachGroup (group) -> return if group.pending console.log "## #{group.name}\n" for spec in group.specs console.log """ <table> <tr> <th width='33%' valign='top'>#{spec.name}</th> <td width='33%' valign='top'> <pre><code class='lang-js'>#...
JavaScript
CoffeeScript
js2coffee/js2coffee
lib/report.coffee
MIT
3bf367ff7d4ede3112a901490a34c05b9c3a2f0c
2,082
https://github.com/js2coffee/js2coffee/blob/3bf367ff7d4ede3112a901490a34c05b9c3a2f0c/lib/report.coffee
1
26
js2coffee/js2coffee:lib/report.coffee:1:completion
completion
{eachGroup} = require('./specs_iterator') eachGroup (group) -> return if group.pending console.log "## #{group.name}\n" for spec in group.specs console.log """ <table> <tr> <th width='33%' valign='top'>#{spec.name}</th> <td width='33%' valign='top'> <pre><code class='lang-js'>#...
</td> <td width='33%' valign='top'> <pre><code class='lang-coffee'>#{spec.output}</code></pre> </td> </tr> </table>\n """ notes = spec.meta?.notes if notes lines = notes.split("\n").map (l) -> "> #{l}" notes = lines.join("\n") console.log "#{notes}\n"
CoffeeScript
CoffeeScript
js2coffee/js2coffee
lib/report.coffee
MIT
3bf367ff7d4ede3112a901490a34c05b9c3a2f0c
2,082
https://github.com/js2coffee/js2coffee/blob/3bf367ff7d4ede3112a901490a34c05b9c3a2f0c/lib/report.coffee
1
26
js2coffee/js2coffee:lib/report.coffee:1:raw_corpus
raw_corpus
path = require('path') glob = require('glob') fs = require('fs') groups = glob.sync("#{__dirname}/../specs/*") toName = (dirname) -> s = path.basename(dirname).replace(/_/g, ' ').trim() s = s.replace(/\.txt$/, '') s.substr(0,1).toUpperCase() + s.substr(1) console.log """ <table width='100%'> <thead> <tr...
CoffeeScript
js2coffee/js2coffee
lib/report.coffee
MIT
94bd047c9e9c8ceed0a969c54a3b2e8ef1c35a72
2,082
https://github.com/js2coffee/js2coffee/blob/94bd047c9e9c8ceed0a969c54a3b2e8ef1c35a72/lib/report.coffee
1
50
js2coffee/js2coffee:lib/report.coffee:1:coffee_to_js
coffee_to_js
Convert this CoffeeScript to JavaScript. ```coffeescript path = require('path') glob = require('glob') fs = require('fs') groups = glob.sync("#{__dirname}/../specs/*") toName = (dirname) -> s = path.basename(dirname).replace(/_/g, ' ').trim() s = s.replace(/\.txt$/, '') s.substr(0,1).toUpperCase() + s.substr(1) ...
var data, fs, glob, group, groups, i, input, isPending, j, len, len1, meta, name, output, path, spec, specs, toName; path = require('path'); glob = require('glob'); fs = require('fs'); groups = glob.sync(`${__dirname}/../specs/*`); toName = function(dirname) { var s; s = path.basename(dirname).replace(/_/g, ' ...
CoffeeScript
JavaScript
js2coffee/js2coffee
lib/report.coffee
MIT
94bd047c9e9c8ceed0a969c54a3b2e8ef1c35a72
2,082
https://github.com/js2coffee/js2coffee/blob/94bd047c9e9c8ceed0a969c54a3b2e8ef1c35a72/lib/report.coffee
1
50
js2coffee/js2coffee:lib/report.coffee:1:js_to_coffee
js_to_coffee
Convert this JavaScript to CoffeeScript. ```javascript var data, fs, glob, group, groups, i, input, isPending, j, len, len1, meta, name, output, path, spec, specs, toName; path = require('path'); glob = require('glob'); fs = require('fs'); groups = glob.sync(`${__dirname}/../specs/*`); toName = function(dirname) {...
path = require('path') glob = require('glob') fs = require('fs') groups = glob.sync("#{__dirname}/../specs/*") toName = (dirname) -> s = path.basename(dirname).replace(/_/g, ' ').trim() s = s.replace(/\.txt$/, '') s.substr(0,1).toUpperCase() + s.substr(1) console.log """ <table width='100%'> <thead> <tr...
JavaScript
CoffeeScript
js2coffee/js2coffee
lib/report.coffee
MIT
94bd047c9e9c8ceed0a969c54a3b2e8ef1c35a72
2,082
https://github.com/js2coffee/js2coffee/blob/94bd047c9e9c8ceed0a969c54a3b2e8ef1c35a72/lib/report.coffee
1
50
js2coffee/js2coffee:lib/report.coffee:1:completion
completion
path = require('path') glob = require('glob') fs = require('fs') groups = glob.sync("#{__dirname}/../specs/*") toName = (dirname) -> s = path.basename(dirname).replace(/_/g, ' ').trim() s = s.replace(/\.txt$/, '') s.substr(0,1).toUpperCase() + s.substr(1) console.log """ <table width='100%'> <thead> <tr...
specs = glob.sync("#{group}/*") for spec in specs name = toName(spec) isPending = ~group.indexOf('pending') or ~name.indexOf('pending') continue if isPending data = fs.readFileSync(spec, 'utf-8') [meta, input, output] = data.split('----\n') console.log """ <tr> <th valign='top'>...
CoffeeScript
CoffeeScript
js2coffee/js2coffee
lib/report.coffee
MIT
94bd047c9e9c8ceed0a969c54a3b2e8ef1c35a72
2,082
https://github.com/js2coffee/js2coffee/blob/94bd047c9e9c8ceed0a969c54a3b2e8ef1c35a72/lib/report.coffee
1
50
js2coffee/js2coffee:lib/report.coffee:1:raw_corpus
raw_corpus
path = require('path') glob = require('glob') fs = require('fs') groups = glob.sync("#{__dirname}/../specs/*") toName = (dirname) -> s = path.basename(dirname).replace(/_/g, ' ').trim() s = s.replace(/\.txt$/, '') s.substr(0,1).toUpperCase() + s.substr(1) console.log """ <table width='100%'> <thead> <tr...
CoffeeScript
js2coffee/js2coffee
lib/report.coffee
MIT
9372bc455c6b1e6d1b8925fc2cef79c683a7825a
2,082
https://github.com/js2coffee/js2coffee/blob/9372bc455c6b1e6d1b8925fc2cef79c683a7825a/lib/report.coffee
1
50
js2coffee/js2coffee:lib/report.coffee:1:coffee_to_js
coffee_to_js
Convert this CoffeeScript to JavaScript. ```coffeescript path = require('path') glob = require('glob') fs = require('fs') groups = glob.sync("#{__dirname}/../specs/*") toName = (dirname) -> s = path.basename(dirname).replace(/_/g, ' ').trim() s = s.replace(/\.txt$/, '') s.substr(0,1).toUpperCase() + s.substr(1) ...
var data, fs, glob, group, groups, i, input, isPending, j, len, len1, meta, name, output, path, spec, specs, toName; path = require('path'); glob = require('glob'); fs = require('fs'); groups = glob.sync(`${__dirname}/../specs/*`); toName = function(dirname) { var s; s = path.basename(dirname).replace(/_/g, ' ...
CoffeeScript
JavaScript
js2coffee/js2coffee
lib/report.coffee
MIT
9372bc455c6b1e6d1b8925fc2cef79c683a7825a
2,082
https://github.com/js2coffee/js2coffee/blob/9372bc455c6b1e6d1b8925fc2cef79c683a7825a/lib/report.coffee
1
50
js2coffee/js2coffee:lib/report.coffee:1:js_to_coffee
js_to_coffee
Convert this JavaScript to CoffeeScript. ```javascript var data, fs, glob, group, groups, i, input, isPending, j, len, len1, meta, name, output, path, spec, specs, toName; path = require('path'); glob = require('glob'); fs = require('fs'); groups = glob.sync(`${__dirname}/../specs/*`); toName = function(dirname) {...
path = require('path') glob = require('glob') fs = require('fs') groups = glob.sync("#{__dirname}/../specs/*") toName = (dirname) -> s = path.basename(dirname).replace(/_/g, ' ').trim() s = s.replace(/\.txt$/, '') s.substr(0,1).toUpperCase() + s.substr(1) console.log """ <table width='100%'> <thead> <tr...
JavaScript
CoffeeScript
js2coffee/js2coffee
lib/report.coffee
MIT
9372bc455c6b1e6d1b8925fc2cef79c683a7825a
2,082
https://github.com/js2coffee/js2coffee/blob/9372bc455c6b1e6d1b8925fc2cef79c683a7825a/lib/report.coffee
1
50
js2coffee/js2coffee:lib/report.coffee:1:completion
completion
path = require('path') glob = require('glob') fs = require('fs') groups = glob.sync("#{__dirname}/../specs/*") toName = (dirname) -> s = path.basename(dirname).replace(/_/g, ' ').trim() s = s.replace(/\.txt$/, '') s.substr(0,1).toUpperCase() + s.substr(1) console.log """ <table width='100%'> <thead> <tr...
specs = glob.sync("#{group}/*") for spec in specs name = toName(spec) isPending = ~group.indexOf('pending') or ~name.indexOf('pending') continue if isPending data = fs.readFileSync(spec, 'utf-8') [meta, input, output] = data.split('----\n') console.log """ <tr> <th valign='top'>...
CoffeeScript
CoffeeScript
js2coffee/js2coffee
lib/report.coffee
MIT
9372bc455c6b1e6d1b8925fc2cef79c683a7825a
2,082
https://github.com/js2coffee/js2coffee/blob/9372bc455c6b1e6d1b8925fc2cef79c683a7825a/lib/report.coffee
1
50
js2coffee/js2coffee:lib/report.coffee:1:raw_corpus
raw_corpus
path = require('path') glob = require('glob') fs = require('fs') groups = glob.sync("#{__dirname}/../specs/*") toName = (dirname) -> s = path.basename(dirname).replace(/_/g, ' ').trim() s.substr(0,1).toUpperCase() + s.substr(1) console.log """ <table width='100%'> <thead> <tr> <th width='33%'>Exampl...
CoffeeScript
js2coffee/js2coffee
lib/report.coffee
MIT
5f90cdcc523fadc5b118b0ad937e8960e65924a3
2,082
https://github.com/js2coffee/js2coffee/blob/5f90cdcc523fadc5b118b0ad937e8960e65924a3/lib/report.coffee
1
49
js2coffee/js2coffee:lib/report.coffee:1:coffee_to_js
coffee_to_js
Convert this CoffeeScript to JavaScript. ```coffeescript path = require('path') glob = require('glob') fs = require('fs') groups = glob.sync("#{__dirname}/../specs/*") toName = (dirname) -> s = path.basename(dirname).replace(/_/g, ' ').trim() s.substr(0,1).toUpperCase() + s.substr(1) console.log """ <table widt...
var data, fs, glob, group, groups, i, input, isPending, j, len, len1, meta, name, output, path, spec, specs, toName; path = require('path'); glob = require('glob'); fs = require('fs'); groups = glob.sync(`${__dirname}/../specs/*`); toName = function(dirname) { var s; s = path.basename(dirname).replace(/_/g, ' ...
CoffeeScript
JavaScript
js2coffee/js2coffee
lib/report.coffee
MIT
5f90cdcc523fadc5b118b0ad937e8960e65924a3
2,082
https://github.com/js2coffee/js2coffee/blob/5f90cdcc523fadc5b118b0ad937e8960e65924a3/lib/report.coffee
1
49
js2coffee/js2coffee:lib/report.coffee:1:js_to_coffee
js_to_coffee
Convert this JavaScript to CoffeeScript. ```javascript var data, fs, glob, group, groups, i, input, isPending, j, len, len1, meta, name, output, path, spec, specs, toName; path = require('path'); glob = require('glob'); fs = require('fs'); groups = glob.sync(`${__dirname}/../specs/*`); toName = function(dirname) {...
path = require('path') glob = require('glob') fs = require('fs') groups = glob.sync("#{__dirname}/../specs/*") toName = (dirname) -> s = path.basename(dirname).replace(/_/g, ' ').trim() s.substr(0,1).toUpperCase() + s.substr(1) console.log """ <table width='100%'> <thead> <tr> <th width='33%'>Exampl...
JavaScript
CoffeeScript
js2coffee/js2coffee
lib/report.coffee
MIT
5f90cdcc523fadc5b118b0ad937e8960e65924a3
2,082
https://github.com/js2coffee/js2coffee/blob/5f90cdcc523fadc5b118b0ad937e8960e65924a3/lib/report.coffee
1
49
js2coffee/js2coffee:lib/report.coffee:1:completion
completion
path = require('path') glob = require('glob') fs = require('fs') groups = glob.sync("#{__dirname}/../specs/*") toName = (dirname) -> s = path.basename(dirname).replace(/_/g, ' ').trim() s.substr(0,1).toUpperCase() + s.substr(1) console.log """ <table width='100%'> <thead> <tr> <th width='33%'>Exampl...
specs = glob.sync("#{group}/*") for spec in specs name = toName(spec) isPending = ~group.indexOf('pending') or ~name.indexOf('pending') continue if isPending data = fs.readFileSync(spec, 'utf-8') [meta, input, output] = data.split('----\n') console.log """ <tr> <th valign='top'>...
CoffeeScript
CoffeeScript
js2coffee/js2coffee
lib/report.coffee
MIT
5f90cdcc523fadc5b118b0ad937e8960e65924a3
2,082
https://github.com/js2coffee/js2coffee/blob/5f90cdcc523fadc5b118b0ad937e8960e65924a3/lib/report.coffee
1
49
js2coffee/js2coffee:lib/report.coffee:1:raw_corpus
raw_corpus
path = require('path') glob = require('glob') fs = require('fs') groups = glob.sync("#{__dirname}/../specs/*") toName = (dirname) -> s = path.basename(dirname).replace(/_/g, ' ').trim() s = s.substr(0,1).toUpperCase() + s.substr(1) s for group in groups console.log "## #{toName(group)}" console.log "" sp...
CoffeeScript
js2coffee/js2coffee
lib/report.coffee
MIT
33ed8c21166ffb73cf24a372d279c1fa49401a5c
2,082
https://github.com/js2coffee/js2coffee/blob/33ed8c21166ffb73cf24a372d279c1fa49401a5c/lib/report.coffee
1
36
js2coffee/js2coffee:lib/report.coffee:1:coffee_to_js
coffee_to_js
Convert this CoffeeScript to JavaScript. ```coffeescript path = require('path') glob = require('glob') fs = require('fs') groups = glob.sync("#{__dirname}/../specs/*") toName = (dirname) -> s = path.basename(dirname).replace(/_/g, ' ').trim() s = s.substr(0,1).toUpperCase() + s.substr(1) s for group in groups ...
var data, fs, glob, group, groups, i, input, isPending, j, len, len1, meta, name, output, path, spec, specs, toName; path = require('path'); glob = require('glob'); fs = require('fs'); groups = glob.sync(`${__dirname}/../specs/*`); toName = function(dirname) { var s; s = path.basename(dirname).replace(/_/g, ' ...
CoffeeScript
JavaScript
js2coffee/js2coffee
lib/report.coffee
MIT
33ed8c21166ffb73cf24a372d279c1fa49401a5c
2,082
https://github.com/js2coffee/js2coffee/blob/33ed8c21166ffb73cf24a372d279c1fa49401a5c/lib/report.coffee
1
36
js2coffee/js2coffee:lib/report.coffee:1:js_to_coffee
js_to_coffee
Convert this JavaScript to CoffeeScript. ```javascript var data, fs, glob, group, groups, i, input, isPending, j, len, len1, meta, name, output, path, spec, specs, toName; path = require('path'); glob = require('glob'); fs = require('fs'); groups = glob.sync(`${__dirname}/../specs/*`); toName = function(dirname) {...
path = require('path') glob = require('glob') fs = require('fs') groups = glob.sync("#{__dirname}/../specs/*") toName = (dirname) -> s = path.basename(dirname).replace(/_/g, ' ').trim() s = s.substr(0,1).toUpperCase() + s.substr(1) s for group in groups console.log "## #{toName(group)}" console.log "" sp...
JavaScript
CoffeeScript
js2coffee/js2coffee
lib/report.coffee
MIT
33ed8c21166ffb73cf24a372d279c1fa49401a5c
2,082
https://github.com/js2coffee/js2coffee/blob/33ed8c21166ffb73cf24a372d279c1fa49401a5c/lib/report.coffee
1
36
js2coffee/js2coffee:lib/report.coffee:1:completion
completion
path = require('path') glob = require('glob') fs = require('fs') groups = glob.sync("#{__dirname}/../specs/*") toName = (dirname) -> s = path.basename(dirname).replace(/_/g, ' ').trim() s = s.substr(0,1).toUpperCase() + s.substr(1) s for group in groups console.log "## #{toName(group)}" console.log "" sp...
isPending = ~group.indexOf('pending') or ~name.indexOf('pending') continue if isPending data = fs.readFileSync(spec, 'utf-8') [meta, input, output] = data.split('----\n') console.log """ ### #{name} <table width='100%'> <tr><th>JavaScript</th><th>CoffeeScript</th></tr> <tr><td...
CoffeeScript
CoffeeScript
js2coffee/js2coffee
lib/report.coffee
MIT
33ed8c21166ffb73cf24a372d279c1fa49401a5c
2,082
https://github.com/js2coffee/js2coffee/blob/33ed8c21166ffb73cf24a372d279c1fa49401a5c/lib/report.coffee
1
36
js2coffee/js2coffee:lib/report.coffee:1:raw_corpus
raw_corpus
path = require('path') glob = require('glob') fs = require('fs') groups = glob.sync("#{__dirname}/../specs/*") toName = (dirname) -> path.basename(dirname).replace(/_/g, ' ').trim() for group in groups console.log "## #{group}" console.log "" specs = glob.sync("#{group}/*") for spec in specs name = to...
CoffeeScript
js2coffee/js2coffee
lib/report.coffee
MIT
48b7fdcc42eeb42a581d7053f32f4ff513b8bab5
2,082
https://github.com/js2coffee/js2coffee/blob/48b7fdcc42eeb42a581d7053f32f4ff513b8bab5/lib/report.coffee
1
34
js2coffee/js2coffee:lib/report.coffee:1:coffee_to_js
coffee_to_js
Convert this CoffeeScript to JavaScript. ```coffeescript path = require('path') glob = require('glob') fs = require('fs') groups = glob.sync("#{__dirname}/../specs/*") toName = (dirname) -> path.basename(dirname).replace(/_/g, ' ').trim() for group in groups console.log "## #{group}" console.log "" specs = g...
var data, fs, glob, group, groups, i, input, isPending, j, len, len1, meta, name, output, path, spec, specs, toName; path = require('path'); glob = require('glob'); fs = require('fs'); groups = glob.sync(`${__dirname}/../specs/*`); toName = function(dirname) { return path.basename(dirname).replace(/_/g, ' ').tri...
CoffeeScript
JavaScript
js2coffee/js2coffee
lib/report.coffee
MIT
48b7fdcc42eeb42a581d7053f32f4ff513b8bab5
2,082
https://github.com/js2coffee/js2coffee/blob/48b7fdcc42eeb42a581d7053f32f4ff513b8bab5/lib/report.coffee
1
34
js2coffee/js2coffee:lib/report.coffee:1:js_to_coffee
js_to_coffee
Convert this JavaScript to CoffeeScript. ```javascript var data, fs, glob, group, groups, i, input, isPending, j, len, len1, meta, name, output, path, spec, specs, toName; path = require('path'); glob = require('glob'); fs = require('fs'); groups = glob.sync(`${__dirname}/../specs/*`); toName = function(dirname) {...
path = require('path') glob = require('glob') fs = require('fs') groups = glob.sync("#{__dirname}/../specs/*") toName = (dirname) -> path.basename(dirname).replace(/_/g, ' ').trim() for group in groups console.log "## #{group}" console.log "" specs = glob.sync("#{group}/*") for spec in specs name = to...
JavaScript
CoffeeScript
js2coffee/js2coffee
lib/report.coffee
MIT
48b7fdcc42eeb42a581d7053f32f4ff513b8bab5
2,082
https://github.com/js2coffee/js2coffee/blob/48b7fdcc42eeb42a581d7053f32f4ff513b8bab5/lib/report.coffee
1
34
js2coffee/js2coffee:lib/report.coffee:1:completion
completion
path = require('path') glob = require('glob') fs = require('fs') groups = glob.sync("#{__dirname}/../specs/*") toName = (dirname) -> path.basename(dirname).replace(/_/g, ' ').trim() for group in groups console.log "## #{group}" console.log "" specs = glob.sync("#{group}/*") for spec in specs name = to...
continue if isPending data = fs.readFileSync(spec, 'utf-8') [meta, input, output] = data.split('----\n') console.log """ ### #{name} <table width='100%'> <tr><th>JavaScript</th><th>CoffeeScript</th></tr> <tr><td width='50%' valign='top'> <pre class='lang-js'>#{input}</pre> ...
CoffeeScript
CoffeeScript
js2coffee/js2coffee
lib/report.coffee
MIT
48b7fdcc42eeb42a581d7053f32f4ff513b8bab5
2,082
https://github.com/js2coffee/js2coffee/blob/48b7fdcc42eeb42a581d7053f32f4ff513b8bab5/lib/report.coffee
1
34
jianliaoim/talk-os:talk-api2x/test/scripts/send-gitlab-webhook.coffee:1:raw_corpus
raw_corpus
request = require 'request' options = method: 'POST' headers: "Content-Type": "application/json" url: 'http://talk.bi/v1/services/webhook/9f16d5cfe7f850d7365fffb8eef6a409f568ea9c' [ 'push' 'issues' 'merge-request' ].forEach (payloadName) -> payload = require "../services/payloads/gitlab-#{payloadNam...
CoffeeScript
jianliaoim/talk-os
talk-api2x/test/scripts/send-gitlab-webhook.coffee
MIT
2545c4497865779a55762e03963a39237df9046b
2,703
https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-api2x/test/scripts/send-gitlab-webhook.coffee
1
15
jianliaoim/talk-os:talk-api2x/test/scripts/send-gitlab-webhook.coffee:1:coffee_to_js
coffee_to_js
Convert this CoffeeScript to JavaScript. ```coffeescript request = require 'request' options = method: 'POST' headers: "Content-Type": "application/json" url: 'http://talk.bi/v1/services/webhook/9f16d5cfe7f850d7365fffb8eef6a409f568ea9c' [ 'push' 'issues' 'merge-request' ].forEach (payloadName) -> pa...
var options, request; request = require('request'); options = { method: 'POST', headers: { "Content-Type": "application/json" }, url: 'http://talk.bi/v1/services/webhook/9f16d5cfe7f850d7365fffb8eef6a409f568ea9c' }; ['push', 'issues', 'merge-request'].forEach(function(payloadName) { var payload; paylo...
CoffeeScript
JavaScript
jianliaoim/talk-os
talk-api2x/test/scripts/send-gitlab-webhook.coffee
MIT
2545c4497865779a55762e03963a39237df9046b
2,703
https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-api2x/test/scripts/send-gitlab-webhook.coffee
1
15
jianliaoim/talk-os:talk-api2x/test/scripts/send-gitlab-webhook.coffee:1:js_to_coffee
js_to_coffee
Convert this JavaScript to CoffeeScript. ```javascript var options, request; request = require('request'); options = { method: 'POST', headers: { "Content-Type": "application/json" }, url: 'http://talk.bi/v1/services/webhook/9f16d5cfe7f850d7365fffb8eef6a409f568ea9c' }; ['push', 'issues', 'merge-request']...
request = require 'request' options = method: 'POST' headers: "Content-Type": "application/json" url: 'http://talk.bi/v1/services/webhook/9f16d5cfe7f850d7365fffb8eef6a409f568ea9c' [ 'push' 'issues' 'merge-request' ].forEach (payloadName) -> payload = require "../services/payloads/gitlab-#{payloadNam...
JavaScript
CoffeeScript
jianliaoim/talk-os
talk-api2x/test/scripts/send-gitlab-webhook.coffee
MIT
2545c4497865779a55762e03963a39237df9046b
2,703
https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-api2x/test/scripts/send-gitlab-webhook.coffee
1
15
jianliaoim/talk-os:talk-api2x/test/scripts/send-gitlab-webhook.coffee:1:completion
completion
request = require 'request' options = method: 'POST' headers: "Content-Type": "application/json" url: 'http://talk.bi/v1/services/webhook/9f16d5cfe7f850d7365fffb8eef6a409f568ea9c'
[ 'push' 'issues' 'merge-request' ].forEach (payloadName) -> payload = require "../services/payloads/gitlab-#{payloadName}" request payload(options), (err, res, body) -> console.log body
CoffeeScript
CoffeeScript
jianliaoim/talk-os
talk-api2x/test/scripts/send-gitlab-webhook.coffee
MIT
2545c4497865779a55762e03963a39237df9046b
2,703
https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-api2x/test/scripts/send-gitlab-webhook.coffee
1
15
ExpediaGroup/cyclotron:cyclotron-site/app/scripts/common/services/services.cryptoService.coffee:1:raw_corpus
raw_corpus
### # Copyright (c) 2013-2018 the original author or authors. # # Licensed under the MIT License (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.opensource.org/licenses/mit-license.php # # Unless required by applicable law ...
CoffeeScript
ExpediaGroup/cyclotron
cyclotron-site/app/scripts/common/services/services.cryptoService.coffee
MIT
0228db71d84a3138a9ffddb50d8f4f8ff37cc5ab
1,544
https://github.com/ExpediaGroup/cyclotron/blob/0228db71d84a3138a9ffddb50d8f4f8ff37cc5ab/cyclotron-site/app/scripts/common/services/services.cryptoService.coffee
1
33
ExpediaGroup/cyclotron:cyclotron-site/app/scripts/common/services/services.cryptoService.coffee:1:coffee_to_js
coffee_to_js
Convert this CoffeeScript to JavaScript. ```coffeescript ### # Copyright (c) 2013-2018 the original author or authors. # # Licensed under the MIT License (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.opensource.org/licens...
/* * Copyright (c) 2013-2018 the original author or authors. * * Licensed under the MIT License (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.opensource.org/licenses/mit-license.php * * Unless required by applica...
CoffeeScript
JavaScript
ExpediaGroup/cyclotron
cyclotron-site/app/scripts/common/services/services.cryptoService.coffee
MIT
0228db71d84a3138a9ffddb50d8f4f8ff37cc5ab
1,544
https://github.com/ExpediaGroup/cyclotron/blob/0228db71d84a3138a9ffddb50d8f4f8ff37cc5ab/cyclotron-site/app/scripts/common/services/services.cryptoService.coffee
1
33
ExpediaGroup/cyclotron:cyclotron-site/app/scripts/common/services/services.cryptoService.coffee:1:js_to_coffee
js_to_coffee
Convert this JavaScript to CoffeeScript. ```javascript /* * Copyright (c) 2013-2018 the original author or authors. * * Licensed under the MIT License (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.opensource.org/li...
### # Copyright (c) 2013-2018 the original author or authors. # # Licensed under the MIT License (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.opensource.org/licenses/mit-license.php # # Unless required by applicable law ...
JavaScript
CoffeeScript
ExpediaGroup/cyclotron
cyclotron-site/app/scripts/common/services/services.cryptoService.coffee
MIT
0228db71d84a3138a9ffddb50d8f4f8ff37cc5ab
1,544
https://github.com/ExpediaGroup/cyclotron/blob/0228db71d84a3138a9ffddb50d8f4f8ff37cc5ab/cyclotron-site/app/scripts/common/services/services.cryptoService.coffee
1
33
ExpediaGroup/cyclotron:cyclotron-site/app/scripts/common/services/services.cryptoService.coffee:1:completion
completion
### # Copyright (c) 2013-2018 the original author or authors. # # Licensed under the MIT License (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.opensource.org/licenses/mit-license.php # # Unless required by applicable law ...
cyclotronServices.factory 'cryptoService', ($http, $q, configService) -> { # Encrypt a string and return the encrypted form encrypt: (value) -> deferred = $q.defer() q = $http.post(configService.restServiceUrl + '/crypto/encrypt', { value: value }) q.success (re...
CoffeeScript
CoffeeScript
ExpediaGroup/cyclotron
cyclotron-site/app/scripts/common/services/services.cryptoService.coffee
MIT
0228db71d84a3138a9ffddb50d8f4f8ff37cc5ab
1,544
https://github.com/ExpediaGroup/cyclotron/blob/0228db71d84a3138a9ffddb50d8f4f8ff37cc5ab/cyclotron-site/app/scripts/common/services/services.cryptoService.coffee
1
33
meltingice/psd.js:lib/psd/resources/guides.coffee:1:raw_corpus
raw_corpus
module.exports = class Guides id: 1032 name: 'guides' constructor: (@resource) -> @file = @resource.file @data = [] parse: -> # Descriptor version @file.seek 4, true # Future implementation of document-specific grids @file.seek 8, true num_guides = @file.readInt() for i in ...
CoffeeScript
meltingice/psd.js
lib/psd/resources/guides.coffee
MIT
7e8392d20fd5d66ad70ddda7309661b9a0ca67c8
2,846
https://github.com/meltingice/psd.js/blob/7e8392d20fd5d66ad70ddda7309661b9a0ca67c8/lib/psd/resources/guides.coffee
1
25
meltingice/psd.js:lib/psd/resources/guides.coffee:1:coffee_to_js
coffee_to_js
Convert this CoffeeScript to JavaScript. ```coffeescript module.exports = class Guides id: 1032 name: 'guides' constructor: (@resource) -> @file = @resource.file @data = [] parse: -> # Descriptor version @file.seek 4, true # Future implementation of document-specific grids @file.seek...
var Guides; module.exports = Guides = (function() { class Guides { constructor(resource) { this.resource = resource; this.file = this.resource.file; this.data = []; } parse() { var direction, i, j, location, num_guides, ref, results; // Descriptor version this.file.se...
CoffeeScript
JavaScript
meltingice/psd.js
lib/psd/resources/guides.coffee
MIT
7e8392d20fd5d66ad70ddda7309661b9a0ca67c8
2,846
https://github.com/meltingice/psd.js/blob/7e8392d20fd5d66ad70ddda7309661b9a0ca67c8/lib/psd/resources/guides.coffee
1
25
meltingice/psd.js:lib/psd/resources/guides.coffee:1:js_to_coffee
js_to_coffee
Convert this JavaScript to CoffeeScript. ```javascript var Guides; module.exports = Guides = (function() { class Guides { constructor(resource) { this.resource = resource; this.file = this.resource.file; this.data = []; } parse() { var direction, i, j, location, num_guides, ref, ...
module.exports = class Guides id: 1032 name: 'guides' constructor: (@resource) -> @file = @resource.file @data = [] parse: -> # Descriptor version @file.seek 4, true # Future implementation of document-specific grids @file.seek 8, true num_guides = @file.readInt() for i in ...
JavaScript
CoffeeScript
meltingice/psd.js
lib/psd/resources/guides.coffee
MIT
7e8392d20fd5d66ad70ddda7309661b9a0ca67c8
2,846
https://github.com/meltingice/psd.js/blob/7e8392d20fd5d66ad70ddda7309661b9a0ca67c8/lib/psd/resources/guides.coffee
1
25
meltingice/psd.js:lib/psd/resources/guides.coffee:1:completion
completion
module.exports = class Guides id: 1032 name: 'guides' constructor: (@resource) -> @file = @resource.file @data = [] parse: -> # Descriptor version @file.seek 4, true
# Future implementation of document-specific grids @file.seek 8, true num_guides = @file.readInt() for i in [1..num_guides] location = (@file.readInt() / 32).toFixed(1) direction = if @file.readByte() then "horizontal" else "vertical" @data.push({ location, direction }) export: -> ...
CoffeeScript
CoffeeScript
meltingice/psd.js
lib/psd/resources/guides.coffee
MIT
7e8392d20fd5d66ad70ddda7309661b9a0ca67c8
2,846
https://github.com/meltingice/psd.js/blob/7e8392d20fd5d66ad70ddda7309661b9a0ca67c8/lib/psd/resources/guides.coffee
1
25
elving/swag:src/swag.strings.coffee:1:raw_corpus
raw_corpus
Swag.addHelper 'lowercase', (str) -> str.toLowerCase() , 'string' Swag.addHelper 'uppercase', (str) -> str.toUpperCase() , 'string' Swag.addHelper 'capitalizeFirst', (str) -> str.charAt(0).toUpperCase() + str.slice(1) , 'string' Swag.addHelper 'capitalizeEach', (str) -> str.replace /\w\S*/g, (txt) ->...
CoffeeScript
elving/swag
src/swag.strings.coffee
MIT
e9c8788dfc9f640038c00eaafe33f4137ff5f465
675
https://github.com/elving/swag/blob/e9c8788dfc9f640038c00eaafe33f4137ff5f465/src/swag.strings.coffee
1
50
elving/swag:src/swag.strings.coffee:1:coffee_to_js
coffee_to_js
Convert this CoffeeScript to JavaScript. ```coffeescript Swag.addHelper 'lowercase', (str) -> str.toLowerCase() , 'string' Swag.addHelper 'uppercase', (str) -> str.toUpperCase() , 'string' Swag.addHelper 'capitalizeFirst', (str) -> str.charAt(0).toUpperCase() + str.slice(1) , 'string' Swag.addHelper 'cap...
Swag.addHelper('lowercase', function(str) { return str.toLowerCase(); }, 'string'); Swag.addHelper('uppercase', function(str) { return str.toUpperCase(); }, 'string'); Swag.addHelper('capitalizeFirst', function(str) { return str.charAt(0).toUpperCase() + str.slice(1); }, 'string'); Swag.addHelper('capitalizeEa...
CoffeeScript
JavaScript
elving/swag
src/swag.strings.coffee
MIT
e9c8788dfc9f640038c00eaafe33f4137ff5f465
675
https://github.com/elving/swag/blob/e9c8788dfc9f640038c00eaafe33f4137ff5f465/src/swag.strings.coffee
1
50
elving/swag:src/swag.strings.coffee:1:js_to_coffee
js_to_coffee
Convert this JavaScript to CoffeeScript. ```javascript Swag.addHelper('lowercase', function(str) { return str.toLowerCase(); }, 'string'); Swag.addHelper('uppercase', function(str) { return str.toUpperCase(); }, 'string'); Swag.addHelper('capitalizeFirst', function(str) { return str.charAt(0).toUpperCase() + st...
Swag.addHelper 'lowercase', (str) -> str.toLowerCase() , 'string' Swag.addHelper 'uppercase', (str) -> str.toUpperCase() , 'string' Swag.addHelper 'capitalizeFirst', (str) -> str.charAt(0).toUpperCase() + str.slice(1) , 'string' Swag.addHelper 'capitalizeEach', (str) -> str.replace /\w\S*/g, (txt) ->...
JavaScript
CoffeeScript
elving/swag
src/swag.strings.coffee
MIT
e9c8788dfc9f640038c00eaafe33f4137ff5f465
675
https://github.com/elving/swag/blob/e9c8788dfc9f640038c00eaafe33f4137ff5f465/src/swag.strings.coffee
1
50
elving/swag:src/swag.strings.coffee:1:completion
completion
Swag.addHelper 'lowercase', (str) -> str.toLowerCase() , 'string' Swag.addHelper 'uppercase', (str) -> str.toUpperCase() , 'string' Swag.addHelper 'capitalizeFirst', (str) -> str.charAt(0).toUpperCase() + str.slice(1) , 'string' Swag.addHelper 'capitalizeEach', (str) -> str.replace /\w\S*/g, (txt) ->...
, 'string' Swag.addHelper 'reverse', (str) -> str.split('').reverse().join '' , 'string' Swag.addHelper 'truncate', (str, length, omission) -> omission = '' if Utils.isUndefined omission if str.length > length then str.substring(0, length - omission.length) + omission else str , ['string', 'number'] Swag...
CoffeeScript
CoffeeScript
elving/swag
src/swag.strings.coffee
MIT
e9c8788dfc9f640038c00eaafe33f4137ff5f465
675
https://github.com/elving/swag/blob/e9c8788dfc9f640038c00eaafe33f4137ff5f465/src/swag.strings.coffee
1
50
elving/swag:src/swag.strings.coffee:2:raw_corpus
raw_corpus
, 'string' Swag.addHelper 'sanitize', (str, replaceWith) -> replaceWith = '-' if Utils.isUndefined replaceWith str.replace /[^a-z0-9]/gi, replaceWith , 'string'
CoffeeScript
elving/swag
src/swag.strings.coffee
MIT
e9c8788dfc9f640038c00eaafe33f4137ff5f465
675
https://github.com/elving/swag/blob/e9c8788dfc9f640038c00eaafe33f4137ff5f465/src/swag.strings.coffee
51
56
elving/swag:src/swag.strings.coffee:2:completion
completion
, 'string' Swag.addHelper 'sanitize', (str, replaceWith) ->
replaceWith = '-' if Utils.isUndefined replaceWith str.replace /[^a-z0-9]/gi, replaceWith , 'string'
CoffeeScript
CoffeeScript
elving/swag
src/swag.strings.coffee
MIT
e9c8788dfc9f640038c00eaafe33f4137ff5f465
675
https://github.com/elving/swag/blob/e9c8788dfc9f640038c00eaafe33f4137ff5f465/src/swag.strings.coffee
51
56
elving/swag:src/swag.strings.coffee:1:raw_corpus
raw_corpus
Swag.addHelper 'lowercase', (str) -> str = Utils.result str str.toLowerCase() , 'string' Swag.addHelper 'uppercase', (str) -> str = Utils.result str str.toUpperCase() , 'string' Swag.addHelper 'capitalizeFirst', (str) -> str = Utils.result str str.charAt(0).toUpperCase() + str.slice(1) , 'stri...
CoffeeScript
elving/swag
src/swag.strings.coffee
MIT
1dab7399e1ac6127c7b2cde8d518f46c85838801
675
https://github.com/elving/swag/blob/1dab7399e1ac6127c7b2cde8d518f46c85838801/src/swag.strings.coffee
1
50
elving/swag:src/swag.strings.coffee:1:completion
completion
Swag.addHelper 'lowercase', (str) -> str = Utils.result str str.toLowerCase() , 'string' Swag.addHelper 'uppercase', (str) -> str = Utils.result str str.toUpperCase() , 'string' Swag.addHelper 'capitalizeFirst', (str) -> str = Utils.result str str.charAt(0).toUpperCase() + str.slice(1) , 'stri...
, 'string' Swag.addHelper 'sentence', (str) -> str = Utils.result str str.replace /((?:\S[^\.\?\!]*)[\.\?\!]*)/g, (txt) -> txt.charAt(0).toUpperCase() + txt.substr(1).toLowerCase() , 'string' Swag.addHelper 'reverse', (str) -> str = Utils.result str str.split('').reverse().join '' , 'string' Swag.add...
CoffeeScript
CoffeeScript
elving/swag
src/swag.strings.coffee
MIT
1dab7399e1ac6127c7b2cde8d518f46c85838801
675
https://github.com/elving/swag/blob/1dab7399e1ac6127c7b2cde8d518f46c85838801/src/swag.strings.coffee
1
50
elving/swag:src/swag.strings.coffee:2:raw_corpus
raw_corpus
space += '&nbsp;' i++ "#{space}#{str}#{space}" , 'string' Swag.addHelper 'newLineToBr', (str) -> str = Utils.result str str.replace /\r?\n|\r/g, '<br>' , 'string' Swag.addHelper 'sanitize', (str, replaceWith) -> str = Utils.result str replaceWith = '-' if Utils.isUndefined replaceWith ...
CoffeeScript
elving/swag
src/swag.strings.coffee
MIT
1dab7399e1ac6127c7b2cde8d518f46c85838801
675
https://github.com/elving/swag/blob/1dab7399e1ac6127c7b2cde8d518f46c85838801/src/swag.strings.coffee
51
66