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
jianliaoim/talk-os:talk-account/server/initializers/routes.coffee:2:js_to_coffee
js_to_coffee
Convert this JavaScript to CoffeeScript. ```javascript app.post('/email/change', { to: 'email#change' }); app.post('/email/forcebind', { to: 'email#forcebind' }); app.post('/email/unbind', { to: 'email#unbind' }); app.post('/mobile/signinbyverifycode', { to: 'mobile#signinByVerifyCode' }); app.post('/mobile...
app.post '/email/change', to: 'email#change' app.post '/email/forcebind', to: 'email#forcebind' app.post '/email/unbind', to: 'email#unbind' app.post '/mobile/signinbyverifycode', to: 'mobile#signinByVerifyCode' app.post '/mobile/resetpassword', to: 'mobile#resetPassword' app.post '/mobile/sendverifycode', to: 'mo...
JavaScript
CoffeeScript
jianliaoim/talk-os
talk-account/server/initializers/routes.coffee
MIT
2545c4497865779a55762e03963a39237df9046b
2,703
https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-account/server/initializers/routes.coffee
68
117
jianliaoim/talk-os:talk-account/server/initializers/routes.coffee:2:completion
completion
app.post '/email/change', to: 'email#change' app.post '/email/forcebind', to: 'email#forcebind' app.post '/email/unbind', to: 'email#unbind' app.post '/mobile/signinbyverifycode', to: 'mobile#signinByVerifyCode' app.post '/mobile/resetpassword', to: 'mobile#resetPassword' app.post '/mobile/sendverifycode', to: 'mo...
app.post '/email/signup', to: 'email#signup' app.post '/email/signin', to: 'email#signin' app.get '/user/get', to: 'user#get' app.get '/user/accounts', to: 'user#accounts' app.get '/_chk', to: 'check#ping' app.use '/v1', (req, res, callback) -> res.err = new Err 'NOT_FOUND' apiCallback.call this, req, res app...
CoffeeScript
CoffeeScript
jianliaoim/talk-os
talk-account/server/initializers/routes.coffee
MIT
2545c4497865779a55762e03963a39237df9046b
2,703
https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-account/server/initializers/routes.coffee
68
117
jianliaoim/talk-os:talk-api2x/test/controllers/guest/user.coffee:1:raw_corpus
raw_corpus
prepare = (done) -> async.auto prepare: app.prepare createGuestUser: (callback) -> options = method: 'post' url: 'guest/users' body: JSON.stringify name: 'guest1' email: 'guest1@somedomain.com' request options, (err, res, user) -> app.guest1 = us...
CoffeeScript
jianliaoim/talk-os
talk-api2x/test/controllers/guest/user.coffee
MIT
2545c4497865779a55762e03963a39237df9046b
2,703
https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-api2x/test/controllers/guest/user.coffee
8
57
jianliaoim/talk-os:talk-api2x/test/controllers/guest/user.coffee:1:coffee_to_js
coffee_to_js
Convert this CoffeeScript to JavaScript. ```coffeescript prepare = (done) -> async.auto prepare: app.prepare createGuestUser: (callback) -> options = method: 'post' url: 'guest/users' body: JSON.stringify name: 'guest1' email: 'guest1@somedomain.com' req...
var prepare; prepare = function(done) { return async.auto({ prepare: app.prepare, createGuestUser: function(callback) { var options; options = { method: 'post', url: 'guest/users', body: JSON.stringify({ name: 'guest1', email: 'guest1@somedomain.com' ...
CoffeeScript
JavaScript
jianliaoim/talk-os
talk-api2x/test/controllers/guest/user.coffee
MIT
2545c4497865779a55762e03963a39237df9046b
2,703
https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-api2x/test/controllers/guest/user.coffee
8
57
jianliaoim/talk-os:talk-api2x/test/controllers/guest/user.coffee:1:js_to_coffee
js_to_coffee
Convert this JavaScript to CoffeeScript. ```javascript var prepare; prepare = function(done) { return async.auto({ prepare: app.prepare, createGuestUser: function(callback) { var options; options = { method: 'post', url: 'guest/users', body: JSON.stringify({ name...
prepare = (done) -> async.auto prepare: app.prepare createGuestUser: (callback) -> options = method: 'post' url: 'guest/users' body: JSON.stringify name: 'guest1' email: 'guest1@somedomain.com' request options, (err, res, user) -> app.guest1 = us...
JavaScript
CoffeeScript
jianliaoim/talk-os
talk-api2x/test/controllers/guest/user.coffee
MIT
2545c4497865779a55762e03963a39237df9046b
2,703
https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-api2x/test/controllers/guest/user.coffee
8
57
jianliaoim/talk-os:talk-api2x/test/controllers/guest/user.coffee:1:completion
completion
prepare = (done) -> async.auto prepare: app.prepare createGuestUser: (callback) -> options = method: 'post' url: 'guest/users' body: JSON.stringify name: 'guest1' email: 'guest1@somedomain.com' request options, (err, res, user) -> app.guest1 = us...
name: 'guest' email: 'guest@somedomain.com' request options, (err, res, user) -> user.should.have.properties 'name', 'email' user.isGuest.should.eql true done err after clear describe 'guest/user#update', -> before prepare it 'should update a guest user', (done) -> options =...
CoffeeScript
CoffeeScript
jianliaoim/talk-os
talk-api2x/test/controllers/guest/user.coffee
MIT
2545c4497865779a55762e03963a39237df9046b
2,703
https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-api2x/test/controllers/guest/user.coffee
8
57
jianliaoim/talk-os:talk-api2x/test/controllers/guest/user.coffee:2:raw_corpus
raw_corpus
done err after clear describe 'guest1/user#signout', -> before prepare it 'should signout the user and leave the rooms', (done) -> async.auto broadcast: (callback) -> app.broadcast = (room, event, data) -> if event is 'room:leave' data.should.have.properties '_roomId',...
CoffeeScript
jianliaoim/talk-os
talk-api2x/test/controllers/guest/user.coffee
MIT
2545c4497865779a55762e03963a39237df9046b
2,703
https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-api2x/test/controllers/guest/user.coffee
58
92
jianliaoim/talk-os:talk-api2x/test/controllers/guest/user.coffee:2:completion
completion
done err after clear describe 'guest1/user#signout', -> before prepare it 'should signout the user and leave the rooms', (done) -> async.auto broadcast: (callback) -> app.broadcast = (room, event, data) -> if event is 'room:leave' data.should.have.properties '_roomId',...
joinRoom: (callback) -> options = method: 'post' url: "guest/rooms/#{app.room1.guestToken}/join" body: JSON.stringify _sessionUserId: app.guest1._id request options, callback signout: ['joinRoom', (callback) -> options = method: 'post' ...
CoffeeScript
CoffeeScript
jianliaoim/talk-os
talk-api2x/test/controllers/guest/user.coffee
MIT
2545c4497865779a55762e03963a39237df9046b
2,703
https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-api2x/test/controllers/guest/user.coffee
58
92
technoweenie/coffee-resque:test/worker_perform_test.coffee:1:raw_corpus
raw_corpus
require './helper' conn = resque timeout: 10 conn.enqueue 'test', 'abc', ['first'] conn.enqueue 'test', 'abc', ['fail'] conn.enqueue 'test2', 'def', ['missing'] conn.enqueue 'test', 'abc', ['second'] conn.enqueue 'test', 'abc', ['last'] stats = {jobs: [], success: [], error: [], polls: 0} conn.callbacks.abc = ...
CoffeeScript
technoweenie/coffee-resque
test/worker_perform_test.coffee
MIT
cddec8828bb8bafcddb6b494651578e0ef1e5323
542
https://github.com/technoweenie/coffee-resque/blob/cddec8828bb8bafcddb6b494651578e0ef1e5323/test/worker_perform_test.coffee
1
50
technoweenie/coffee-resque:test/worker_perform_test.coffee:1:coffee_to_js
coffee_to_js
Convert this CoffeeScript to JavaScript. ```coffeescript require './helper' conn = resque timeout: 10 conn.enqueue 'test', 'abc', ['first'] conn.enqueue 'test', 'abc', ['fail'] conn.enqueue 'test2', 'def', ['missing'] conn.enqueue 'test', 'abc', ['second'] conn.enqueue 'test', 'abc', ['last'] stats = {jobs: [],...
var conn, countStats, stats, worker; require('./helper'); conn = resque({ timeout: 10 }); conn.enqueue('test', 'abc', ['first']); conn.enqueue('test', 'abc', ['fail']); conn.enqueue('test2', 'def', ['missing']); conn.enqueue('test', 'abc', ['second']); conn.enqueue('test', 'abc', ['last']); stats = { jobs: ...
CoffeeScript
JavaScript
technoweenie/coffee-resque
test/worker_perform_test.coffee
MIT
cddec8828bb8bafcddb6b494651578e0ef1e5323
542
https://github.com/technoweenie/coffee-resque/blob/cddec8828bb8bafcddb6b494651578e0ef1e5323/test/worker_perform_test.coffee
1
50
technoweenie/coffee-resque:test/worker_perform_test.coffee:1:js_to_coffee
js_to_coffee
Convert this JavaScript to CoffeeScript. ```javascript var conn, countStats, stats, worker; require('./helper'); conn = resque({ timeout: 10 }); conn.enqueue('test', 'abc', ['first']); conn.enqueue('test', 'abc', ['fail']); conn.enqueue('test2', 'def', ['missing']); conn.enqueue('test', 'abc', ['second']); con...
require './helper' conn = resque timeout: 10 conn.enqueue 'test', 'abc', ['first'] conn.enqueue 'test', 'abc', ['fail'] conn.enqueue 'test2', 'def', ['missing'] conn.enqueue 'test', 'abc', ['second'] conn.enqueue 'test', 'abc', ['last'] stats = {jobs: [], success: [], error: [], polls: 0} conn.callbacks.abc = ...
JavaScript
CoffeeScript
technoweenie/coffee-resque
test/worker_perform_test.coffee
MIT
cddec8828bb8bafcddb6b494651578e0ef1e5323
542
https://github.com/technoweenie/coffee-resque/blob/cddec8828bb8bafcddb6b494651578e0ef1e5323/test/worker_perform_test.coffee
1
50
technoweenie/coffee-resque:test/worker_perform_test.coffee:1:completion
completion
require './helper' conn = resque timeout: 10 conn.enqueue 'test', 'abc', ['first'] conn.enqueue 'test', 'abc', ['fail'] conn.enqueue 'test2', 'def', ['missing'] conn.enqueue 'test', 'abc', ['second'] conn.enqueue 'test', 'abc', ['last'] stats = {jobs: [], success: [], error: [], polls: 0} conn.callbacks.abc = ...
worker.on 'error', (err, worker, queue, job) -> stats.error.push job.args[0] worker.on 'poll', (worker, queue) -> stats.polls += 1 if stats.polls == 7 countStats() worker.start() countStats = -> conn.redis.get conn.key('stat', 'failed'), (err, resp) -> calls += 1 assert.equal '2', resp.toString()...
CoffeeScript
CoffeeScript
technoweenie/coffee-resque
test/worker_perform_test.coffee
MIT
cddec8828bb8bafcddb6b494651578e0ef1e5323
542
https://github.com/technoweenie/coffee-resque/blob/cddec8828bb8bafcddb6b494651578e0ef1e5323/test/worker_perform_test.coffee
1
50
technoweenie/coffee-resque:test/worker_perform_test.coffee:2:raw_corpus
raw_corpus
calls = 0 process.on 'exit', -> assert.ok stats.polls > 5 assert.deepEqual ['test', 'first'], stats.jobs[0] assert.deepEqual ['test', 'fail'], stats.jobs[1] assert.deepEqual ['test', 'second'], stats.jobs[2] assert.deepEqual ['test', 'last'], stats.jobs[3] assert.deepEqual ['test2', 'missing'],...
CoffeeScript
technoweenie/coffee-resque
test/worker_perform_test.coffee
MIT
cddec8828bb8bafcddb6b494651578e0ef1e5323
542
https://github.com/technoweenie/coffee-resque/blob/cddec8828bb8bafcddb6b494651578e0ef1e5323/test/worker_perform_test.coffee
51
62
technoweenie/coffee-resque:test/worker_perform_test.coffee:2:coffee_to_js
coffee_to_js
Convert this CoffeeScript to JavaScript. ```coffeescript calls = 0 process.on 'exit', -> assert.ok stats.polls > 5 assert.deepEqual ['test', 'first'], stats.jobs[0] assert.deepEqual ['test', 'fail'], stats.jobs[1] assert.deepEqual ['test', 'second'], stats.jobs[2] assert.deepEqual ['test', 'last'], ...
var calls; calls = 0; process.on('exit', function() { assert.ok(stats.polls > 5); assert.deepEqual(['test', 'first'], stats.jobs[0]); assert.deepEqual(['test', 'fail'], stats.jobs[1]); assert.deepEqual(['test', 'second'], stats.jobs[2]); assert.deepEqual(['test', 'last'], stats.jobs[3]); assert.deepEqual(...
CoffeeScript
JavaScript
technoweenie/coffee-resque
test/worker_perform_test.coffee
MIT
cddec8828bb8bafcddb6b494651578e0ef1e5323
542
https://github.com/technoweenie/coffee-resque/blob/cddec8828bb8bafcddb6b494651578e0ef1e5323/test/worker_perform_test.coffee
51
62
technoweenie/coffee-resque:test/worker_perform_test.coffee:2:js_to_coffee
js_to_coffee
Convert this JavaScript to CoffeeScript. ```javascript var calls; calls = 0; process.on('exit', function() { assert.ok(stats.polls > 5); assert.deepEqual(['test', 'first'], stats.jobs[0]); assert.deepEqual(['test', 'fail'], stats.jobs[1]); assert.deepEqual(['test', 'second'], stats.jobs[2]); assert.deepEqua...
calls = 0 process.on 'exit', -> assert.ok stats.polls > 5 assert.deepEqual ['test', 'first'], stats.jobs[0] assert.deepEqual ['test', 'fail'], stats.jobs[1] assert.deepEqual ['test', 'second'], stats.jobs[2] assert.deepEqual ['test', 'last'], stats.jobs[3] assert.deepEqual ['test2', 'missing'],...
JavaScript
CoffeeScript
technoweenie/coffee-resque
test/worker_perform_test.coffee
MIT
cddec8828bb8bafcddb6b494651578e0ef1e5323
542
https://github.com/technoweenie/coffee-resque/blob/cddec8828bb8bafcddb6b494651578e0ef1e5323/test/worker_perform_test.coffee
51
62
technoweenie/coffee-resque:test/worker_perform_test.coffee:2:completion
completion
calls = 0 process.on 'exit', -> assert.ok stats.polls > 5 assert.deepEqual ['test', 'first'], stats.jobs[0] assert.deepEqual ['test', 'fail'], stats.jobs[1] assert.deepEqual ['test', 'second'], stats.jobs[2]
assert.deepEqual ['test', 'last'], stats.jobs[3] assert.deepEqual ['test2', 'missing'], stats.jobs[4] assert.deepEqual ['fail', 'missing'], stats.error assert.deepEqual ['first', 'second', 'last'], stats.success assert.equal 4, calls console.log '.'
CoffeeScript
CoffeeScript
technoweenie/coffee-resque
test/worker_perform_test.coffee
MIT
cddec8828bb8bafcddb6b494651578e0ef1e5323
542
https://github.com/technoweenie/coffee-resque/blob/cddec8828bb8bafcddb6b494651578e0ef1e5323/test/worker_perform_test.coffee
51
62
technoweenie/coffee-resque:test/worker_perform_test.coffee:1:raw_corpus
raw_corpus
require './helper' conn = resque timeout: 10 conn.enqueue 'test', 'abc', ['first'] conn.enqueue 'test', 'abc', ['fail'] conn.enqueue 'test2', 'def', ['missing'] conn.enqueue 'test', 'abc', ['second'] conn.enqueue 'test', 'abc', ['last'] stats = {jobs: [], success: [], error: [], polls: 0} conn.callbacks.abc = ...
CoffeeScript
technoweenie/coffee-resque
test/worker_perform_test.coffee
MIT
057c582af87c8fdd0c29697b92f38c59d0f40e7a
542
https://github.com/technoweenie/coffee-resque/blob/057c582af87c8fdd0c29697b92f38c59d0f40e7a/test/worker_perform_test.coffee
1
50
technoweenie/coffee-resque:test/worker_perform_test.coffee:1:coffee_to_js
coffee_to_js
Convert this CoffeeScript to JavaScript. ```coffeescript require './helper' conn = resque timeout: 10 conn.enqueue 'test', 'abc', ['first'] conn.enqueue 'test', 'abc', ['fail'] conn.enqueue 'test2', 'def', ['missing'] conn.enqueue 'test', 'abc', ['second'] conn.enqueue 'test', 'abc', ['last'] stats = {jobs: [],...
var conn, countStats, stats, worker; require('./helper'); conn = resque({ timeout: 10 }); conn.enqueue('test', 'abc', ['first']); conn.enqueue('test', 'abc', ['fail']); conn.enqueue('test2', 'def', ['missing']); conn.enqueue('test', 'abc', ['second']); conn.enqueue('test', 'abc', ['last']); stats = { jobs: ...
CoffeeScript
JavaScript
technoweenie/coffee-resque
test/worker_perform_test.coffee
MIT
057c582af87c8fdd0c29697b92f38c59d0f40e7a
542
https://github.com/technoweenie/coffee-resque/blob/057c582af87c8fdd0c29697b92f38c59d0f40e7a/test/worker_perform_test.coffee
1
50
technoweenie/coffee-resque:test/worker_perform_test.coffee:1:js_to_coffee
js_to_coffee
Convert this JavaScript to CoffeeScript. ```javascript var conn, countStats, stats, worker; require('./helper'); conn = resque({ timeout: 10 }); conn.enqueue('test', 'abc', ['first']); conn.enqueue('test', 'abc', ['fail']); conn.enqueue('test2', 'def', ['missing']); conn.enqueue('test', 'abc', ['second']); con...
require './helper' conn = resque timeout: 10 conn.enqueue 'test', 'abc', ['first'] conn.enqueue 'test', 'abc', ['fail'] conn.enqueue 'test2', 'def', ['missing'] conn.enqueue 'test', 'abc', ['second'] conn.enqueue 'test', 'abc', ['last'] stats = {jobs: [], success: [], error: [], polls: 0} conn.callbacks.abc = ...
JavaScript
CoffeeScript
technoweenie/coffee-resque
test/worker_perform_test.coffee
MIT
057c582af87c8fdd0c29697b92f38c59d0f40e7a
542
https://github.com/technoweenie/coffee-resque/blob/057c582af87c8fdd0c29697b92f38c59d0f40e7a/test/worker_perform_test.coffee
1
50
technoweenie/coffee-resque:test/worker_perform_test.coffee:1:completion
completion
require './helper' conn = resque timeout: 10 conn.enqueue 'test', 'abc', ['first'] conn.enqueue 'test', 'abc', ['fail'] conn.enqueue 'test2', 'def', ['missing'] conn.enqueue 'test', 'abc', ['second'] conn.enqueue 'test', 'abc', ['last'] stats = {jobs: [], success: [], error: [], polls: 0} conn.callbacks.abc = ...
if stats.success.length == 3 countStats() worker.on 'error', (err, worker, queue, job) -> stats.error.push job.args[0] worker.on 'poll', (worker, queue) -> stats.polls += 1 worker.start() countStats = -> conn.redis.get conn.key('stat', 'failed'), (err, resp) -> calls += 1 assert.equal '2', resp.to...
CoffeeScript
CoffeeScript
technoweenie/coffee-resque
test/worker_perform_test.coffee
MIT
057c582af87c8fdd0c29697b92f38c59d0f40e7a
542
https://github.com/technoweenie/coffee-resque/blob/057c582af87c8fdd0c29697b92f38c59d0f40e7a/test/worker_perform_test.coffee
1
50
technoweenie/coffee-resque:test/worker_perform_test.coffee:2:raw_corpus
raw_corpus
calls = 0 process.on 'exit', -> assert.ok stats.polls > 5 assert.deepEqual ['test', 'first'], stats.jobs[0] assert.deepEqual ['test2', 'missing'], stats.jobs[1] assert.deepEqual ['test', 'fail'], stats.jobs[2] assert.deepEqual ['test', 'second'], stats.jobs[3] assert.deepEqual ['test', 'last'], ...
CoffeeScript
technoweenie/coffee-resque
test/worker_perform_test.coffee
MIT
057c582af87c8fdd0c29697b92f38c59d0f40e7a
542
https://github.com/technoweenie/coffee-resque/blob/057c582af87c8fdd0c29697b92f38c59d0f40e7a/test/worker_perform_test.coffee
51
62
technoweenie/coffee-resque:test/worker_perform_test.coffee:2:coffee_to_js
coffee_to_js
Convert this CoffeeScript to JavaScript. ```coffeescript calls = 0 process.on 'exit', -> assert.ok stats.polls > 5 assert.deepEqual ['test', 'first'], stats.jobs[0] assert.deepEqual ['test2', 'missing'], stats.jobs[1] assert.deepEqual ['test', 'fail'], stats.jobs[2] assert.deepEqual ['test', 'second']...
var calls; calls = 0; process.on('exit', function() { assert.ok(stats.polls > 5); assert.deepEqual(['test', 'first'], stats.jobs[0]); assert.deepEqual(['test2', 'missing'], stats.jobs[1]); assert.deepEqual(['test', 'fail'], stats.jobs[2]); assert.deepEqual(['test', 'second'], stats.jobs[3]); assert.deepEq...
CoffeeScript
JavaScript
technoweenie/coffee-resque
test/worker_perform_test.coffee
MIT
057c582af87c8fdd0c29697b92f38c59d0f40e7a
542
https://github.com/technoweenie/coffee-resque/blob/057c582af87c8fdd0c29697b92f38c59d0f40e7a/test/worker_perform_test.coffee
51
62
technoweenie/coffee-resque:test/worker_perform_test.coffee:2:js_to_coffee
js_to_coffee
Convert this JavaScript to CoffeeScript. ```javascript var calls; calls = 0; process.on('exit', function() { assert.ok(stats.polls > 5); assert.deepEqual(['test', 'first'], stats.jobs[0]); assert.deepEqual(['test2', 'missing'], stats.jobs[1]); assert.deepEqual(['test', 'fail'], stats.jobs[2]); assert.deepEq...
calls = 0 process.on 'exit', -> assert.ok stats.polls > 5 assert.deepEqual ['test', 'first'], stats.jobs[0] assert.deepEqual ['test2', 'missing'], stats.jobs[1] assert.deepEqual ['test', 'fail'], stats.jobs[2] assert.deepEqual ['test', 'second'], stats.jobs[3] assert.deepEqual ['test', 'last'], ...
JavaScript
CoffeeScript
technoweenie/coffee-resque
test/worker_perform_test.coffee
MIT
057c582af87c8fdd0c29697b92f38c59d0f40e7a
542
https://github.com/technoweenie/coffee-resque/blob/057c582af87c8fdd0c29697b92f38c59d0f40e7a/test/worker_perform_test.coffee
51
62
technoweenie/coffee-resque:test/worker_perform_test.coffee:2:completion
completion
calls = 0 process.on 'exit', -> assert.ok stats.polls > 5 assert.deepEqual ['test', 'first'], stats.jobs[0] assert.deepEqual ['test2', 'missing'], stats.jobs[1] assert.deepEqual ['test', 'fail'], stats.jobs[2]
assert.deepEqual ['test', 'second'], stats.jobs[3] assert.deepEqual ['test', 'last'], stats.jobs[4] assert.deepEqual ['missing', 'fail'], stats.error assert.deepEqual ['first', 'second', 'last'], stats.success assert.equal 4, calls console.log '.'
CoffeeScript
CoffeeScript
technoweenie/coffee-resque
test/worker_perform_test.coffee
MIT
057c582af87c8fdd0c29697b92f38c59d0f40e7a
542
https://github.com/technoweenie/coffee-resque/blob/057c582af87c8fdd0c29697b92f38c59d0f40e7a/test/worker_perform_test.coffee
51
62
technoweenie/coffee-resque:test/worker_perform_test.coffee:1:raw_corpus
raw_corpus
require './helper' conn = resque timeout: 10 conn.enqueue 'test', 'abc', ['first'] conn.enqueue 'test', 'abc', ['fail'] conn.enqueue 'test2', 'def', ['missing'] conn.enqueue 'test', 'abc', ['second'] conn.enqueue 'test', 'abc', ['last'] stats = {jobs: [], success: [], error: [], polls: 0} conn.on 'job', (worke...
CoffeeScript
technoweenie/coffee-resque
test/worker_perform_test.coffee
MIT
42f8370da108538ab03668fe02772ee0a7f05a14
542
https://github.com/technoweenie/coffee-resque/blob/42f8370da108538ab03668fe02772ee0a7f05a14/test/worker_perform_test.coffee
1
50
technoweenie/coffee-resque:test/worker_perform_test.coffee:1:coffee_to_js
coffee_to_js
Convert this CoffeeScript to JavaScript. ```coffeescript require './helper' conn = resque timeout: 10 conn.enqueue 'test', 'abc', ['first'] conn.enqueue 'test', 'abc', ['fail'] conn.enqueue 'test2', 'def', ['missing'] conn.enqueue 'test', 'abc', ['second'] conn.enqueue 'test', 'abc', ['last'] stats = {jobs: [],...
var calls, conn, countStats, stats, worker; require('./helper'); conn = resque({ timeout: 10 }); conn.enqueue('test', 'abc', ['first']); conn.enqueue('test', 'abc', ['fail']); conn.enqueue('test2', 'def', ['missing']); conn.enqueue('test', 'abc', ['second']); conn.enqueue('test', 'abc', ['last']); stats = { ...
CoffeeScript
JavaScript
technoweenie/coffee-resque
test/worker_perform_test.coffee
MIT
42f8370da108538ab03668fe02772ee0a7f05a14
542
https://github.com/technoweenie/coffee-resque/blob/42f8370da108538ab03668fe02772ee0a7f05a14/test/worker_perform_test.coffee
1
50
technoweenie/coffee-resque:test/worker_perform_test.coffee:1:js_to_coffee
js_to_coffee
Convert this JavaScript to CoffeeScript. ```javascript var calls, conn, countStats, stats, worker; require('./helper'); conn = resque({ timeout: 10 }); conn.enqueue('test', 'abc', ['first']); conn.enqueue('test', 'abc', ['fail']); conn.enqueue('test2', 'def', ['missing']); conn.enqueue('test', 'abc', ['second']...
require './helper' conn = resque timeout: 10 conn.enqueue 'test', 'abc', ['first'] conn.enqueue 'test', 'abc', ['fail'] conn.enqueue 'test2', 'def', ['missing'] conn.enqueue 'test', 'abc', ['second'] conn.enqueue 'test', 'abc', ['last'] stats = {jobs: [], success: [], error: [], polls: 0} conn.on 'job', (worke...
JavaScript
CoffeeScript
technoweenie/coffee-resque
test/worker_perform_test.coffee
MIT
42f8370da108538ab03668fe02772ee0a7f05a14
542
https://github.com/technoweenie/coffee-resque/blob/42f8370da108538ab03668fe02772ee0a7f05a14/test/worker_perform_test.coffee
1
50
technoweenie/coffee-resque:test/worker_perform_test.coffee:1:completion
completion
require './helper' conn = resque timeout: 10 conn.enqueue 'test', 'abc', ['first'] conn.enqueue 'test', 'abc', ['fail'] conn.enqueue 'test2', 'def', ['missing'] conn.enqueue 'test', 'abc', ['second'] conn.enqueue 'test', 'abc', ['last'] stats = {jobs: [], success: [], error: [], polls: 0} conn.on 'job', (worke...
conn.callbacks.abc = (arg, callback) -> if arg == 'fail' callback new Error "Failing the job" else callback 'pass' worker = conn.worker('test,test2') worker.start() countStats = -> conn.redis.get conn.key('stat', 'failed'), (err, resp) -> calls += 1 assert.equal '2', resp.toString() conn.redis...
CoffeeScript
CoffeeScript
technoweenie/coffee-resque
test/worker_perform_test.coffee
MIT
42f8370da108538ab03668fe02772ee0a7f05a14
542
https://github.com/technoweenie/coffee-resque/blob/42f8370da108538ab03668fe02772ee0a7f05a14/test/worker_perform_test.coffee
1
50
technoweenie/coffee-resque:test/worker_perform_test.coffee:2:raw_corpus
raw_corpus
process.on 'exit', -> assert.ok stats.polls > 5 assert.deepEqual ['test', 'first'], stats.jobs[0] assert.deepEqual ['test2', 'missing'], stats.jobs[1] assert.deepEqual ['test', 'fail'], stats.jobs[2] assert.deepEqual ['test', 'second'], stats.jobs[3] assert.deepEqual ['test', 'last'], stats.job...
CoffeeScript
technoweenie/coffee-resque
test/worker_perform_test.coffee
MIT
42f8370da108538ab03668fe02772ee0a7f05a14
542
https://github.com/technoweenie/coffee-resque/blob/42f8370da108538ab03668fe02772ee0a7f05a14/test/worker_perform_test.coffee
51
61
technoweenie/coffee-resque:test/worker_perform_test.coffee:2:coffee_to_js
coffee_to_js
Convert this CoffeeScript to JavaScript. ```coffeescript process.on 'exit', -> assert.ok stats.polls > 5 assert.deepEqual ['test', 'first'], stats.jobs[0] assert.deepEqual ['test2', 'missing'], stats.jobs[1] assert.deepEqual ['test', 'fail'], stats.jobs[2] assert.deepEqual ['test', 'second'], stats.j...
process.on('exit', function() { assert.ok(stats.polls > 5); assert.deepEqual(['test', 'first'], stats.jobs[0]); assert.deepEqual(['test2', 'missing'], stats.jobs[1]); assert.deepEqual(['test', 'fail'], stats.jobs[2]); assert.deepEqual(['test', 'second'], stats.jobs[3]); assert.deepEqual(['test', 'last'], st...
CoffeeScript
JavaScript
technoweenie/coffee-resque
test/worker_perform_test.coffee
MIT
42f8370da108538ab03668fe02772ee0a7f05a14
542
https://github.com/technoweenie/coffee-resque/blob/42f8370da108538ab03668fe02772ee0a7f05a14/test/worker_perform_test.coffee
51
61
technoweenie/coffee-resque:test/worker_perform_test.coffee:2:js_to_coffee
js_to_coffee
Convert this JavaScript to CoffeeScript. ```javascript process.on('exit', function() { assert.ok(stats.polls > 5); assert.deepEqual(['test', 'first'], stats.jobs[0]); assert.deepEqual(['test2', 'missing'], stats.jobs[1]); assert.deepEqual(['test', 'fail'], stats.jobs[2]); assert.deepEqual(['test', 'second'], ...
process.on 'exit', -> assert.ok stats.polls > 5 assert.deepEqual ['test', 'first'], stats.jobs[0] assert.deepEqual ['test2', 'missing'], stats.jobs[1] assert.deepEqual ['test', 'fail'], stats.jobs[2] assert.deepEqual ['test', 'second'], stats.jobs[3] assert.deepEqual ['test', 'last'], stats.job...
JavaScript
CoffeeScript
technoweenie/coffee-resque
test/worker_perform_test.coffee
MIT
42f8370da108538ab03668fe02772ee0a7f05a14
542
https://github.com/technoweenie/coffee-resque/blob/42f8370da108538ab03668fe02772ee0a7f05a14/test/worker_perform_test.coffee
51
61
technoweenie/coffee-resque:test/worker_perform_test.coffee:2:completion
completion
process.on 'exit', -> assert.ok stats.polls > 5 assert.deepEqual ['test', 'first'], stats.jobs[0] assert.deepEqual ['test2', 'missing'], stats.jobs[1] assert.deepEqual ['test', 'fail'], stats.jobs[2]
assert.deepEqual ['test', 'second'], stats.jobs[3] assert.deepEqual ['test', 'last'], stats.jobs[4] assert.deepEqual ['missing', 'fail'], stats.error assert.deepEqual ['first', 'second', 'last'], stats.success assert.equal 4, calls console.log '.'
CoffeeScript
CoffeeScript
technoweenie/coffee-resque
test/worker_perform_test.coffee
MIT
42f8370da108538ab03668fe02772ee0a7f05a14
542
https://github.com/technoweenie/coffee-resque/blob/42f8370da108538ab03668fe02772ee0a7f05a14/test/worker_perform_test.coffee
51
61
technoweenie/coffee-resque:test/worker_perform_test.coffee:1:raw_corpus
raw_corpus
require './helper' conn = resque timeout: 10 conn.enqueue 'test', 'abc', ['first'] conn.enqueue 'test', 'abc', ['fail'] conn.enqueue 'test2', 'def', ['missing'] conn.enqueue 'test', 'abc', ['second'] conn.enqueue 'test', 'abc', ['last'] stats = {jobs: [], success: [], error: [], polls: 0} conn.on 'job', (worke...
CoffeeScript
technoweenie/coffee-resque
test/worker_perform_test.coffee
MIT
1952c939dc12b6ad40df49d05bec372cee340cb0
542
https://github.com/technoweenie/coffee-resque/blob/1952c939dc12b6ad40df49d05bec372cee340cb0/test/worker_perform_test.coffee
1
50
technoweenie/coffee-resque:test/worker_perform_test.coffee:1:coffee_to_js
coffee_to_js
Convert this CoffeeScript to JavaScript. ```coffeescript require './helper' conn = resque timeout: 10 conn.enqueue 'test', 'abc', ['first'] conn.enqueue 'test', 'abc', ['fail'] conn.enqueue 'test2', 'def', ['missing'] conn.enqueue 'test', 'abc', ['second'] conn.enqueue 'test', 'abc', ['last'] stats = {jobs: [],...
var calls, conn, countStats, stats, worker; require('./helper'); conn = resque({ timeout: 10 }); conn.enqueue('test', 'abc', ['first']); conn.enqueue('test', 'abc', ['fail']); conn.enqueue('test2', 'def', ['missing']); conn.enqueue('test', 'abc', ['second']); conn.enqueue('test', 'abc', ['last']); stats = { ...
CoffeeScript
JavaScript
technoweenie/coffee-resque
test/worker_perform_test.coffee
MIT
1952c939dc12b6ad40df49d05bec372cee340cb0
542
https://github.com/technoweenie/coffee-resque/blob/1952c939dc12b6ad40df49d05bec372cee340cb0/test/worker_perform_test.coffee
1
50
technoweenie/coffee-resque:test/worker_perform_test.coffee:1:js_to_coffee
js_to_coffee
Convert this JavaScript to CoffeeScript. ```javascript var calls, conn, countStats, stats, worker; require('./helper'); conn = resque({ timeout: 10 }); conn.enqueue('test', 'abc', ['first']); conn.enqueue('test', 'abc', ['fail']); conn.enqueue('test2', 'def', ['missing']); conn.enqueue('test', 'abc', ['second']...
require './helper' conn = resque timeout: 10 conn.enqueue 'test', 'abc', ['first'] conn.enqueue 'test', 'abc', ['fail'] conn.enqueue 'test2', 'def', ['missing'] conn.enqueue 'test', 'abc', ['second'] conn.enqueue 'test', 'abc', ['last'] stats = {jobs: [], success: [], error: [], polls: 0} conn.on 'job', (worke...
JavaScript
CoffeeScript
technoweenie/coffee-resque
test/worker_perform_test.coffee
MIT
1952c939dc12b6ad40df49d05bec372cee340cb0
542
https://github.com/technoweenie/coffee-resque/blob/1952c939dc12b6ad40df49d05bec372cee340cb0/test/worker_perform_test.coffee
1
50
technoweenie/coffee-resque:test/worker_perform_test.coffee:1:completion
completion
require './helper' conn = resque timeout: 10 conn.enqueue 'test', 'abc', ['first'] conn.enqueue 'test', 'abc', ['fail'] conn.enqueue 'test2', 'def', ['missing'] conn.enqueue 'test', 'abc', ['second'] conn.enqueue 'test', 'abc', ['last'] stats = {jobs: [], success: [], error: [], polls: 0} conn.on 'job', (worke...
conn.callbacks.abc = (arg, callback) -> if arg is 'fail' callback new Error "Failing the job" else callback null, 'pass' worker = conn.worker('test,test2') worker.start() countStats = -> conn.redis.get conn.key('stat', 'failed'), (err, resp) -> calls += 1 assert.equal '2', resp.toString() conn...
CoffeeScript
CoffeeScript
technoweenie/coffee-resque
test/worker_perform_test.coffee
MIT
1952c939dc12b6ad40df49d05bec372cee340cb0
542
https://github.com/technoweenie/coffee-resque/blob/1952c939dc12b6ad40df49d05bec372cee340cb0/test/worker_perform_test.coffee
1
50
technoweenie/coffee-resque:test/worker_perform_test.coffee:1:raw_corpus
raw_corpus
require './helper' conn = resque timeout: 10 conn.enqueue 'test', 'abc', ['first'] conn.enqueue 'test', 'abc', ['fail'] conn.enqueue 'test2', 'def', ['missing'] conn.enqueue 'test', 'abc', ['second'] conn.enqueue 'test', 'abc', ['last'] stats = {jobs: [], success: [], error: [], polls: 0} conn.on 'job', (worke...
CoffeeScript
technoweenie/coffee-resque
test/worker_perform_test.coffee
MIT
10f31e48192945ca19c33e6e115482eb5e402b7e
542
https://github.com/technoweenie/coffee-resque/blob/10f31e48192945ca19c33e6e115482eb5e402b7e/test/worker_perform_test.coffee
1
50
technoweenie/coffee-resque:test/worker_perform_test.coffee:1:coffee_to_js
coffee_to_js
Convert this CoffeeScript to JavaScript. ```coffeescript require './helper' conn = resque timeout: 10 conn.enqueue 'test', 'abc', ['first'] conn.enqueue 'test', 'abc', ['fail'] conn.enqueue 'test2', 'def', ['missing'] conn.enqueue 'test', 'abc', ['second'] conn.enqueue 'test', 'abc', ['last'] stats = {jobs: [],...
var calls, conn, countStats, stats, worker; require('./helper'); conn = resque({ timeout: 10 }); conn.enqueue('test', 'abc', ['first']); conn.enqueue('test', 'abc', ['fail']); conn.enqueue('test2', 'def', ['missing']); conn.enqueue('test', 'abc', ['second']); conn.enqueue('test', 'abc', ['last']); stats = { ...
CoffeeScript
JavaScript
technoweenie/coffee-resque
test/worker_perform_test.coffee
MIT
10f31e48192945ca19c33e6e115482eb5e402b7e
542
https://github.com/technoweenie/coffee-resque/blob/10f31e48192945ca19c33e6e115482eb5e402b7e/test/worker_perform_test.coffee
1
50
technoweenie/coffee-resque:test/worker_perform_test.coffee:1:js_to_coffee
js_to_coffee
Convert this JavaScript to CoffeeScript. ```javascript var calls, conn, countStats, stats, worker; require('./helper'); conn = resque({ timeout: 10 }); conn.enqueue('test', 'abc', ['first']); conn.enqueue('test', 'abc', ['fail']); conn.enqueue('test2', 'def', ['missing']); conn.enqueue('test', 'abc', ['second']...
require './helper' conn = resque timeout: 10 conn.enqueue 'test', 'abc', ['first'] conn.enqueue 'test', 'abc', ['fail'] conn.enqueue 'test2', 'def', ['missing'] conn.enqueue 'test', 'abc', ['second'] conn.enqueue 'test', 'abc', ['last'] stats = {jobs: [], success: [], error: [], polls: 0} conn.on 'job', (worke...
JavaScript
CoffeeScript
technoweenie/coffee-resque
test/worker_perform_test.coffee
MIT
10f31e48192945ca19c33e6e115482eb5e402b7e
542
https://github.com/technoweenie/coffee-resque/blob/10f31e48192945ca19c33e6e115482eb5e402b7e/test/worker_perform_test.coffee
1
50
technoweenie/coffee-resque:test/worker_perform_test.coffee:1:completion
completion
require './helper' conn = resque timeout: 10 conn.enqueue 'test', 'abc', ['first'] conn.enqueue 'test', 'abc', ['fail'] conn.enqueue 'test2', 'def', ['missing'] conn.enqueue 'test', 'abc', ['second'] conn.enqueue 'test', 'abc', ['last'] stats = {jobs: [], success: [], error: [], polls: 0} conn.on 'job', (worke...
conn.callbacks.abc = (arg) -> if arg == 'fail' throw "Failing the job" worker = conn.worker('test,test2') worker.start() countStats = -> conn.redis.get conn.key('stat', 'failed'), (err, resp) -> calls += 1 assert.equal '2', resp.toString() conn.redis.get conn.key('stat', 'failed', worker.name), (err...
CoffeeScript
CoffeeScript
technoweenie/coffee-resque
test/worker_perform_test.coffee
MIT
10f31e48192945ca19c33e6e115482eb5e402b7e
542
https://github.com/technoweenie/coffee-resque/blob/10f31e48192945ca19c33e6e115482eb5e402b7e/test/worker_perform_test.coffee
1
50
technoweenie/coffee-resque:test/worker_perform_test.coffee:1:raw_corpus
raw_corpus
require './helper' conn = resque timeout: 10 conn.enqueue 'test', 'abc', ['first'] conn.enqueue 'test', 'abc', ['fail'] conn.enqueue 'test2', 'def', ['missing'] conn.enqueue 'test', 'abc', ['second'] conn.enqueue 'test', 'abc', ['last'] stats = {jobs: [], success: [], error: [], polls: 0} conn.on 'job', (worke...
CoffeeScript
technoweenie/coffee-resque
test/worker_perform_test.coffee
MIT
706a6fb8696fc868c8f2587ff7c30a8d5a98d5c0
542
https://github.com/technoweenie/coffee-resque/blob/706a6fb8696fc868c8f2587ff7c30a8d5a98d5c0/test/worker_perform_test.coffee
1
50
technoweenie/coffee-resque:test/worker_perform_test.coffee:1:coffee_to_js
coffee_to_js
Convert this CoffeeScript to JavaScript. ```coffeescript require './helper' conn = resque timeout: 10 conn.enqueue 'test', 'abc', ['first'] conn.enqueue 'test', 'abc', ['fail'] conn.enqueue 'test2', 'def', ['missing'] conn.enqueue 'test', 'abc', ['second'] conn.enqueue 'test', 'abc', ['last'] stats = {jobs: [],...
var calls, conn, countStats, stats, worker; require('./helper'); conn = resque({ timeout: 10 }); conn.enqueue('test', 'abc', ['first']); conn.enqueue('test', 'abc', ['fail']); conn.enqueue('test2', 'def', ['missing']); conn.enqueue('test', 'abc', ['second']); conn.enqueue('test', 'abc', ['last']); stats = { ...
CoffeeScript
JavaScript
technoweenie/coffee-resque
test/worker_perform_test.coffee
MIT
706a6fb8696fc868c8f2587ff7c30a8d5a98d5c0
542
https://github.com/technoweenie/coffee-resque/blob/706a6fb8696fc868c8f2587ff7c30a8d5a98d5c0/test/worker_perform_test.coffee
1
50
technoweenie/coffee-resque:test/worker_perform_test.coffee:1:js_to_coffee
js_to_coffee
Convert this JavaScript to CoffeeScript. ```javascript var calls, conn, countStats, stats, worker; require('./helper'); conn = resque({ timeout: 10 }); conn.enqueue('test', 'abc', ['first']); conn.enqueue('test', 'abc', ['fail']); conn.enqueue('test2', 'def', ['missing']); conn.enqueue('test', 'abc', ['second']...
require './helper' conn = resque timeout: 10 conn.enqueue 'test', 'abc', ['first'] conn.enqueue 'test', 'abc', ['fail'] conn.enqueue 'test2', 'def', ['missing'] conn.enqueue 'test', 'abc', ['second'] conn.enqueue 'test', 'abc', ['last'] stats = {jobs: [], success: [], error: [], polls: 0} conn.on 'job', (worke...
JavaScript
CoffeeScript
technoweenie/coffee-resque
test/worker_perform_test.coffee
MIT
706a6fb8696fc868c8f2587ff7c30a8d5a98d5c0
542
https://github.com/technoweenie/coffee-resque/blob/706a6fb8696fc868c8f2587ff7c30a8d5a98d5c0/test/worker_perform_test.coffee
1
50
technoweenie/coffee-resque:test/worker_perform_test.coffee:1:completion
completion
require './helper' conn = resque timeout: 10 conn.enqueue 'test', 'abc', ['first'] conn.enqueue 'test', 'abc', ['fail'] conn.enqueue 'test2', 'def', ['missing'] conn.enqueue 'test', 'abc', ['second'] conn.enqueue 'test', 'abc', ['last'] stats = {jobs: [], success: [], error: [], polls: 0} conn.on 'job', (worke...
conn.callbacks.abc = (arg) -> if arg == 'fail' throw "Failing the job" worker = conn.worker('test,test2') worker.start() countStats = -> conn.redis.get conn.key('stat', 'failed'), (err, resp) -> calls += 1 assert.equal '2', resp.toString() conn.redis.get conn.key('stat', 'failed', worker.name), (err...
CoffeeScript
CoffeeScript
technoweenie/coffee-resque
test/worker_perform_test.coffee
MIT
706a6fb8696fc868c8f2587ff7c30a8d5a98d5c0
542
https://github.com/technoweenie/coffee-resque/blob/706a6fb8696fc868c8f2587ff7c30a8d5a98d5c0/test/worker_perform_test.coffee
1
50
technoweenie/coffee-resque:test/worker_perform_test.coffee:1:raw_corpus
raw_corpus
require './helper' conn = resque timeout: 10 conn.enqueue 'test', 'abc', 'first' conn.enqueue 'test', 'abc', 'fail' conn.enqueue 'test2', 'def', 'missing' conn.enqueue 'test', 'abc', 'second' conn.enqueue 'test', 'abc', 'last' stats = {jobs: [], success: [], error: [], polls: 0} conn.on 'job', (worker, queue, ...
CoffeeScript
technoweenie/coffee-resque
test/worker_perform_test.coffee
MIT
cbeb8f39ea2179bf2dda4a6c100b4ad08940b048
542
https://github.com/technoweenie/coffee-resque/blob/cbeb8f39ea2179bf2dda4a6c100b4ad08940b048/test/worker_perform_test.coffee
1
50
technoweenie/coffee-resque:test/worker_perform_test.coffee:1:coffee_to_js
coffee_to_js
Convert this CoffeeScript to JavaScript. ```coffeescript require './helper' conn = resque timeout: 10 conn.enqueue 'test', 'abc', 'first' conn.enqueue 'test', 'abc', 'fail' conn.enqueue 'test2', 'def', 'missing' conn.enqueue 'test', 'abc', 'second' conn.enqueue 'test', 'abc', 'last' stats = {jobs: [], success: ...
var calls, conn, countStats, stats, worker; require('./helper'); conn = resque({ timeout: 10 }); conn.enqueue('test', 'abc', 'first'); conn.enqueue('test', 'abc', 'fail'); conn.enqueue('test2', 'def', 'missing'); conn.enqueue('test', 'abc', 'second'); conn.enqueue('test', 'abc', 'last'); stats = { jobs: [],...
CoffeeScript
JavaScript
technoweenie/coffee-resque
test/worker_perform_test.coffee
MIT
cbeb8f39ea2179bf2dda4a6c100b4ad08940b048
542
https://github.com/technoweenie/coffee-resque/blob/cbeb8f39ea2179bf2dda4a6c100b4ad08940b048/test/worker_perform_test.coffee
1
50
technoweenie/coffee-resque:test/worker_perform_test.coffee:1:js_to_coffee
js_to_coffee
Convert this JavaScript to CoffeeScript. ```javascript var calls, conn, countStats, stats, worker; require('./helper'); conn = resque({ timeout: 10 }); conn.enqueue('test', 'abc', 'first'); conn.enqueue('test', 'abc', 'fail'); conn.enqueue('test2', 'def', 'missing'); conn.enqueue('test', 'abc', 'second'); conn...
require './helper' conn = resque timeout: 10 conn.enqueue 'test', 'abc', 'first' conn.enqueue 'test', 'abc', 'fail' conn.enqueue 'test2', 'def', 'missing' conn.enqueue 'test', 'abc', 'second' conn.enqueue 'test', 'abc', 'last' stats = {jobs: [], success: [], error: [], polls: 0} conn.on 'job', (worker, queue, ...
JavaScript
CoffeeScript
technoweenie/coffee-resque
test/worker_perform_test.coffee
MIT
cbeb8f39ea2179bf2dda4a6c100b4ad08940b048
542
https://github.com/technoweenie/coffee-resque/blob/cbeb8f39ea2179bf2dda4a6c100b4ad08940b048/test/worker_perform_test.coffee
1
50
technoweenie/coffee-resque:test/worker_perform_test.coffee:1:completion
completion
require './helper' conn = resque timeout: 10 conn.enqueue 'test', 'abc', 'first' conn.enqueue 'test', 'abc', 'fail' conn.enqueue 'test2', 'def', 'missing' conn.enqueue 'test', 'abc', 'second' conn.enqueue 'test', 'abc', 'last' stats = {jobs: [], success: [], error: [], polls: 0} conn.on 'job', (worker, queue, ...
conn.callbacks.abc = (arg) -> if arg == 'fail' throw "Failing the job" worker = conn.worker('test,test2') worker.start() countStats = -> conn.redis.get conn.key('stat', 'failed'), (err, resp) -> calls += 1 assert.equal '2', resp.toString() conn.redis.get conn.key('stat', 'failed', worker.name), (err...
CoffeeScript
CoffeeScript
technoweenie/coffee-resque
test/worker_perform_test.coffee
MIT
cbeb8f39ea2179bf2dda4a6c100b4ad08940b048
542
https://github.com/technoweenie/coffee-resque/blob/cbeb8f39ea2179bf2dda4a6c100b4ad08940b048/test/worker_perform_test.coffee
1
50
technoweenie/coffee-resque:test/worker_perform_test.coffee:1:raw_corpus
raw_corpus
require './helper' conn = resque() conn.enqueue 'test', 'abc', 'first' conn.enqueue 'test', 'abc', 'fail' conn.enqueue 'test2', 'def', 'missing' conn.enqueue 'test', 'abc', 'second' conn.enqueue 'test', 'abc', 'last' stats = {jobs: [], success: [], error: [], polls: 0} conn.on 'job', (worker, queue, job) -> ...
CoffeeScript
technoweenie/coffee-resque
test/worker_perform_test.coffee
MIT
e4292fd1dcccf0ab2cde485186f4151be883bc17
542
https://github.com/technoweenie/coffee-resque/blob/e4292fd1dcccf0ab2cde485186f4151be883bc17/test/worker_perform_test.coffee
1
50
technoweenie/coffee-resque:test/worker_perform_test.coffee:1:coffee_to_js
coffee_to_js
Convert this CoffeeScript to JavaScript. ```coffeescript require './helper' conn = resque() conn.enqueue 'test', 'abc', 'first' conn.enqueue 'test', 'abc', 'fail' conn.enqueue 'test2', 'def', 'missing' conn.enqueue 'test', 'abc', 'second' conn.enqueue 'test', 'abc', 'last' stats = {jobs: [], success: [], error:...
var calls, conn, countStats, stats, worker; require('./helper'); conn = resque(); conn.enqueue('test', 'abc', 'first'); conn.enqueue('test', 'abc', 'fail'); conn.enqueue('test2', 'def', 'missing'); conn.enqueue('test', 'abc', 'second'); conn.enqueue('test', 'abc', 'last'); stats = { jobs: [], success: [], ...
CoffeeScript
JavaScript
technoweenie/coffee-resque
test/worker_perform_test.coffee
MIT
e4292fd1dcccf0ab2cde485186f4151be883bc17
542
https://github.com/technoweenie/coffee-resque/blob/e4292fd1dcccf0ab2cde485186f4151be883bc17/test/worker_perform_test.coffee
1
50
technoweenie/coffee-resque:test/worker_perform_test.coffee:1:js_to_coffee
js_to_coffee
Convert this JavaScript to CoffeeScript. ```javascript var calls, conn, countStats, stats, worker; require('./helper'); conn = resque(); conn.enqueue('test', 'abc', 'first'); conn.enqueue('test', 'abc', 'fail'); conn.enqueue('test2', 'def', 'missing'); conn.enqueue('test', 'abc', 'second'); conn.enqueue('test', ...
require './helper' conn = resque() conn.enqueue 'test', 'abc', 'first' conn.enqueue 'test', 'abc', 'fail' conn.enqueue 'test2', 'def', 'missing' conn.enqueue 'test', 'abc', 'second' conn.enqueue 'test', 'abc', 'last' stats = {jobs: [], success: [], error: [], polls: 0} conn.on 'job', (worker, queue, job) -> ...
JavaScript
CoffeeScript
technoweenie/coffee-resque
test/worker_perform_test.coffee
MIT
e4292fd1dcccf0ab2cde485186f4151be883bc17
542
https://github.com/technoweenie/coffee-resque/blob/e4292fd1dcccf0ab2cde485186f4151be883bc17/test/worker_perform_test.coffee
1
50
technoweenie/coffee-resque:test/worker_perform_test.coffee:1:completion
completion
require './helper' conn = resque() conn.enqueue 'test', 'abc', 'first' conn.enqueue 'test', 'abc', 'fail' conn.enqueue 'test2', 'def', 'missing' conn.enqueue 'test', 'abc', 'second' conn.enqueue 'test', 'abc', 'last' stats = {jobs: [], success: [], error: [], polls: 0} conn.on 'job', (worker, queue, job) -> ...
conn.callbacks.abc = (arg) -> if arg == 'fail' throw "Failing the job" worker = conn.worker('test,test2') worker.start() countStats = -> conn.redis.get conn.key('stat', 'failed'), (err, resp) -> calls += 1 assert.equal '2', resp.toString() conn.redis.get conn.key('stat', 'failed', worker.name), (err...
CoffeeScript
CoffeeScript
technoweenie/coffee-resque
test/worker_perform_test.coffee
MIT
e4292fd1dcccf0ab2cde485186f4151be883bc17
542
https://github.com/technoweenie/coffee-resque/blob/e4292fd1dcccf0ab2cde485186f4151be883bc17/test/worker_perform_test.coffee
1
50
technoweenie/coffee-resque:test/worker_perform_test.coffee:1:raw_corpus
raw_corpus
require './helper' conn = resque() conn.enqueue 'test', 'abc', 'first' conn.enqueue 'test', 'abc', 'fail' conn.enqueue 'test2', 'def', 'missing' conn.enqueue 'test', 'abc', 'last' stats = {jobs: [], success: [], error: [], polls: 0} conn.on 'job', (worker, queue, job) -> stats.jobs.push [queue, job.args[0]] ...
CoffeeScript
technoweenie/coffee-resque
test/worker_perform_test.coffee
MIT
1738caa55676754bd2c6943a2134b6359aaec203
542
https://github.com/technoweenie/coffee-resque/blob/1738caa55676754bd2c6943a2134b6359aaec203/test/worker_perform_test.coffee
1
40
technoweenie/coffee-resque:test/worker_perform_test.coffee:1:coffee_to_js
coffee_to_js
Convert this CoffeeScript to JavaScript. ```coffeescript require './helper' conn = resque() conn.enqueue 'test', 'abc', 'first' conn.enqueue 'test', 'abc', 'fail' conn.enqueue 'test2', 'def', 'missing' conn.enqueue 'test', 'abc', 'last' stats = {jobs: [], success: [], error: [], polls: 0} conn.on 'job', (worker...
var conn, stats, worker; require('./helper'); conn = resque(); conn.enqueue('test', 'abc', 'first'); conn.enqueue('test', 'abc', 'fail'); conn.enqueue('test2', 'def', 'missing'); conn.enqueue('test', 'abc', 'last'); stats = { jobs: [], success: [], error: [], polls: 0 }; conn.on('job', function(worker, ...
CoffeeScript
JavaScript
technoweenie/coffee-resque
test/worker_perform_test.coffee
MIT
1738caa55676754bd2c6943a2134b6359aaec203
542
https://github.com/technoweenie/coffee-resque/blob/1738caa55676754bd2c6943a2134b6359aaec203/test/worker_perform_test.coffee
1
40
technoweenie/coffee-resque:test/worker_perform_test.coffee:1:js_to_coffee
js_to_coffee
Convert this JavaScript to CoffeeScript. ```javascript var conn, stats, worker; require('./helper'); conn = resque(); conn.enqueue('test', 'abc', 'first'); conn.enqueue('test', 'abc', 'fail'); conn.enqueue('test2', 'def', 'missing'); conn.enqueue('test', 'abc', 'last'); stats = { jobs: [], success: [], err...
require './helper' conn = resque() conn.enqueue 'test', 'abc', 'first' conn.enqueue 'test', 'abc', 'fail' conn.enqueue 'test2', 'def', 'missing' conn.enqueue 'test', 'abc', 'last' stats = {jobs: [], success: [], error: [], polls: 0} conn.on 'job', (worker, queue, job) -> stats.jobs.push [queue, job.args[0]] ...
JavaScript
CoffeeScript
technoweenie/coffee-resque
test/worker_perform_test.coffee
MIT
1738caa55676754bd2c6943a2134b6359aaec203
542
https://github.com/technoweenie/coffee-resque/blob/1738caa55676754bd2c6943a2134b6359aaec203/test/worker_perform_test.coffee
1
40
technoweenie/coffee-resque:test/worker_perform_test.coffee:1:completion
completion
require './helper' conn = resque() conn.enqueue 'test', 'abc', 'first' conn.enqueue 'test', 'abc', 'fail' conn.enqueue 'test2', 'def', 'missing' conn.enqueue 'test', 'abc', 'last' stats = {jobs: [], success: [], error: [], polls: 0} conn.on 'job', (worker, queue, job) -> stats.jobs.push [queue, job.args[0]] ...
conn.on 'poll', (worker, queue) -> stats.polls += 1 conn.callbacks.abc = (arg) -> if arg == 'fail' throw "Failing the job" worker = conn.worker('test,test2') worker.start() process.on 'exit', -> assert.ok stats.polls > 4 assert.deepEqual ['test', 'first'], stats.jobs[0] assert.deepEqual ['test2', 'm...
CoffeeScript
CoffeeScript
technoweenie/coffee-resque
test/worker_perform_test.coffee
MIT
1738caa55676754bd2c6943a2134b6359aaec203
542
https://github.com/technoweenie/coffee-resque/blob/1738caa55676754bd2c6943a2134b6359aaec203/test/worker_perform_test.coffee
1
40
soyjavi/QuoJS:spec/9_query.coffee:1:raw_corpus
raw_corpus
describe "Output", -> el = undefined beforeEach -> document.body.innerHTML = """ <section class="quo"> <header></header> </section>""" el = $$ "section" it "can get the descendants of each element in the current instance", -> children = el.find "header" expect(children.leng...
CoffeeScript
soyjavi/QuoJS
spec/9_query.coffee
MIT
7296aa6bc321370c1b92de005c9b55b9e1365596
2,055
https://github.com/soyjavi/QuoJS/blob/7296aa6bc321370c1b92de005c9b55b9e1365596/spec/9_query.coffee
1
50
soyjavi/QuoJS:spec/9_query.coffee:1:coffee_to_js
coffee_to_js
Convert this CoffeeScript to JavaScript. ```coffeescript describe "Output", -> el = undefined beforeEach -> document.body.innerHTML = """ <section class="quo"> <header></header> </section>""" el = $$ "section" it "can get the descendants of each element in the current instance", ->...
describe("Output", function() { var el; el = void 0; beforeEach(function() { document.body.innerHTML = `<section class="quo"> <header></header> </section>`; return el = $$("section"); }); it("can get the descendants of each element in the current instance", function() { var children; childre...
CoffeeScript
JavaScript
soyjavi/QuoJS
spec/9_query.coffee
MIT
7296aa6bc321370c1b92de005c9b55b9e1365596
2,055
https://github.com/soyjavi/QuoJS/blob/7296aa6bc321370c1b92de005c9b55b9e1365596/spec/9_query.coffee
1
50
soyjavi/QuoJS:spec/9_query.coffee:1:js_to_coffee
js_to_coffee
Convert this JavaScript to CoffeeScript. ```javascript describe("Output", function() { var el; el = void 0; beforeEach(function() { document.body.innerHTML = `<section class="quo"> <header></header> </section>`; return el = $$("section"); }); it("can get the descendants of each element in the curren...
describe "Output", -> el = undefined beforeEach -> document.body.innerHTML = """ <section class="quo"> <header></header> </section>""" el = $$ "section" it "can get the descendants of each element in the current instance", -> children = el.find "header" expect(children.leng...
JavaScript
CoffeeScript
soyjavi/QuoJS
spec/9_query.coffee
MIT
7296aa6bc321370c1b92de005c9b55b9e1365596
2,055
https://github.com/soyjavi/QuoJS/blob/7296aa6bc321370c1b92de005c9b55b9e1365596/spec/9_query.coffee
1
50
soyjavi/QuoJS:spec/9_query.coffee:1:completion
completion
describe "Output", -> el = undefined beforeEach -> document.body.innerHTML = """ <section class="quo"> <header></header> </section>""" el = $$ "section" it "can get the descendants of each element in the current instance", -> children = el.find "header" expect(children.leng...
expect(children.html()).toEqual header.html() el.append "<footer></footer>" children = el.children("header") expect(children.html()).toEqual header.html() it "can retrieve the DOM elements matched by the QuoJS object.", -> dom = el.get(0) expect(dom).toBeTruthy() dom = el.get(1) expect(...
CoffeeScript
CoffeeScript
soyjavi/QuoJS
spec/9_query.coffee
MIT
7296aa6bc321370c1b92de005c9b55b9e1365596
2,055
https://github.com/soyjavi/QuoJS/blob/7296aa6bc321370c1b92de005c9b55b9e1365596/spec/9_query.coffee
1
50
soyjavi/QuoJS:spec/9_query.coffee:2:raw_corpus
raw_corpus
it "can get the first element that matches the selector by testing the element itself and traversing up through its ancestors", -> header = $$ "section header" dom = header.closest "section" expect(dom.html()).toEqual el.html() it "can get the immediately following sibling of each element in the instanc...
CoffeeScript
soyjavi/QuoJS
spec/9_query.coffee
MIT
7296aa6bc321370c1b92de005c9b55b9e1365596
2,055
https://github.com/soyjavi/QuoJS/blob/7296aa6bc321370c1b92de005c9b55b9e1365596/spec/9_query.coffee
51
70
soyjavi/QuoJS:spec/9_query.coffee:2:coffee_to_js
coffee_to_js
Convert this CoffeeScript to JavaScript. ```coffeescript it "can get the first element that matches the selector by testing the element itself and traversing up through its ancestors", -> header = $$ "section header" dom = header.closest "section" expect(dom.html()).toEqual el.html() it "can get the imm...
it("can get the first element that matches the selector by testing the element itself and traversing up through its ancestors", function() { var dom, header; header = $$("section header"); dom = header.closest("section"); return expect(dom.html()).toEqual(el.html()); }); it("can get the immediately following s...
CoffeeScript
JavaScript
soyjavi/QuoJS
spec/9_query.coffee
MIT
7296aa6bc321370c1b92de005c9b55b9e1365596
2,055
https://github.com/soyjavi/QuoJS/blob/7296aa6bc321370c1b92de005c9b55b9e1365596/spec/9_query.coffee
51
70
soyjavi/QuoJS:spec/9_query.coffee:2:js_to_coffee
js_to_coffee
Convert this JavaScript to CoffeeScript. ```javascript it("can get the first element that matches the selector by testing the element itself and traversing up through its ancestors", function() { var dom, header; header = $$("section header"); dom = header.closest("section"); return expect(dom.html()).toEqual(e...
it "can get the first element that matches the selector by testing the element itself and traversing up through its ancestors", -> header = $$ "section header" dom = header.closest "section" expect(dom.html()).toEqual el.html() it "can get the immediately following sibling of each element in the instanc...
JavaScript
CoffeeScript
soyjavi/QuoJS
spec/9_query.coffee
MIT
7296aa6bc321370c1b92de005c9b55b9e1365596
2,055
https://github.com/soyjavi/QuoJS/blob/7296aa6bc321370c1b92de005c9b55b9e1365596/spec/9_query.coffee
51
70
soyjavi/QuoJS:spec/9_query.coffee:2:completion
completion
it "can get the first element that matches the selector by testing the element itself and traversing up through its ancestors", -> header = $$ "section header" dom = header.closest "section" expect(dom.html()).toEqual el.html() it "can get the immediately following sibling of each element in the instanc...
footer = $$ "section footer" expect(header.next().html()).toEqual footer.html() it "can get the immediately preceding sibling of each element in the instance", -> el.append "<footer></footer>" header = $$ "section header" footer = $$ "section footer" expect(footer.prev().html()).toEqual header.h...
CoffeeScript
CoffeeScript
soyjavi/QuoJS
spec/9_query.coffee
MIT
7296aa6bc321370c1b92de005c9b55b9e1365596
2,055
https://github.com/soyjavi/QuoJS/blob/7296aa6bc321370c1b92de005c9b55b9e1365596/spec/9_query.coffee
51
70
soyjavi/QuoJS:spec/9_query.coffee:1:raw_corpus
raw_corpus
describe "Output", -> el = undefined beforeEach -> document.body.innerHTML = """ <section class="quo"> <header></header> </section>""" el = $$ "section" it "can get the descendants of each element in the current instance", -> children = el.find "header" expect(children.leng...
CoffeeScript
soyjavi/QuoJS
spec/9_query.coffee
MIT
2e3042a5ef709f4d645672f5e68aeed69691eb37
2,055
https://github.com/soyjavi/QuoJS/blob/2e3042a5ef709f4d645672f5e68aeed69691eb37/spec/9_query.coffee
1
50
soyjavi/QuoJS:spec/9_query.coffee:1:coffee_to_js
coffee_to_js
Convert this CoffeeScript to JavaScript. ```coffeescript describe "Output", -> el = undefined beforeEach -> document.body.innerHTML = """ <section class="quo"> <header></header> </section>""" el = $$ "section" it "can get the descendants of each element in the current instance", ->...
describe("Output", function() { var el; el = void 0; beforeEach(function() { document.body.innerHTML = `<section class="quo"> <header></header> </section>`; return el = $$("section"); }); it("can get the descendants of each element in the current instance", function() { var children; childre...
CoffeeScript
JavaScript
soyjavi/QuoJS
spec/9_query.coffee
MIT
2e3042a5ef709f4d645672f5e68aeed69691eb37
2,055
https://github.com/soyjavi/QuoJS/blob/2e3042a5ef709f4d645672f5e68aeed69691eb37/spec/9_query.coffee
1
50
soyjavi/QuoJS:spec/9_query.coffee:1:js_to_coffee
js_to_coffee
Convert this JavaScript to CoffeeScript. ```javascript describe("Output", function() { var el; el = void 0; beforeEach(function() { document.body.innerHTML = `<section class="quo"> <header></header> </section>`; return el = $$("section"); }); it("can get the descendants of each element in the curren...
describe "Output", -> el = undefined beforeEach -> document.body.innerHTML = """ <section class="quo"> <header></header> </section>""" el = $$ "section" it "can get the descendants of each element in the current instance", -> children = el.find "header" expect(children.leng...
JavaScript
CoffeeScript
soyjavi/QuoJS
spec/9_query.coffee
MIT
2e3042a5ef709f4d645672f5e68aeed69691eb37
2,055
https://github.com/soyjavi/QuoJS/blob/2e3042a5ef709f4d645672f5e68aeed69691eb37/spec/9_query.coffee
1
50
soyjavi/QuoJS:spec/9_query.coffee:1:completion
completion
describe "Output", -> el = undefined beforeEach -> document.body.innerHTML = """ <section class="quo"> <header></header> </section>""" el = $$ "section" it "can get the descendants of each element in the current instance", -> children = el.find "header" expect(children.leng...
expect(children).toEqual header el.append "<footer></footer>" children = el.children("header") expect(children).toEqual header it "can retrieve the DOM elements matched by the QuoJS object.", -> dom = el.get(0) expect(dom).toBeTruthy() dom = el.get(1) expect(dom).not.toBeTruthy() it...
CoffeeScript
CoffeeScript
soyjavi/QuoJS
spec/9_query.coffee
MIT
2e3042a5ef709f4d645672f5e68aeed69691eb37
2,055
https://github.com/soyjavi/QuoJS/blob/2e3042a5ef709f4d645672f5e68aeed69691eb37/spec/9_query.coffee
1
50
soyjavi/QuoJS:spec/9_query.coffee:2:raw_corpus
raw_corpus
it "can get the first element that matches the selector by testing the element itself and traversing up through its ancestors", -> header = $$ "section header" dom = header.closest "section" expect(dom).toEqual el it "can get the immediately following sibling of each element in the instance", -> el....
CoffeeScript
soyjavi/QuoJS
spec/9_query.coffee
MIT
2e3042a5ef709f4d645672f5e68aeed69691eb37
2,055
https://github.com/soyjavi/QuoJS/blob/2e3042a5ef709f4d645672f5e68aeed69691eb37/spec/9_query.coffee
51
70
soyjavi/QuoJS:spec/9_query.coffee:2:coffee_to_js
coffee_to_js
Convert this CoffeeScript to JavaScript. ```coffeescript it "can get the first element that matches the selector by testing the element itself and traversing up through its ancestors", -> header = $$ "section header" dom = header.closest "section" expect(dom).toEqual el it "can get the immediately follo...
it("can get the first element that matches the selector by testing the element itself and traversing up through its ancestors", function() { var dom, header; header = $$("section header"); dom = header.closest("section"); return expect(dom).toEqual(el); }); it("can get the immediately following sibling of each...
CoffeeScript
JavaScript
soyjavi/QuoJS
spec/9_query.coffee
MIT
2e3042a5ef709f4d645672f5e68aeed69691eb37
2,055
https://github.com/soyjavi/QuoJS/blob/2e3042a5ef709f4d645672f5e68aeed69691eb37/spec/9_query.coffee
51
70
soyjavi/QuoJS:spec/9_query.coffee:2:js_to_coffee
js_to_coffee
Convert this JavaScript to CoffeeScript. ```javascript it("can get the first element that matches the selector by testing the element itself and traversing up through its ancestors", function() { var dom, header; header = $$("section header"); dom = header.closest("section"); return expect(dom).toEqual(el); });...
it "can get the first element that matches the selector by testing the element itself and traversing up through its ancestors", -> header = $$ "section header" dom = header.closest "section" expect(dom).toEqual el it "can get the immediately following sibling of each element in the instance", -> el....
JavaScript
CoffeeScript
soyjavi/QuoJS
spec/9_query.coffee
MIT
2e3042a5ef709f4d645672f5e68aeed69691eb37
2,055
https://github.com/soyjavi/QuoJS/blob/2e3042a5ef709f4d645672f5e68aeed69691eb37/spec/9_query.coffee
51
70
soyjavi/QuoJS:spec/9_query.coffee:2:completion
completion
it "can get the first element that matches the selector by testing the element itself and traversing up through its ancestors", -> header = $$ "section header" dom = header.closest "section" expect(dom).toEqual el it "can get the immediately following sibling of each element in the instance", -> el....
footer = $$ "section footer" expect(header.next()).toEqual footer it "can get the immediately preceding sibling of each element in the instance", -> el.append "<footer></footer>" header = $$ "section header" footer = $$ "section footer" expect(footer.prev()).toEqual header
CoffeeScript
CoffeeScript
soyjavi/QuoJS
spec/9_query.coffee
MIT
2e3042a5ef709f4d645672f5e68aeed69691eb37
2,055
https://github.com/soyjavi/QuoJS/blob/2e3042a5ef709f4d645672f5e68aeed69691eb37/spec/9_query.coffee
51
70
jianliaoim/talk-os:talk-web/client/app/command-menu.coffee:1:raw_corpus
raw_corpus
replaceAction = (triggerKey) -> (data) -> text = COMMANDS.getIn [triggerKey, 'text'] trigger = COMMANDS.getIn [triggerKey, 'trigger'] result = assign data, body: "#{text} #{data.body.substring(trigger.length)}" Q.when(result) COMMANDS = Immutable.OrderedMap 'debug': Immutable.fromJS { tri...
CoffeeScript
jianliaoim/talk-os
talk-web/client/app/command-menu.coffee
MIT
2545c4497865779a55762e03963a39237df9046b
2,703
https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-web/client/app/command-menu.coffee
22
71
jianliaoim/talk-os:talk-web/client/app/command-menu.coffee:1:completion
completion
replaceAction = (triggerKey) -> (data) -> text = COMMANDS.getIn [triggerKey, 'text'] trigger = COMMANDS.getIn [triggerKey, 'trigger'] result = assign data, body: "#{text} #{data.body.substring(trigger.length)}" Q.when(result) COMMANDS = Immutable.OrderedMap 'debug': Immutable.fromJS { tri...
} 'usage': Immutable.fromJS { trigger: '/usage' text: 'Check channel usage details' action: (data) -> Q(api.usages.read.get(queryParams: _teamId: data._teamId)) .then (resp) -> lines = resp.map (data) -> "#{data.type} | #{data.amount} | #{data.maxAmount} |#{data.month}"...
CoffeeScript
CoffeeScript
jianliaoim/talk-os
talk-web/client/app/command-menu.coffee
MIT
2545c4497865779a55762e03963a39237df9046b
2,703
https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-web/client/app/command-menu.coffee
22
71
jianliaoim/talk-os:talk-web/client/app/command-menu.coffee:2:raw_corpus
raw_corpus
action: replaceAction('unflip') } 'poop': Immutable.fromJS { trigger: '/xiaowu' text: 'Surprise!' action: (data) -> result = assign data, body: '### {.ti .ti-poop}' displayType: 'markdown' Q.when(result) }
CoffeeScript
jianliaoim/talk-os
talk-web/client/app/command-menu.coffee
MIT
2545c4497865779a55762e03963a39237df9046b
2,703
https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-web/client/app/command-menu.coffee
72
83
jianliaoim/talk-os:talk-web/client/app/command-menu.coffee:2:completion
completion
action: replaceAction('unflip') } 'poop': Immutable.fromJS { trigger: '/xiaowu' text: 'Surprise!' action: (data) ->
result = assign data, body: '### {.ti .ti-poop}' displayType: 'markdown' Q.when(result) }
CoffeeScript
CoffeeScript
jianliaoim/talk-os
talk-web/client/app/command-menu.coffee
MIT
2545c4497865779a55762e03963a39237df9046b
2,703
https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-web/client/app/command-menu.coffee
72
83
jianliaoim/talk-os:talk-web/client/app/command-menu.coffee:3:raw_corpus
raw_corpus
module.exports = React.createClass displayName: 'command-menu' mixins: [PureRenderMixin] propTypes: commands: T.instanceOf(Immutable.List).isRequired onSelect: T.func.isRequired getInitialState: -> index: 0 statics: commands: COMMANDS.toList() componentDidMount: -> window.addEventLis...
CoffeeScript
jianliaoim/talk-os
talk-web/client/app/command-menu.coffee
MIT
2545c4497865779a55762e03963a39237df9046b
2,703
https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-web/client/app/command-menu.coffee
85
134
jianliaoim/talk-os:talk-web/client/app/command-menu.coffee:3:coffee_to_js
coffee_to_js
Convert this CoffeeScript to JavaScript. ```coffeescript module.exports = React.createClass displayName: 'command-menu' mixins: [PureRenderMixin] propTypes: commands: T.instanceOf(Immutable.List).isRequired onSelect: T.func.isRequired getInitialState: -> index: 0 statics: commands: COMMANDS...
module.exports = React.createClass({ displayName: 'command-menu', mixins: [PureRenderMixin], propTypes: { commands: T.instanceOf(Immutable.List).isRequired, onSelect: T.func.isRequired }, getInitialState: function() { return { index: 0 }; }, statics: { commands: COMMANDS.toList()...
CoffeeScript
JavaScript
jianliaoim/talk-os
talk-web/client/app/command-menu.coffee
MIT
2545c4497865779a55762e03963a39237df9046b
2,703
https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-web/client/app/command-menu.coffee
85
134
jianliaoim/talk-os:talk-web/client/app/command-menu.coffee:3:js_to_coffee
js_to_coffee
Convert this JavaScript to CoffeeScript. ```javascript module.exports = React.createClass({ displayName: 'command-menu', mixins: [PureRenderMixin], propTypes: { commands: T.instanceOf(Immutable.List).isRequired, onSelect: T.func.isRequired }, getInitialState: function() { return { index: 0 ...
module.exports = React.createClass displayName: 'command-menu' mixins: [PureRenderMixin] propTypes: commands: T.instanceOf(Immutable.List).isRequired onSelect: T.func.isRequired getInitialState: -> index: 0 statics: commands: COMMANDS.toList() componentDidMount: -> window.addEventLis...
JavaScript
CoffeeScript
jianliaoim/talk-os
talk-web/client/app/command-menu.coffee
MIT
2545c4497865779a55762e03963a39237df9046b
2,703
https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-web/client/app/command-menu.coffee
85
134
jianliaoim/talk-os:talk-web/client/app/command-menu.coffee:3:completion
completion
module.exports = React.createClass displayName: 'command-menu' mixins: [PureRenderMixin] propTypes: commands: T.instanceOf(Immutable.List).isRequired onSelect: T.func.isRequired getInitialState: -> index: 0 statics: commands: COMMANDS.toList() componentDidMount: -> window.addEventLis...
if @state.index is 0 then @setState index: @props.commands.size - 1 else @setState index: (@state.index - 1) moveSelectDown: -> if @props.commands.size < 2 then return if (@state.index + 1) is @props.commands.size then @setState index: 0 else @setState index: (@state.index + 1) selectCurre...
CoffeeScript
CoffeeScript
jianliaoim/talk-os
talk-web/client/app/command-menu.coffee
MIT
2545c4497865779a55762e03963a39237df9046b
2,703
https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-web/client/app/command-menu.coffee
85
134
jianliaoim/talk-os:talk-web/client/app/command-menu.coffee:4:raw_corpus
raw_corpus
render: -> div className: 'menu', @props.commands.map (command, index) => onClick = => @onItemClick command className = cx 'flex', 'item', 'is-active': @state.index is index div className: className, onClick: onClick, key: index, span className: 'flex-fil...
CoffeeScript
jianliaoim/talk-os
talk-web/client/app/command-menu.coffee
MIT
2545c4497865779a55762e03963a39237df9046b
2,703
https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-web/client/app/command-menu.coffee
135
145
jianliaoim/talk-os:talk-web/client/app/command-menu.coffee:4:coffee_to_js
coffee_to_js
Convert this CoffeeScript to JavaScript. ```coffeescript render: -> div className: 'menu', @props.commands.map (command, index) => onClick = => @onItemClick command className = cx 'flex', 'item', 'is-active': @state.index is index div className: className, onClick:...
({ render: function() { return div({ className: 'menu' }, this.props.commands.map((command, index) => { var className, onClick; onClick = () => { return this.onItemClick(command); }; className = cx('flex', 'item', { 'is-active': this.state.index === index })...
CoffeeScript
JavaScript
jianliaoim/talk-os
talk-web/client/app/command-menu.coffee
MIT
2545c4497865779a55762e03963a39237df9046b
2,703
https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-web/client/app/command-menu.coffee
135
145
jianliaoim/talk-os:talk-web/client/app/command-menu.coffee:4:js_to_coffee
js_to_coffee
Convert this JavaScript to CoffeeScript. ```javascript ({ render: function() { return div({ className: 'menu' }, this.props.commands.map((command, index) => { var className, onClick; onClick = () => { return this.onItemClick(command); }; className = cx('flex', 'item', { ...
render: -> div className: 'menu', @props.commands.map (command, index) => onClick = => @onItemClick command className = cx 'flex', 'item', 'is-active': @state.index is index div className: className, onClick: onClick, key: index, span className: 'flex-fil...
JavaScript
CoffeeScript
jianliaoim/talk-os
talk-web/client/app/command-menu.coffee
MIT
2545c4497865779a55762e03963a39237df9046b
2,703
https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-web/client/app/command-menu.coffee
135
145
jianliaoim/talk-os:talk-web/client/app/command-menu.coffee:4:completion
completion
render: -> div className: 'menu', @props.commands.map (command, index) => onClick = => @onItemClick command
className = cx 'flex', 'item', 'is-active': @state.index is index div className: className, onClick: onClick, key: index, span className: 'flex-fill', command.get('trigger') span className: 'text', command.get('text')
CoffeeScript
CoffeeScript
jianliaoim/talk-os
talk-web/client/app/command-menu.coffee
MIT
2545c4497865779a55762e03963a39237df9046b
2,703
https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-web/client/app/command-menu.coffee
135
145
rs/pushd:lib/payload.coffee:1:raw_corpus
raw_corpus
class Payload locale_format: /^[a-z]{2}_[A-Z]{2}$/ constructor: (data) -> throw new Error('Invalid payload') unless typeof data is 'object' @id = serial++ @compiled = no @title = {} @msg = {} @data = {} @var = {} @incrementBadge = yes # ...
CoffeeScript
rs/pushd
lib/payload.coffee
MIT
9dc56de9da2a64903cad510d22d4d0e078a8ba0a
1,157
https://github.com/rs/pushd/blob/9dc56de9da2a64903cad510d22d4d0e078a8ba0a/lib/payload.coffee
3
52
rs/pushd:lib/payload.coffee:1:coffee_to_js
coffee_to_js
Convert this CoffeeScript to JavaScript. ```coffeescript class Payload locale_format: /^[a-z]{2}_[A-Z]{2}$/ constructor: (data) -> throw new Error('Invalid payload') unless typeof data is 'object' @id = serial++ @compiled = no @title = {} @msg = {} @data = {} ...
var Payload, hasProp = {}.hasOwnProperty; Payload = (function() { class Payload { constructor(data) { var i, key, len, prefix, ref, subkey, sum, type, value; if (typeof data !== 'object') { throw new Error('Invalid payload'); } this.id = serial++; this.compiled = false; ...
CoffeeScript
JavaScript
rs/pushd
lib/payload.coffee
MIT
9dc56de9da2a64903cad510d22d4d0e078a8ba0a
1,157
https://github.com/rs/pushd/blob/9dc56de9da2a64903cad510d22d4d0e078a8ba0a/lib/payload.coffee
3
52
rs/pushd:lib/payload.coffee:1:js_to_coffee
js_to_coffee
Convert this JavaScript to CoffeeScript. ```javascript var Payload, hasProp = {}.hasOwnProperty; Payload = (function() { class Payload { constructor(data) { var i, key, len, prefix, ref, subkey, sum, type, value; if (typeof data !== 'object') { throw new Error('Invalid payload'); } ...
class Payload locale_format: /^[a-z]{2}_[A-Z]{2}$/ constructor: (data) -> throw new Error('Invalid payload') unless typeof data is 'object' @id = serial++ @compiled = no @title = {} @msg = {} @data = {} @var = {} @incrementBadge = yes # ...
JavaScript
CoffeeScript
rs/pushd
lib/payload.coffee
MIT
9dc56de9da2a64903cad510d22d4d0e078a8ba0a
1,157
https://github.com/rs/pushd/blob/9dc56de9da2a64903cad510d22d4d0e078a8ba0a/lib/payload.coffee
3
52
rs/pushd:lib/payload.coffee:1:completion
completion
class Payload locale_format: /^[a-z]{2}_[A-Z]{2}$/ constructor: (data) -> throw new Error('Invalid payload') unless typeof data is 'object' @id = serial++ @compiled = no @title = {} @msg = {} @data = {} @var = {} @incrementBadge = yes # ...
when 'incrementBadge' then @incrementBadge = value != 'false' when 'badge' then @badge = value when 'category' then @category = value when 'contentAvailable' then @contentAvailable = value != 'false' else if ([prefix, subkey] = key.spli...
CoffeeScript
CoffeeScript
rs/pushd
lib/payload.coffee
MIT
9dc56de9da2a64903cad510d22d4d0e078a8ba0a
1,157
https://github.com/rs/pushd/blob/9dc56de9da2a64903cad510d22d4d0e078a8ba0a/lib/payload.coffee
3
52
rs/pushd:lib/payload.coffee:2:raw_corpus
raw_corpus
# Try with lang only in case of full locale code (en_CA) else if Payload::locale_format.test(lang) and @[type][lang[0..1]]? return @[type][lang[0..1]] else if @[type].default return @[type].default compile: -> # Compile title and msg templates @[type][lang] =...
CoffeeScript
rs/pushd
lib/payload.coffee
MIT
9dc56de9da2a64903cad510d22d4d0e078a8ba0a
1,157
https://github.com/rs/pushd/blob/9dc56de9da2a64903cad510d22d4d0e078a8ba0a/lib/payload.coffee
53
85
rs/pushd:lib/payload.coffee:2:completion
completion
# Try with lang only in case of full locale code (en_CA) else if Payload::locale_format.test(lang) and @[type][lang[0..1]]? return @[type][lang[0..1]] else if @[type].default return @[type].default compile: -> # Compile title and msg templates @[type][lang] =...
variable: (keyPath) -> if keyPath is 'event.name' # Special case if @event?.name return @event?.name else throw new Error("The ${#{keyPath}} does not exist") [prefix, key] = keyPath.split('.', 2) if prefix not in ['var', 'data'...
CoffeeScript
CoffeeScript
rs/pushd
lib/payload.coffee
MIT
9dc56de9da2a64903cad510d22d4d0e078a8ba0a
1,157
https://github.com/rs/pushd/blob/9dc56de9da2a64903cad510d22d4d0e078a8ba0a/lib/payload.coffee
53
85
rs/pushd:lib/payload.coffee:1:raw_corpus
raw_corpus
class Payload locale_format: /^[a-z]{2}_[A-Z]{2}$/ constructor: (data) -> throw new Error('Invalid payload') unless typeof data is 'object' @id = serial++ @compiled = no @title = {} @msg = {} @data = {} @var = {} @incrementBadge = yes # ...
CoffeeScript
rs/pushd
lib/payload.coffee
MIT
67cb54440d6eb8aac0bc1317592c1d1eb7ba22f4
1,157
https://github.com/rs/pushd/blob/67cb54440d6eb8aac0bc1317592c1d1eb7ba22f4/lib/payload.coffee
3
52
rs/pushd:lib/payload.coffee:1:coffee_to_js
coffee_to_js
Convert this CoffeeScript to JavaScript. ```coffeescript class Payload locale_format: /^[a-z]{2}_[A-Z]{2}$/ constructor: (data) -> throw new Error('Invalid payload') unless typeof data is 'object' @id = serial++ @compiled = no @title = {} @msg = {} @data = {} ...
var Payload, hasProp = {}.hasOwnProperty; Payload = (function() { class Payload { constructor(data) { var i, key, len, prefix, ref, subkey, sum, type, value; if (typeof data !== 'object') { throw new Error('Invalid payload'); } this.id = serial++; this.compiled = false; ...
CoffeeScript
JavaScript
rs/pushd
lib/payload.coffee
MIT
67cb54440d6eb8aac0bc1317592c1d1eb7ba22f4
1,157
https://github.com/rs/pushd/blob/67cb54440d6eb8aac0bc1317592c1d1eb7ba22f4/lib/payload.coffee
3
52
rs/pushd:lib/payload.coffee:1:js_to_coffee
js_to_coffee
Convert this JavaScript to CoffeeScript. ```javascript var Payload, hasProp = {}.hasOwnProperty; Payload = (function() { class Payload { constructor(data) { var i, key, len, prefix, ref, subkey, sum, type, value; if (typeof data !== 'object') { throw new Error('Invalid payload'); } ...
class Payload locale_format: /^[a-z]{2}_[A-Z]{2}$/ constructor: (data) -> throw new Error('Invalid payload') unless typeof data is 'object' @id = serial++ @compiled = no @title = {} @msg = {} @data = {} @var = {} @incrementBadge = yes # ...
JavaScript
CoffeeScript
rs/pushd
lib/payload.coffee
MIT
67cb54440d6eb8aac0bc1317592c1d1eb7ba22f4
1,157
https://github.com/rs/pushd/blob/67cb54440d6eb8aac0bc1317592c1d1eb7ba22f4/lib/payload.coffee
3
52
rs/pushd:lib/payload.coffee:1:completion
completion
class Payload locale_format: /^[a-z]{2}_[A-Z]{2}$/ constructor: (data) -> throw new Error('Invalid payload') unless typeof data is 'object' @id = serial++ @compiled = no @title = {} @msg = {} @data = {} @var = {} @incrementBadge = yes # ...
when 'incrementBadge' then @incrementBadge = value != 'false' when 'category' then @category = value when 'contentAvailable' then @contentAvailable = value != 'false' else if ([prefix, subkey] = key.split('.', 2)).length is 2 @[...
CoffeeScript
CoffeeScript
rs/pushd
lib/payload.coffee
MIT
67cb54440d6eb8aac0bc1317592c1d1eb7ba22f4
1,157
https://github.com/rs/pushd/blob/67cb54440d6eb8aac0bc1317592c1d1eb7ba22f4/lib/payload.coffee
3
52
rs/pushd:lib/payload.coffee:2:raw_corpus
raw_corpus
else if Payload::locale_format.test(lang) and @[type][lang[0..1]]? return @[type][lang[0..1]] else if @[type].default return @[type].default compile: -> # Compile title and msg templates @[type][lang] = @compileTemplate(msg) for own lang, msg of @[type] for type in [...
CoffeeScript
rs/pushd
lib/payload.coffee
MIT
67cb54440d6eb8aac0bc1317592c1d1eb7ba22f4
1,157
https://github.com/rs/pushd/blob/67cb54440d6eb8aac0bc1317592c1d1eb7ba22f4/lib/payload.coffee
53
84
rs/pushd:lib/payload.coffee:2:completion
completion
else if Payload::locale_format.test(lang) and @[type][lang[0..1]]? return @[type][lang[0..1]] else if @[type].default return @[type].default compile: -> # Compile title and msg templates @[type][lang] = @compileTemplate(msg) for own lang, msg of @[type] for type in [...
if keyPath is 'event.name' # Special case if @event?.name return @event?.name else throw new Error("The ${#{keyPath}} does not exist") [prefix, key] = keyPath.split('.', 2) if prefix not in ['var', 'data'] throw new Error("...
CoffeeScript
CoffeeScript
rs/pushd
lib/payload.coffee
MIT
67cb54440d6eb8aac0bc1317592c1d1eb7ba22f4
1,157
https://github.com/rs/pushd/blob/67cb54440d6eb8aac0bc1317592c1d1eb7ba22f4/lib/payload.coffee
53
84
rs/pushd:lib/payload.coffee:1:raw_corpus
raw_corpus
class Payload locale_format: /^[a-z]{2}_[A-Z]{2}$/ constructor: (data) -> throw new Error('Invalid payload') unless typeof data is 'object' @id = serial++ @compiled = no @title = {} @msg = {} @data = {} @var = {} @incrementBadge = yes @co...
CoffeeScript
rs/pushd
lib/payload.coffee
MIT
d9ded9feb422db46a0c289acbe7006bf4c2a2558
1,157
https://github.com/rs/pushd/blob/d9ded9feb422db46a0c289acbe7006bf4c2a2558/lib/payload.coffee
3
52
rs/pushd:lib/payload.coffee:1:coffee_to_js
coffee_to_js
Convert this CoffeeScript to JavaScript. ```coffeescript class Payload locale_format: /^[a-z]{2}_[A-Z]{2}$/ constructor: (data) -> throw new Error('Invalid payload') unless typeof data is 'object' @id = serial++ @compiled = no @title = {} @msg = {} @data = {} ...
var Payload, hasProp = {}.hasOwnProperty; Payload = (function() { class Payload { constructor(data) { var i, key, len, prefix, ref, subkey, sum, type, value; if (typeof data !== 'object') { throw new Error('Invalid payload'); } this.id = serial++; this.compiled = false; ...
CoffeeScript
JavaScript
rs/pushd
lib/payload.coffee
MIT
d9ded9feb422db46a0c289acbe7006bf4c2a2558
1,157
https://github.com/rs/pushd/blob/d9ded9feb422db46a0c289acbe7006bf4c2a2558/lib/payload.coffee
3
52
rs/pushd:lib/payload.coffee:1:js_to_coffee
js_to_coffee
Convert this JavaScript to CoffeeScript. ```javascript var Payload, hasProp = {}.hasOwnProperty; Payload = (function() { class Payload { constructor(data) { var i, key, len, prefix, ref, subkey, sum, type, value; if (typeof data !== 'object') { throw new Error('Invalid payload'); } ...
class Payload locale_format: /^[a-z]{2}_[A-Z]{2}$/ constructor: (data) -> throw new Error('Invalid payload') unless typeof data is 'object' @id = serial++ @compiled = no @title = {} @msg = {} @data = {} @var = {} @incrementBadge = yes @co...
JavaScript
CoffeeScript
rs/pushd
lib/payload.coffee
MIT
d9ded9feb422db46a0c289acbe7006bf4c2a2558
1,157
https://github.com/rs/pushd/blob/d9ded9feb422db46a0c289acbe7006bf4c2a2558/lib/payload.coffee
3
52
rs/pushd:lib/payload.coffee:1:completion
completion
class Payload locale_format: /^[a-z]{2}_[A-Z]{2}$/ constructor: (data) -> throw new Error('Invalid payload') unless typeof data is 'object' @id = serial++ @compiled = no @title = {} @msg = {} @data = {} @var = {} @incrementBadge = yes @co...
when 'sound' then @sound = value when 'incrementBadge' then @incrementBadge = value != 'false' when 'category' then @category = value when 'contentAvailable' then @contentAvailable = value != 'false' else if ([prefix, subkey] = key.spli...
CoffeeScript
CoffeeScript
rs/pushd
lib/payload.coffee
MIT
d9ded9feb422db46a0c289acbe7006bf4c2a2558
1,157
https://github.com/rs/pushd/blob/d9ded9feb422db46a0c289acbe7006bf4c2a2558/lib/payload.coffee
3
52