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-web/client/actions/topic-prefs.coffee:1:coffee_to_js
coffee_to_js
Convert this CoffeeScript to JavaScript. ```coffeescript dispatcher = require '../dispatcher' lang = require '../locales/lang' notifyActions = require '../actions/notify' api = require '../network/api' exports.update = (_roomId, data, success, fail) -> config = pathParams: id: _roomId data: data api...
var api, dispatcher, lang, notifyActions; dispatcher = require('../dispatcher'); lang = require('../locales/lang'); notifyActions = require('../actions/notify'); api = require('../network/api'); exports.update = function(_roomId, data, success, fail) { var config; config = { pathParams: { id: _roomId...
CoffeeScript
JavaScript
jianliaoim/talk-os
talk-web/client/actions/topic-prefs.coffee
MIT
2545c4497865779a55762e03963a39237df9046b
2,703
https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-web/client/actions/topic-prefs.coffee
1
19
jianliaoim/talk-os:talk-web/client/actions/topic-prefs.coffee:1:js_to_coffee
js_to_coffee
Convert this JavaScript to CoffeeScript. ```javascript var api, dispatcher, lang, notifyActions; dispatcher = require('../dispatcher'); lang = require('../locales/lang'); notifyActions = require('../actions/notify'); api = require('../network/api'); exports.update = function(_roomId, data, success, fail) { var c...
dispatcher = require '../dispatcher' lang = require '../locales/lang' notifyActions = require '../actions/notify' api = require '../network/api' exports.update = (_roomId, data, success, fail) -> config = pathParams: id: _roomId data: data api.rooms.prefs.put(config) .then (resp) -> dispat...
JavaScript
CoffeeScript
jianliaoim/talk-os
talk-web/client/actions/topic-prefs.coffee
MIT
2545c4497865779a55762e03963a39237df9046b
2,703
https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-web/client/actions/topic-prefs.coffee
1
19
jianliaoim/talk-os:talk-web/client/actions/topic-prefs.coffee:1:completion
completion
dispatcher = require '../dispatcher' lang = require '../locales/lang' notifyActions = require '../actions/notify' api = require '../network/api' exports.update = (_roomId, data, success, fail) -> config = pathParams:
id: _roomId data: data api.rooms.prefs.put(config) .then (resp) -> dispatcher.handleViewAction type: 'topic-prefs/update' data: resp success? resp .catch (error) -> fail? error
CoffeeScript
CoffeeScript
jianliaoim/talk-os
talk-web/client/actions/topic-prefs.coffee
MIT
2545c4497865779a55762e03963a39237df9046b
2,703
https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-web/client/actions/topic-prefs.coffee
1
19
octoblu/meshblu:lib/SocketIOThrottler.coffee:1:raw_corpus
raw_corpus
debug = require('debug')('meshblu:SocketIOThrottler') _ = require 'lodash' QueryThrottle = require './QueryThrottle' class SocketIOThrottler constructor: (@socket) -> throttle: (fn=->) => => originalArguments = arguments onThrottle = => debug 'onThrottle' callback = _.last originalArguments ...
CoffeeScript
octoblu/meshblu
lib/SocketIOThrottler.coffee
MIT
c18ea41fe28ee588fe9c5b88e1f18852616f120e
815
https://github.com/octoblu/meshblu/blob/c18ea41fe28ee588fe9c5b88e1f18852616f120e/lib/SocketIOThrottler.coffee
1
23
octoblu/meshblu:lib/SocketIOThrottler.coffee:1:coffee_to_js
coffee_to_js
Convert this CoffeeScript to JavaScript. ```coffeescript debug = require('debug')('meshblu:SocketIOThrottler') _ = require 'lodash' QueryThrottle = require './QueryThrottle' class SocketIOThrottler constructor: (@socket) -> throttle: (fn=->) => => originalArguments = arguments onThrottle = => debug...
var QueryThrottle, SocketIOThrottler, _, debug; debug = require('debug')('meshblu:SocketIOThrottler'); _ = require('lodash'); QueryThrottle = require('./QueryThrottle'); SocketIOThrottler = class SocketIOThrottler { constructor(socket) { this.throttle = this.throttle.bind(this); this.socket = socket; } ...
CoffeeScript
JavaScript
octoblu/meshblu
lib/SocketIOThrottler.coffee
MIT
c18ea41fe28ee588fe9c5b88e1f18852616f120e
815
https://github.com/octoblu/meshblu/blob/c18ea41fe28ee588fe9c5b88e1f18852616f120e/lib/SocketIOThrottler.coffee
1
23
octoblu/meshblu:lib/SocketIOThrottler.coffee:1:js_to_coffee
js_to_coffee
Convert this JavaScript to CoffeeScript. ```javascript var QueryThrottle, SocketIOThrottler, _, debug; debug = require('debug')('meshblu:SocketIOThrottler'); _ = require('lodash'); QueryThrottle = require('./QueryThrottle'); SocketIOThrottler = class SocketIOThrottler { constructor(socket) { this.throttle = t...
debug = require('debug')('meshblu:SocketIOThrottler') _ = require 'lodash' QueryThrottle = require './QueryThrottle' class SocketIOThrottler constructor: (@socket) -> throttle: (fn=->) => => originalArguments = arguments onThrottle = => debug 'onThrottle' callback = _.last originalArguments ...
JavaScript
CoffeeScript
octoblu/meshblu
lib/SocketIOThrottler.coffee
MIT
c18ea41fe28ee588fe9c5b88e1f18852616f120e
815
https://github.com/octoblu/meshblu/blob/c18ea41fe28ee588fe9c5b88e1f18852616f120e/lib/SocketIOThrottler.coffee
1
23
octoblu/meshblu:lib/SocketIOThrottler.coffee:1:completion
completion
debug = require('debug')('meshblu:SocketIOThrottler') _ = require 'lodash' QueryThrottle = require './QueryThrottle' class SocketIOThrottler constructor: (@socket) -> throttle: (fn=->) => => originalArguments = arguments onThrottle = =>
debug 'onThrottle' callback = _.last originalArguments callback [{message: 'Rate Limit Exceeded', status: 429}] if _.isFunction callback @socket.emit 'notReady',{error: {message: 'Rate Limit Exceeded', status: 429}} @socket.disconnect(true) new QueryThrottle().throttle @socket.id, onThrot...
CoffeeScript
CoffeeScript
octoblu/meshblu
lib/SocketIOThrottler.coffee
MIT
c18ea41fe28ee588fe9c5b88e1f18852616f120e
815
https://github.com/octoblu/meshblu/blob/c18ea41fe28ee588fe9c5b88e1f18852616f120e/lib/SocketIOThrottler.coffee
1
23
octoblu/meshblu:lib/SocketIOThrottler.coffee:1:raw_corpus
raw_corpus
debug = require('debug')('meshblu:SocketIOThrottler') _ = require 'lodash' QueryThrottle = require './QueryThrottle' class SocketIOThrottler constructor: (@socket) -> throttle: (fn=->) => => originalArguments = arguments onThrottle = (error) => debug 'onThrottle' callback = _.last originalArg...
CoffeeScript
octoblu/meshblu
lib/SocketIOThrottler.coffee
MIT
432c25fe2000825c95dfbfd29fb4985a4ba70418
815
https://github.com/octoblu/meshblu/blob/432c25fe2000825c95dfbfd29fb4985a4ba70418/lib/SocketIOThrottler.coffee
1
23
octoblu/meshblu:lib/SocketIOThrottler.coffee:1:coffee_to_js
coffee_to_js
Convert this CoffeeScript to JavaScript. ```coffeescript debug = require('debug')('meshblu:SocketIOThrottler') _ = require 'lodash' QueryThrottle = require './QueryThrottle' class SocketIOThrottler constructor: (@socket) -> throttle: (fn=->) => => originalArguments = arguments onThrottle = (error) => ...
var QueryThrottle, SocketIOThrottler, _, debug; debug = require('debug')('meshblu:SocketIOThrottler'); _ = require('lodash'); QueryThrottle = require('./QueryThrottle'); SocketIOThrottler = class SocketIOThrottler { constructor(socket) { this.throttle = this.throttle.bind(this); this.socket = socket; } ...
CoffeeScript
JavaScript
octoblu/meshblu
lib/SocketIOThrottler.coffee
MIT
432c25fe2000825c95dfbfd29fb4985a4ba70418
815
https://github.com/octoblu/meshblu/blob/432c25fe2000825c95dfbfd29fb4985a4ba70418/lib/SocketIOThrottler.coffee
1
23
octoblu/meshblu:lib/SocketIOThrottler.coffee:1:js_to_coffee
js_to_coffee
Convert this JavaScript to CoffeeScript. ```javascript var QueryThrottle, SocketIOThrottler, _, debug; debug = require('debug')('meshblu:SocketIOThrottler'); _ = require('lodash'); QueryThrottle = require('./QueryThrottle'); SocketIOThrottler = class SocketIOThrottler { constructor(socket) { this.throttle = t...
debug = require('debug')('meshblu:SocketIOThrottler') _ = require 'lodash' QueryThrottle = require './QueryThrottle' class SocketIOThrottler constructor: (@socket) -> throttle: (fn=->) => => originalArguments = arguments onThrottle = (error) => debug 'onThrottle' callback = _.last originalArg...
JavaScript
CoffeeScript
octoblu/meshblu
lib/SocketIOThrottler.coffee
MIT
432c25fe2000825c95dfbfd29fb4985a4ba70418
815
https://github.com/octoblu/meshblu/blob/432c25fe2000825c95dfbfd29fb4985a4ba70418/lib/SocketIOThrottler.coffee
1
23
octoblu/meshblu:lib/SocketIOThrottler.coffee:1:completion
completion
debug = require('debug')('meshblu:SocketIOThrottler') _ = require 'lodash' QueryThrottle = require './QueryThrottle' class SocketIOThrottler constructor: (@socket) -> throttle: (fn=->) => => originalArguments = arguments onThrottle = (error) =>
debug 'onThrottle' callback = _.last originalArguments callback [{message: error.message, status: error.status}] if _.isFunction callback @socket.emit 'notReady',{error: {message: error.message, status: error.status}} @socket.disconnect(true) new QueryThrottle().throttle @socket.id, onThr...
CoffeeScript
CoffeeScript
octoblu/meshblu
lib/SocketIOThrottler.coffee
MIT
432c25fe2000825c95dfbfd29fb4985a4ba70418
815
https://github.com/octoblu/meshblu/blob/432c25fe2000825c95dfbfd29fb4985a4ba70418/lib/SocketIOThrottler.coffee
1
23
js2coffee/js2coffee:lib/transforms/members.coffee:1:raw_corpus
raw_corpus
{ replace } = require('../helpers') TransformerBase = require('./base') ### # Performs transformations on `a.b` scope resolutions. # # this.x => @x # x.prototype.y => x::y # this.prototype.y => @::y # function(){}.y => (->).y ### module.exports = class extends TransformerBase ...
CoffeeScript
js2coffee/js2coffee
lib/transforms/members.coffee
MIT
47d3159aba94ffd4377138f7837717d8628eef9f
2,082
https://github.com/js2coffee/js2coffee/blob/47d3159aba94ffd4377138f7837717d8628eef9f/lib/transforms/members.coffee
1
50
js2coffee/js2coffee:lib/transforms/members.coffee:1:coffee_to_js
coffee_to_js
Convert this CoffeeScript to JavaScript. ```coffeescript { replace } = require('../helpers') TransformerBase = require('./base') ### # Performs transformations on `a.b` scope resolutions. # # this.x => @x # x.prototype.y => x::y # this.prototype.y => @::y # function(){}.y => (->)...
var TransformerBase, replace; ({replace} = require('../helpers')); TransformerBase = require('./base'); /* * Performs transformations on `a.b` scope resolutions. * * this.x => @x * x.prototype.y => x::y * this.prototype.y => @::y * function(){}.y => (->).y */ module.expo...
CoffeeScript
JavaScript
js2coffee/js2coffee
lib/transforms/members.coffee
MIT
47d3159aba94ffd4377138f7837717d8628eef9f
2,082
https://github.com/js2coffee/js2coffee/blob/47d3159aba94ffd4377138f7837717d8628eef9f/lib/transforms/members.coffee
1
50
js2coffee/js2coffee:lib/transforms/members.coffee:1:js_to_coffee
js_to_coffee
Convert this JavaScript to CoffeeScript. ```javascript var TransformerBase, replace; ({replace} = require('../helpers')); TransformerBase = require('./base'); /* * Performs transformations on `a.b` scope resolutions. * * this.x => @x * x.prototype.y => x::y * this.prototype.y => @...
{ replace } = require('../helpers') TransformerBase = require('./base') ### # Performs transformations on `a.b` scope resolutions. # # this.x => @x # x.prototype.y => x::y # this.prototype.y => @::y # function(){}.y => (->).y ### module.exports = class extends TransformerBase ...
JavaScript
CoffeeScript
js2coffee/js2coffee
lib/transforms/members.coffee
MIT
47d3159aba94ffd4377138f7837717d8628eef9f
2,082
https://github.com/js2coffee/js2coffee/blob/47d3159aba94ffd4377138f7837717d8628eef9f/lib/transforms/members.coffee
1
50
js2coffee/js2coffee:lib/transforms/members.coffee:1:completion
completion
{ replace } = require('../helpers') TransformerBase = require('./base') ### # Performs transformations on `a.b` scope resolutions. # # this.x => @x # x.prototype.y => x::y # this.prototype.y => @::y # function(){}.y => (->).y ### module.exports = class extends TransformerBase ...
### transformThisToAtSign: (node) -> if node.object.type is 'ThisExpression' node._prefixed = true node.object._prefix = true node braceObjectOnLeft: (node) -> if node.object.type is 'ObjectExpression' node.object._braced = true return ### # Replaces `a.prototype.b` with `a:...
CoffeeScript
CoffeeScript
js2coffee/js2coffee
lib/transforms/members.coffee
MIT
47d3159aba94ffd4377138f7837717d8628eef9f
2,082
https://github.com/js2coffee/js2coffee/blob/47d3159aba94ffd4377138f7837717d8628eef9f/lib/transforms/members.coffee
1
50
js2coffee/js2coffee:lib/transforms/members.coffee:2:raw_corpus
raw_corpus
type: 'CoffeePrototypeExpression' object: node.object.object property: node.property ### # Parenthesize function expressions if they're in the left-hand side of a # member expression (eg, `(-> x).toString()`). ### parenthesizeObjectIfFunction: (node) -> if node.object.type is 'FunctionEx...
CoffeeScript
js2coffee/js2coffee
lib/transforms/members.coffee
MIT
47d3159aba94ffd4377138f7837717d8628eef9f
2,082
https://github.com/js2coffee/js2coffee/blob/47d3159aba94ffd4377138f7837717d8628eef9f/lib/transforms/members.coffee
51
63
js2coffee/js2coffee:lib/transforms/members.coffee:2:completion
completion
type: 'CoffeePrototypeExpression' object: node.object.object property: node.property ### # Parenthesize function expressions if they're in the left-hand side of a
# member expression (eg, `(-> x).toString()`). ### parenthesizeObjectIfFunction: (node) -> if node.object.type is 'FunctionExpression' node.object._parenthesized = true node
CoffeeScript
CoffeeScript
js2coffee/js2coffee
lib/transforms/members.coffee
MIT
47d3159aba94ffd4377138f7837717d8628eef9f
2,082
https://github.com/js2coffee/js2coffee/blob/47d3159aba94ffd4377138f7837717d8628eef9f/lib/transforms/members.coffee
51
63
js2coffee/js2coffee:lib/transforms/members.coffee:1:raw_corpus
raw_corpus
{ replace } = require('../helpers') TransformerBase = require('./base') ### # Performs transformations on `a.b` scope resolutions. # # this.x => @x # x.prototype.y => x::y # this.prototype.y => @::y # function(){}.y => (->).y ### class MemberTransforms extends TransformerBase ...
CoffeeScript
js2coffee/js2coffee
lib/transforms/members.coffee
MIT
aeaa3cbb7c6c0f43c9bfc3f62b7eea4a0c1acfe4
2,082
https://github.com/js2coffee/js2coffee/blob/aeaa3cbb7c6c0f43c9bfc3f62b7eea4a0c1acfe4/lib/transforms/members.coffee
1
50
js2coffee/js2coffee:lib/transforms/members.coffee:1:coffee_to_js
coffee_to_js
Convert this CoffeeScript to JavaScript. ```coffeescript { replace } = require('../helpers') TransformerBase = require('./base') ### # Performs transformations on `a.b` scope resolutions. # # this.x => @x # x.prototype.y => x::y # this.prototype.y => @::y # function(){}.y => (->)...
var MemberTransforms, TransformerBase, replace; ({replace} = require('../helpers')); TransformerBase = require('./base'); /* * Performs transformations on `a.b` scope resolutions. * * this.x => @x * x.prototype.y => x::y * this.prototype.y => @::y * function(){}.y => (->)...
CoffeeScript
JavaScript
js2coffee/js2coffee
lib/transforms/members.coffee
MIT
aeaa3cbb7c6c0f43c9bfc3f62b7eea4a0c1acfe4
2,082
https://github.com/js2coffee/js2coffee/blob/aeaa3cbb7c6c0f43c9bfc3f62b7eea4a0c1acfe4/lib/transforms/members.coffee
1
50
js2coffee/js2coffee:lib/transforms/members.coffee:1:js_to_coffee
js_to_coffee
Convert this JavaScript to CoffeeScript. ```javascript var MemberTransforms, TransformerBase, replace; ({replace} = require('../helpers')); TransformerBase = require('./base'); /* * Performs transformations on `a.b` scope resolutions. * * this.x => @x * x.prototype.y => x::y * this....
{ replace } = require('../helpers') TransformerBase = require('./base') ### # Performs transformations on `a.b` scope resolutions. # # this.x => @x # x.prototype.y => x::y # this.prototype.y => @::y # function(){}.y => (->).y ### class MemberTransforms extends TransformerBase ...
JavaScript
CoffeeScript
js2coffee/js2coffee
lib/transforms/members.coffee
MIT
aeaa3cbb7c6c0f43c9bfc3f62b7eea4a0c1acfe4
2,082
https://github.com/js2coffee/js2coffee/blob/aeaa3cbb7c6c0f43c9bfc3f62b7eea4a0c1acfe4/lib/transforms/members.coffee
1
50
js2coffee/js2coffee:lib/transforms/members.coffee:1:completion
completion
{ replace } = require('../helpers') TransformerBase = require('./base') ### # Performs transformations on `a.b` scope resolutions. # # this.x => @x # x.prototype.y => x::y # this.prototype.y => @::y # function(){}.y => (->).y ### class MemberTransforms extends TransformerBase ...
transformThisToAtSign: (node) -> if node.object.type is 'ThisExpression' node._prefixed = true node.object._prefix = true node braceObjectOnLeft: (node) -> if node.object.type is 'ObjectExpression' node.object._braced = true return ### # Replaces `a.prototype.b` with `a::b` in ...
CoffeeScript
CoffeeScript
js2coffee/js2coffee
lib/transforms/members.coffee
MIT
aeaa3cbb7c6c0f43c9bfc3f62b7eea4a0c1acfe4
2,082
https://github.com/js2coffee/js2coffee/blob/aeaa3cbb7c6c0f43c9bfc3f62b7eea4a0c1acfe4/lib/transforms/members.coffee
1
50
js2coffee/js2coffee:lib/transforms/members.coffee:2:raw_corpus
raw_corpus
object: node.object.object property: node.property ### # Parenthesize function expressions if they're in the left-hand side of a # member expression (eg, `(-> x).toString()`). ### parenthesizeObjectIfFunction: (node) -> if node.object.type is 'FunctionExpression' node.object._parenthesized...
CoffeeScript
js2coffee/js2coffee
lib/transforms/members.coffee
MIT
aeaa3cbb7c6c0f43c9bfc3f62b7eea4a0c1acfe4
2,082
https://github.com/js2coffee/js2coffee/blob/aeaa3cbb7c6c0f43c9bfc3f62b7eea4a0c1acfe4/lib/transforms/members.coffee
51
64
js2coffee/js2coffee:lib/transforms/members.coffee:2:coffee_to_js
coffee_to_js
Convert this CoffeeScript to JavaScript. ```coffeescript object: node.object.object property: node.property ### # Parenthesize function expressions if they're in the left-hand side of a # member expression (eg, `(-> x).toString()`). ### parenthesizeObjectIfFunction: (node) -> if node.object.type...
({ object: node.object.object({ property: node.property }), /* * Parenthesize function expressions if they're in the left-hand side of a * member expression (eg, `(-> x).toString()`). */ parenthesizeObjectIfFunction: function(node) { if (node.object.type === 'FunctionExpression') { node.o...
CoffeeScript
JavaScript
js2coffee/js2coffee
lib/transforms/members.coffee
MIT
aeaa3cbb7c6c0f43c9bfc3f62b7eea4a0c1acfe4
2,082
https://github.com/js2coffee/js2coffee/blob/aeaa3cbb7c6c0f43c9bfc3f62b7eea4a0c1acfe4/lib/transforms/members.coffee
51
64
js2coffee/js2coffee:lib/transforms/members.coffee:2:js_to_coffee
js_to_coffee
Convert this JavaScript to CoffeeScript. ```javascript ({ object: node.object.object({ property: node.property }), /* * Parenthesize function expressions if they're in the left-hand side of a * member expression (eg, `(-> x).toString()`). */ parenthesizeObjectIfFunction: function(node) { if (no...
object: node.object.object property: node.property ### # Parenthesize function expressions if they're in the left-hand side of a # member expression (eg, `(-> x).toString()`). ### parenthesizeObjectIfFunction: (node) -> if node.object.type is 'FunctionExpression' node.object._parenthesized...
JavaScript
CoffeeScript
js2coffee/js2coffee
lib/transforms/members.coffee
MIT
aeaa3cbb7c6c0f43c9bfc3f62b7eea4a0c1acfe4
2,082
https://github.com/js2coffee/js2coffee/blob/aeaa3cbb7c6c0f43c9bfc3f62b7eea4a0c1acfe4/lib/transforms/members.coffee
51
64
js2coffee/js2coffee:lib/transforms/members.coffee:2:completion
completion
object: node.object.object property: node.property ### # Parenthesize function expressions if they're in the left-hand side of a # member expression (eg, `(-> x).toString()`). ###
parenthesizeObjectIfFunction: (node) -> if node.object.type is 'FunctionExpression' node.object._parenthesized = true node module.exports = MemberTransforms
CoffeeScript
CoffeeScript
js2coffee/js2coffee
lib/transforms/members.coffee
MIT
aeaa3cbb7c6c0f43c9bfc3f62b7eea4a0c1acfe4
2,082
https://github.com/js2coffee/js2coffee/blob/aeaa3cbb7c6c0f43c9bfc3f62b7eea4a0c1acfe4/lib/transforms/members.coffee
51
64
Pagedraw/pagedraw:test/unit/util_tests.coffee:1:raw_corpus
raw_corpus
## IMPORTANT TODO: These tests still work, but they should all be ## migrated to Mocha style, for automatization purposes _l = require 'lodash' chai = require 'chai' assert = (condition) -> chai.assert(condition(), condition.toString()) ## util = require '../../src/util' describe 'Util', -> it 'zips dicts'...
CoffeeScript
Pagedraw/pagedraw
test/unit/util_tests.coffee
MIT
aba1bd1b8ef6bb7f58866a9d11ebb7f1e0e18a8e
3,558
https://github.com/Pagedraw/pagedraw/blob/aba1bd1b8ef6bb7f58866a9d11ebb7f1e0e18a8e/test/unit/util_tests.coffee
1
47
Pagedraw/pagedraw:test/unit/util_tests.coffee:1:coffee_to_js
coffee_to_js
Convert this CoffeeScript to JavaScript. ```coffeescript ## IMPORTANT TODO: These tests still work, but they should all be ## migrated to Mocha style, for automatization purposes _l = require 'lodash' chai = require 'chai' assert = (condition) -> chai.assert(condition(), condition.toString()) ## util = require ...
//# IMPORTANT TODO: These tests still work, but they should all be //# migrated to Mocha style, for automatization purposes var _l, assert, chai, util; _l = require('lodash'); chai = require('chai'); assert = function(condition) { return chai.assert(condition(), condition.toString()); }; //# util = require('../.....
CoffeeScript
JavaScript
Pagedraw/pagedraw
test/unit/util_tests.coffee
MIT
aba1bd1b8ef6bb7f58866a9d11ebb7f1e0e18a8e
3,558
https://github.com/Pagedraw/pagedraw/blob/aba1bd1b8ef6bb7f58866a9d11ebb7f1e0e18a8e/test/unit/util_tests.coffee
1
47
Pagedraw/pagedraw:test/unit/util_tests.coffee:1:js_to_coffee
js_to_coffee
Convert this JavaScript to CoffeeScript. ```javascript //# IMPORTANT TODO: These tests still work, but they should all be //# migrated to Mocha style, for automatization purposes var _l, assert, chai, util; _l = require('lodash'); chai = require('chai'); assert = function(condition) { return chai.assert(condition(...
## IMPORTANT TODO: These tests still work, but they should all be ## migrated to Mocha style, for automatization purposes _l = require 'lodash' chai = require 'chai' assert = (condition) -> chai.assert(condition(), condition.toString()) ## util = require '../../src/util' describe 'Util', -> it 'zips dicts'...
JavaScript
CoffeeScript
Pagedraw/pagedraw
test/unit/util_tests.coffee
MIT
aba1bd1b8ef6bb7f58866a9d11ebb7f1e0e18a8e
3,558
https://github.com/Pagedraw/pagedraw/blob/aba1bd1b8ef6bb7f58866a9d11ebb7f1e0e18a8e/test/unit/util_tests.coffee
1
47
Pagedraw/pagedraw:test/unit/util_tests.coffee:1:completion
completion
## IMPORTANT TODO: These tests still work, but they should all be ## migrated to Mocha style, for automatization purposes _l = require 'lodash' chai = require 'chai' assert = (condition) -> chai.assert(condition(), condition.toString()) ## util = require '../../src/util' describe 'Util', -> it 'zips dicts'...
['b', 'z', 'q', 'c', 'b'] ]), [ ['a', undefined] ['b', 'b'] ['c', 'c'] ['d', undefined] [undefined, 'z'] [undefined, 'q'] ] ### console.log util.zip_sets_by('k', [ [{k: 'a', num: 100}, {k: 'f', otro: 98},...
CoffeeScript
CoffeeScript
Pagedraw/pagedraw
test/unit/util_tests.coffee
MIT
aba1bd1b8ef6bb7f58866a9d11ebb7f1e0e18a8e
3,558
https://github.com/Pagedraw/pagedraw/blob/aba1bd1b8ef6bb7f58866a9d11ebb7f1e0e18a8e/test/unit/util_tests.coffee
1
47
jianliaoim/talk-os:talk-web/client/util/detect.coffee:1:raw_corpus
raw_corpus
exports.isSafariFullscreen = -> unless Util.parseUA().browser is 'safari' return false # screenTop is tricky, not supported in Firefox # returns 23 in Safari when not in fullscreen return window.screenTop is 0
CoffeeScript
jianliaoim/talk-os
talk-web/client/util/detect.coffee
MIT
2545c4497865779a55762e03963a39237df9046b
2,703
https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-web/client/util/detect.coffee
13
18
jianliaoim/talk-os:talk-web/client/util/detect.coffee:1:coffee_to_js
coffee_to_js
Convert this CoffeeScript to JavaScript. ```coffeescript exports.isSafariFullscreen = -> unless Util.parseUA().browser is 'safari' return false # screenTop is tricky, not supported in Firefox # returns 23 in Safari when not in fullscreen return window.screenTop is 0 ```
exports.isSafariFullscreen = function() { if (Util.parseUA().browser !== 'safari') { return false; } // screenTop is tricky, not supported in Firefox // returns 23 in Safari when not in fullscreen return window.screenTop === 0; };
CoffeeScript
JavaScript
jianliaoim/talk-os
talk-web/client/util/detect.coffee
MIT
2545c4497865779a55762e03963a39237df9046b
2,703
https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-web/client/util/detect.coffee
13
18
jianliaoim/talk-os:talk-web/client/util/detect.coffee:1:js_to_coffee
js_to_coffee
Convert this JavaScript to CoffeeScript. ```javascript exports.isSafariFullscreen = function() { if (Util.parseUA().browser !== 'safari') { return false; } // screenTop is tricky, not supported in Firefox // returns 23 in Safari when not in fullscreen return window.screenTop === 0; }; ```
exports.isSafariFullscreen = -> unless Util.parseUA().browser is 'safari' return false # screenTop is tricky, not supported in Firefox # returns 23 in Safari when not in fullscreen return window.screenTop is 0
JavaScript
CoffeeScript
jianliaoim/talk-os
talk-web/client/util/detect.coffee
MIT
2545c4497865779a55762e03963a39237df9046b
2,703
https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-web/client/util/detect.coffee
13
18
jianliaoim/talk-os:talk-web/client/util/detect.coffee:1:completion
completion
exports.isSafariFullscreen = -> unless Util.parseUA().browser is 'safari' return false
# screenTop is tricky, not supported in Firefox # returns 23 in Safari when not in fullscreen return window.screenTop is 0
CoffeeScript
CoffeeScript
jianliaoim/talk-os
talk-web/client/util/detect.coffee
MIT
2545c4497865779a55762e03963a39237df9046b
2,703
https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-web/client/util/detect.coffee
13
18
jianliaoim/talk-os:talk-web/client/util/detect.coffee:2:raw_corpus
raw_corpus
exports.isTalkai = (data) -> if Immutable.Map.isMap(data) data.get('isRobot') and data.get('service') is 'talkai' else dev.warn "undefined data to detect talkai" dev.trace() false
CoffeeScript
jianliaoim/talk-os
talk-web/client/util/detect.coffee
MIT
2545c4497865779a55762e03963a39237df9046b
2,703
https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-web/client/util/detect.coffee
20
26
jianliaoim/talk-os:talk-web/client/util/detect.coffee:2:coffee_to_js
coffee_to_js
Convert this CoffeeScript to JavaScript. ```coffeescript exports.isTalkai = (data) -> if Immutable.Map.isMap(data) data.get('isRobot') and data.get('service') is 'talkai' else dev.warn "undefined data to detect talkai" dev.trace() false ```
exports.isTalkai = function(data) { if (Immutable.Map.isMap(data)) { return data.get('isRobot') && data.get('service') === 'talkai'; } else { dev.warn("undefined data to detect talkai"); dev.trace(); return false; } };
CoffeeScript
JavaScript
jianliaoim/talk-os
talk-web/client/util/detect.coffee
MIT
2545c4497865779a55762e03963a39237df9046b
2,703
https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-web/client/util/detect.coffee
20
26
jianliaoim/talk-os:talk-web/client/util/detect.coffee:2:js_to_coffee
js_to_coffee
Convert this JavaScript to CoffeeScript. ```javascript exports.isTalkai = function(data) { if (Immutable.Map.isMap(data)) { return data.get('isRobot') && data.get('service') === 'talkai'; } else { dev.warn("undefined data to detect talkai"); dev.trace(); return false; } }; ```
exports.isTalkai = (data) -> if Immutable.Map.isMap(data) data.get('isRobot') and data.get('service') is 'talkai' else dev.warn "undefined data to detect talkai" dev.trace() false
JavaScript
CoffeeScript
jianliaoim/talk-os
talk-web/client/util/detect.coffee
MIT
2545c4497865779a55762e03963a39237df9046b
2,703
https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-web/client/util/detect.coffee
20
26
jianliaoim/talk-os:talk-web/client/util/detect.coffee:2:completion
completion
exports.isTalkai = (data) -> if Immutable.Map.isMap(data) data.get('isRobot') and data.get('service') is 'talkai'
else dev.warn "undefined data to detect talkai" dev.trace() false
CoffeeScript
CoffeeScript
jianliaoim/talk-os
talk-web/client/util/detect.coffee
MIT
2545c4497865779a55762e03963a39237df9046b
2,703
https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-web/client/util/detect.coffee
20
26
jianliaoim/talk-os:talk-web/client/util/detect.coffee:4:raw_corpus
raw_corpus
exports.isPageFocused = -> if document.hasFocus? then document.hasFocus() else true
CoffeeScript
jianliaoim/talk-os
talk-web/client/util/detect.coffee
MIT
2545c4497865779a55762e03963a39237df9046b
2,703
https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-web/client/util/detect.coffee
31
34
jianliaoim/talk-os:talk-web/client/util/detect.coffee:4:coffee_to_js
coffee_to_js
Convert this CoffeeScript to JavaScript. ```coffeescript exports.isPageFocused = -> if document.hasFocus? then document.hasFocus() else true ```
exports.isPageFocused = function() { if (document.hasFocus != null) { return document.hasFocus(); } else { return true; } };
CoffeeScript
JavaScript
jianliaoim/talk-os
talk-web/client/util/detect.coffee
MIT
2545c4497865779a55762e03963a39237df9046b
2,703
https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-web/client/util/detect.coffee
31
34
jianliaoim/talk-os:talk-web/client/util/detect.coffee:4:js_to_coffee
js_to_coffee
Convert this JavaScript to CoffeeScript. ```javascript exports.isPageFocused = function() { if (document.hasFocus != null) { return document.hasFocus(); } else { return true; } }; ```
exports.isPageFocused = -> if document.hasFocus? then document.hasFocus() else true
JavaScript
CoffeeScript
jianliaoim/talk-os
talk-web/client/util/detect.coffee
MIT
2545c4497865779a55762e03963a39237df9046b
2,703
https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-web/client/util/detect.coffee
31
34
jianliaoim/talk-os:talk-web/client/util/detect.coffee:4:completion
completion
exports.isPageFocused = -> if document.hasFocus?
then document.hasFocus() else true
CoffeeScript
CoffeeScript
jianliaoim/talk-os
talk-web/client/util/detect.coffee
MIT
2545c4497865779a55762e03963a39237df9046b
2,703
https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-web/client/util/detect.coffee
31
34
jianliaoim/talk-os:talk-web/client/util/detect.coffee:6:raw_corpus
raw_corpus
exports.userInContent = (body, _userId) -> return if not body allMembers = assemble.allMembers() msgDsl.read(body) .filter type.isObject .some (obj) -> obj.category is 'at' and (obj.model is _userId or obj.model is allMembers._id)
CoffeeScript
jianliaoim/talk-os
talk-web/client/util/detect.coffee
MIT
2545c4497865779a55762e03963a39237df9046b
2,703
https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-web/client/util/detect.coffee
39
45
jianliaoim/talk-os:talk-web/client/util/detect.coffee:6:coffee_to_js
coffee_to_js
Convert this CoffeeScript to JavaScript. ```coffeescript exports.userInContent = (body, _userId) -> return if not body allMembers = assemble.allMembers() msgDsl.read(body) .filter type.isObject .some (obj) -> obj.category is 'at' and (obj.model is _userId or obj.model is allMembers._id) ```
exports.userInContent = function(body, _userId) { var allMembers; if (!body) { return; } allMembers = assemble.allMembers(); return msgDsl.read(body).filter(type.isObject).some(function(obj) { return obj.category === 'at' && (obj.model === _userId || obj.model === allMembers._id); }); };
CoffeeScript
JavaScript
jianliaoim/talk-os
talk-web/client/util/detect.coffee
MIT
2545c4497865779a55762e03963a39237df9046b
2,703
https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-web/client/util/detect.coffee
39
45
jianliaoim/talk-os:talk-web/client/util/detect.coffee:6:js_to_coffee
js_to_coffee
Convert this JavaScript to CoffeeScript. ```javascript exports.userInContent = function(body, _userId) { var allMembers; if (!body) { return; } allMembers = assemble.allMembers(); return msgDsl.read(body).filter(type.isObject).some(function(obj) { return obj.category === 'at' && (obj.model === _userId...
exports.userInContent = (body, _userId) -> return if not body allMembers = assemble.allMembers() msgDsl.read(body) .filter type.isObject .some (obj) -> obj.category is 'at' and (obj.model is _userId or obj.model is allMembers._id)
JavaScript
CoffeeScript
jianliaoim/talk-os
talk-web/client/util/detect.coffee
MIT
2545c4497865779a55762e03963a39237df9046b
2,703
https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-web/client/util/detect.coffee
39
45
jianliaoim/talk-os:talk-web/client/util/detect.coffee:6:completion
completion
exports.userInContent = (body, _userId) -> return if not body allMembers = assemble.allMembers()
msgDsl.read(body) .filter type.isObject .some (obj) -> obj.category is 'at' and (obj.model is _userId or obj.model is allMembers._id)
CoffeeScript
CoffeeScript
jianliaoim/talk-os
talk-web/client/util/detect.coffee
MIT
2545c4497865779a55762e03963a39237df9046b
2,703
https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-web/client/util/detect.coffee
39
45
jianliaoim/talk-os:talk-web/client/util/detect.coffee:7:raw_corpus
raw_corpus
exports.imageUrlInHtml = (html) -> match = html.match(/<img.*?[\'\"](http(s)?:\/\/[\x21-\x7F\*]+)[\'\"].*?\>/i) match?[1] or undefined
CoffeeScript
jianliaoim/talk-os
talk-web/client/util/detect.coffee
MIT
2545c4497865779a55762e03963a39237df9046b
2,703
https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-web/client/util/detect.coffee
47
49
jianliaoim/talk-os:talk-web/client/util/detect.coffee:7:coffee_to_js
coffee_to_js
Convert this CoffeeScript to JavaScript. ```coffeescript exports.imageUrlInHtml = (html) -> match = html.match(/<img.*?[\'\"](http(s)?:\/\/[\x21-\x7F\*]+)[\'\"].*?\>/i) match?[1] or undefined ```
exports.imageUrlInHtml = function(html) { var match; match = html.match(/<img.*?[\'\"](http(s)?:\/\/[\x21-\x7F\*]+)[\'\"].*?\>/i); return (match != null ? match[1] : void 0) || void 0; };
CoffeeScript
JavaScript
jianliaoim/talk-os
talk-web/client/util/detect.coffee
MIT
2545c4497865779a55762e03963a39237df9046b
2,703
https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-web/client/util/detect.coffee
47
49
jianliaoim/talk-os:talk-web/client/util/detect.coffee:7:js_to_coffee
js_to_coffee
Convert this JavaScript to CoffeeScript. ```javascript exports.imageUrlInHtml = function(html) { var match; match = html.match(/<img.*?[\'\"](http(s)?:\/\/[\x21-\x7F\*]+)[\'\"].*?\>/i); return (match != null ? match[1] : void 0) || void 0; }; ```
exports.imageUrlInHtml = (html) -> match = html.match(/<img.*?[\'\"](http(s)?:\/\/[\x21-\x7F\*]+)[\'\"].*?\>/i) match?[1] or undefined
JavaScript
CoffeeScript
jianliaoim/talk-os
talk-web/client/util/detect.coffee
MIT
2545c4497865779a55762e03963a39237df9046b
2,703
https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-web/client/util/detect.coffee
47
49
jianliaoim/talk-os:talk-web/client/util/detect.coffee:8:raw_corpus
raw_corpus
exports.mentionInContent = (content) -> msgDsl.read(content) .filter (item) -> type.isObject(item) and item.category is 'at' .map (item) -> item.model
CoffeeScript
jianliaoim/talk-os
talk-web/client/util/detect.coffee
MIT
2545c4497865779a55762e03963a39237df9046b
2,703
https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-web/client/util/detect.coffee
51
54
jianliaoim/talk-os:talk-web/client/util/detect.coffee:8:coffee_to_js
coffee_to_js
Convert this CoffeeScript to JavaScript. ```coffeescript exports.mentionInContent = (content) -> msgDsl.read(content) .filter (item) -> type.isObject(item) and item.category is 'at' .map (item) -> item.model ```
exports.mentionInContent = function(content) { return msgDsl.read(content).filter(function(item) { return type.isObject(item) && item.category === 'at'; }).map(function(item) { return item.model; }); };
CoffeeScript
JavaScript
jianliaoim/talk-os
talk-web/client/util/detect.coffee
MIT
2545c4497865779a55762e03963a39237df9046b
2,703
https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-web/client/util/detect.coffee
51
54
jianliaoim/talk-os:talk-web/client/util/detect.coffee:8:js_to_coffee
js_to_coffee
Convert this JavaScript to CoffeeScript. ```javascript exports.mentionInContent = function(content) { return msgDsl.read(content).filter(function(item) { return type.isObject(item) && item.category === 'at'; }).map(function(item) { return item.model; }); }; ```
exports.mentionInContent = (content) -> msgDsl.read(content) .filter (item) -> type.isObject(item) and item.category is 'at' .map (item) -> item.model
JavaScript
CoffeeScript
jianliaoim/talk-os
talk-web/client/util/detect.coffee
MIT
2545c4497865779a55762e03963a39237df9046b
2,703
https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-web/client/util/detect.coffee
51
54
jianliaoim/talk-os:talk-web/client/util/detect.coffee:8:completion
completion
exports.mentionInContent = (content) -> msgDsl.read(content)
.filter (item) -> type.isObject(item) and item.category is 'at' .map (item) -> item.model
CoffeeScript
CoffeeScript
jianliaoim/talk-os
talk-web/client/util/detect.coffee
MIT
2545c4497865779a55762e03963a39237df9046b
2,703
https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-web/client/util/detect.coffee
51
54
jianliaoim/talk-os:talk-web/client/util/detect.coffee:9:raw_corpus
raw_corpus
exports.textWidthSmaller = (text, style, width, length) -> # length is used as a fallback solution if ctx.measureText? ctx.font = "#{style.fontSize}px #{style.fontFamily}" ctx.measureText(text).width < width else text.length < length
CoffeeScript
jianliaoim/talk-os
talk-web/client/util/detect.coffee
MIT
2545c4497865779a55762e03963a39237df9046b
2,703
https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-web/client/util/detect.coffee
56
62
jianliaoim/talk-os:talk-web/client/util/detect.coffee:9:coffee_to_js
coffee_to_js
Convert this CoffeeScript to JavaScript. ```coffeescript exports.textWidthSmaller = (text, style, width, length) -> # length is used as a fallback solution if ctx.measureText? ctx.font = "#{style.fontSize}px #{style.fontFamily}" ctx.measureText(text).width < width else text.length < length ```
exports.textWidthSmaller = function(text, style, width, length) { // length is used as a fallback solution if (ctx.measureText != null) { ctx.font = `${style.fontSize}px ${style.fontFamily}`; return ctx.measureText(text).width < width; } else { return text.length < length; } };
CoffeeScript
JavaScript
jianliaoim/talk-os
talk-web/client/util/detect.coffee
MIT
2545c4497865779a55762e03963a39237df9046b
2,703
https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-web/client/util/detect.coffee
56
62
jianliaoim/talk-os:talk-web/client/util/detect.coffee:9:js_to_coffee
js_to_coffee
Convert this JavaScript to CoffeeScript. ```javascript exports.textWidthSmaller = function(text, style, width, length) { // length is used as a fallback solution if (ctx.measureText != null) { ctx.font = `${style.fontSize}px ${style.fontFamily}`; return ctx.measureText(text).width < width; } else { re...
exports.textWidthSmaller = (text, style, width, length) -> # length is used as a fallback solution if ctx.measureText? ctx.font = "#{style.fontSize}px #{style.fontFamily}" ctx.measureText(text).width < width else text.length < length
JavaScript
CoffeeScript
jianliaoim/talk-os
talk-web/client/util/detect.coffee
MIT
2545c4497865779a55762e03963a39237df9046b
2,703
https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-web/client/util/detect.coffee
56
62
jianliaoim/talk-os:talk-web/client/util/detect.coffee:9:completion
completion
exports.textWidthSmaller = (text, style, width, length) -> # length is used as a fallback solution if ctx.measureText?
ctx.font = "#{style.fontSize}px #{style.fontFamily}" ctx.measureText(text).width < width else text.length < length
CoffeeScript
CoffeeScript
jianliaoim/talk-os
talk-web/client/util/detect.coffee
MIT
2545c4497865779a55762e03963a39237df9046b
2,703
https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-web/client/util/detect.coffee
56
62
jianliaoim/talk-os:talk-web/client/util/detect.coffee:11:raw_corpus
raw_corpus
exports.inChannel = (channel) -> return false unless channel? not channel.get 'isQuit'
CoffeeScript
jianliaoim/talk-os
talk-web/client/util/detect.coffee
MIT
2545c4497865779a55762e03963a39237df9046b
2,703
https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-web/client/util/detect.coffee
67
69
jianliaoim/talk-os:talk-web/client/util/detect.coffee:11:coffee_to_js
coffee_to_js
Convert this CoffeeScript to JavaScript. ```coffeescript exports.inChannel = (channel) -> return false unless channel? not channel.get 'isQuit' ```
exports.inChannel = function(channel) { if (channel == null) { return false; } return !channel.get('isQuit'); };
CoffeeScript
JavaScript
jianliaoim/talk-os
talk-web/client/util/detect.coffee
MIT
2545c4497865779a55762e03963a39237df9046b
2,703
https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-web/client/util/detect.coffee
67
69
jianliaoim/talk-os:talk-web/client/util/detect.coffee:11:js_to_coffee
js_to_coffee
Convert this JavaScript to CoffeeScript. ```javascript exports.inChannel = function(channel) { if (channel == null) { return false; } return !channel.get('isQuit'); }; ```
exports.inChannel = (channel) -> return false unless channel? not channel.get 'isQuit'
JavaScript
CoffeeScript
jianliaoim/talk-os
talk-web/client/util/detect.coffee
MIT
2545c4497865779a55762e03963a39237df9046b
2,703
https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-web/client/util/detect.coffee
67
69
jianliaoim/talk-os:talk-web/client/util/detect.coffee:12:raw_corpus
raw_corpus
exports.isImageWithPreview = (data) -> return false unless data? ImageTypesWithoutPreview = ['ico', 'psd'] isImage = data.get('fileCategory') is 'image' hasCertainSize = data.get('imageHeight') and data.get('imageWidth') hasPreview = data.get('fileType') not in ImageTypesWithoutPreview isImage and hasCertai...
CoffeeScript
jianliaoim/talk-os
talk-web/client/util/detect.coffee
MIT
2545c4497865779a55762e03963a39237df9046b
2,703
https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-web/client/util/detect.coffee
71
77
jianliaoim/talk-os:talk-web/client/util/detect.coffee:12:coffee_to_js
coffee_to_js
Convert this CoffeeScript to JavaScript. ```coffeescript exports.isImageWithPreview = (data) -> return false unless data? ImageTypesWithoutPreview = ['ico', 'psd'] isImage = data.get('fileCategory') is 'image' hasCertainSize = data.get('imageHeight') and data.get('imageWidth') hasPreview = data.get('fileType'...
var indexOf = [].indexOf; exports.isImageWithPreview = function(data) { var ImageTypesWithoutPreview, hasCertainSize, hasPreview, isImage, ref; if (data == null) { return false; } ImageTypesWithoutPreview = ['ico', 'psd']; isImage = data.get('fileCategory') === 'image'; hasCertainSize = data.get('image...
CoffeeScript
JavaScript
jianliaoim/talk-os
talk-web/client/util/detect.coffee
MIT
2545c4497865779a55762e03963a39237df9046b
2,703
https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-web/client/util/detect.coffee
71
77
jianliaoim/talk-os:talk-web/client/util/detect.coffee:12:js_to_coffee
js_to_coffee
Convert this JavaScript to CoffeeScript. ```javascript var indexOf = [].indexOf; exports.isImageWithPreview = function(data) { var ImageTypesWithoutPreview, hasCertainSize, hasPreview, isImage, ref; if (data == null) { return false; } ImageTypesWithoutPreview = ['ico', 'psd']; isImage = data.get('fileCat...
exports.isImageWithPreview = (data) -> return false unless data? ImageTypesWithoutPreview = ['ico', 'psd'] isImage = data.get('fileCategory') is 'image' hasCertainSize = data.get('imageHeight') and data.get('imageWidth') hasPreview = data.get('fileType') not in ImageTypesWithoutPreview isImage and hasCertai...
JavaScript
CoffeeScript
jianliaoim/talk-os
talk-web/client/util/detect.coffee
MIT
2545c4497865779a55762e03963a39237df9046b
2,703
https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-web/client/util/detect.coffee
71
77
jianliaoim/talk-os:talk-web/client/util/detect.coffee:12:completion
completion
exports.isImageWithPreview = (data) -> return false unless data? ImageTypesWithoutPreview = ['ico', 'psd']
isImage = data.get('fileCategory') is 'image' hasCertainSize = data.get('imageHeight') and data.get('imageWidth') hasPreview = data.get('fileType') not in ImageTypesWithoutPreview isImage and hasCertainSize and hasPreview and data.get('thumbnailUrl')?
CoffeeScript
CoffeeScript
jianliaoim/talk-os
talk-web/client/util/detect.coffee
MIT
2545c4497865779a55762e03963a39237df9046b
2,703
https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-web/client/util/detect.coffee
71
77
jianliaoim/talk-os:talk-web/client/util/detect.coffee:13:raw_corpus
raw_corpus
exports.isMessageFake = (message) -> return false unless message? isFake = message.get('_id').indexOf('fake') is 0 isLocal = message.get('isLocal') isFake or isLocal
CoffeeScript
jianliaoim/talk-os
talk-web/client/util/detect.coffee
MIT
2545c4497865779a55762e03963a39237df9046b
2,703
https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-web/client/util/detect.coffee
79
83
jianliaoim/talk-os:talk-web/client/util/detect.coffee:13:coffee_to_js
coffee_to_js
Convert this CoffeeScript to JavaScript. ```coffeescript exports.isMessageFake = (message) -> return false unless message? isFake = message.get('_id').indexOf('fake') is 0 isLocal = message.get('isLocal') isFake or isLocal ```
exports.isMessageFake = function(message) { var isFake, isLocal; if (message == null) { return false; } isFake = message.get('_id').indexOf('fake') === 0; isLocal = message.get('isLocal'); return isFake || isLocal; };
CoffeeScript
JavaScript
jianliaoim/talk-os
talk-web/client/util/detect.coffee
MIT
2545c4497865779a55762e03963a39237df9046b
2,703
https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-web/client/util/detect.coffee
79
83
jianliaoim/talk-os:talk-web/client/util/detect.coffee:13:js_to_coffee
js_to_coffee
Convert this JavaScript to CoffeeScript. ```javascript exports.isMessageFake = function(message) { var isFake, isLocal; if (message == null) { return false; } isFake = message.get('_id').indexOf('fake') === 0; isLocal = message.get('isLocal'); return isFake || isLocal; }; ```
exports.isMessageFake = (message) -> return false unless message? isFake = message.get('_id').indexOf('fake') is 0 isLocal = message.get('isLocal') isFake or isLocal
JavaScript
CoffeeScript
jianliaoim/talk-os
talk-web/client/util/detect.coffee
MIT
2545c4497865779a55762e03963a39237df9046b
2,703
https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-web/client/util/detect.coffee
79
83
jianliaoim/talk-os:talk-web/client/util/detect.coffee:13:completion
completion
exports.isMessageFake = (message) -> return false unless message?
isFake = message.get('_id').indexOf('fake') is 0 isLocal = message.get('isLocal') isFake or isLocal
CoffeeScript
CoffeeScript
jianliaoim/talk-os
talk-web/client/util/detect.coffee
MIT
2545c4497865779a55762e03963a39237df9046b
2,703
https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-web/client/util/detect.coffee
79
83
CaryLandholt/AngularFun:src/scripts/services/people.coffee:1:raw_corpus
raw_corpus
###global define### define ['libs/angular', 'services/services', 'libs/angularResource'], (angular, services) -> 'use strict' services.factory 'people', ['$resource', ($resource) -> people = result: [] person = result: {} activity = $resource './people', {}, get: method: 'GET' isArray: true pos...
CoffeeScript
CaryLandholt/AngularFun
src/scripts/services/people.coffee
MIT
83f11ba52970aa46e3d85f6dfad9ae495fd52e50
672
https://github.com/CaryLandholt/AngularFun/blob/83f11ba52970aa46e3d85f6dfad9ae495fd52e50/src/scripts/services/people.coffee
1
47
CaryLandholt/AngularFun:src/scripts/services/people.coffee:1:coffee_to_js
coffee_to_js
Convert this CoffeeScript to JavaScript. ```coffeescript ###global define### define ['libs/angular', 'services/services', 'libs/angularResource'], (angular, services) -> 'use strict' services.factory 'people', ['$resource', ($resource) -> people = result: [] person = result: {} activity = $resource './people...
/*global define*/ define(['libs/angular', 'services/services', 'libs/angularResource'], function(angular, services) { 'use strict'; return services.factory('people', [ '$resource', function($resource) { var activity, get, getPerson, people, person, personActivity, post; p...
CoffeeScript
JavaScript
CaryLandholt/AngularFun
src/scripts/services/people.coffee
MIT
83f11ba52970aa46e3d85f6dfad9ae495fd52e50
672
https://github.com/CaryLandholt/AngularFun/blob/83f11ba52970aa46e3d85f6dfad9ae495fd52e50/src/scripts/services/people.coffee
1
47
CaryLandholt/AngularFun:src/scripts/services/people.coffee:1:js_to_coffee
js_to_coffee
Convert this JavaScript to CoffeeScript. ```javascript /*global define*/ define(['libs/angular', 'services/services', 'libs/angularResource'], function(angular, services) { 'use strict'; return services.factory('people', [ '$resource', function($resource) { var activity, get, getPerson, pe...
###global define### define ['libs/angular', 'services/services', 'libs/angularResource'], (angular, services) -> 'use strict' services.factory 'people', ['$resource', ($resource) -> people = result: [] person = result: {} activity = $resource './people', {}, get: method: 'GET' isArray: true pos...
JavaScript
CoffeeScript
CaryLandholt/AngularFun
src/scripts/services/people.coffee
MIT
83f11ba52970aa46e3d85f6dfad9ae495fd52e50
672
https://github.com/CaryLandholt/AngularFun/blob/83f11ba52970aa46e3d85f6dfad9ae495fd52e50/src/scripts/services/people.coffee
1
47
CaryLandholt/AngularFun:src/scripts/services/people.coffee:1:completion
completion
###global define### define ['libs/angular', 'services/services', 'libs/angularResource'], (angular, services) -> 'use strict' services.factory 'people', ['$resource', ($resource) -> people = result: [] person = result: {} activity = $resource './people', {}, get: method: 'GET' isArray: true pos...
success.apply(this, arguments) if angular.isFunction success , -> failure.apply(this, arguments) if angular.isFunction failure post = (name = "Somebody else", success, failure) -> activity.post "name": name , (person) -> people.result.push person success.apply(this, arguments) if angular.isFunc...
CoffeeScript
CoffeeScript
CaryLandholt/AngularFun
src/scripts/services/people.coffee
MIT
83f11ba52970aa46e3d85f6dfad9ae495fd52e50
672
https://github.com/CaryLandholt/AngularFun/blob/83f11ba52970aa46e3d85f6dfad9ae495fd52e50/src/scripts/services/people.coffee
1
47
oozcitak/xmlbuilder-js:test/basic/multipleinstances.coffee:1:raw_corpus
raw_corpus
suite 'Creating XML:', -> test 'Multiple Instances', -> xml1 = xml('first').ele('node1', { 'testatt1': 'testattval1' }, 'text1') eq( xml1.end() '<?xml version="1.0"?><first><node1 testatt1="testattval1">text1</node1></first>' ) xml2 = xml('second').ele('node2', { 'testatt2': 'testattval2...
CoffeeScript
oozcitak/xmlbuilder-js
test/basic/multipleinstances.coffee
MIT
ce625aeb9f52d1f75d5d94260794d3b5fd74a8b1
926
https://github.com/oozcitak/xmlbuilder-js/blob/ce625aeb9f52d1f75d5d94260794d3b5fd74a8b1/test/basic/multipleinstances.coffee
1
20
oozcitak/xmlbuilder-js:test/basic/multipleinstances.coffee:1:coffee_to_js
coffee_to_js
Convert this CoffeeScript to JavaScript. ```coffeescript suite 'Creating XML:', -> test 'Multiple Instances', -> xml1 = xml('first').ele('node1', { 'testatt1': 'testattval1' }, 'text1') eq( xml1.end() '<?xml version="1.0"?><first><node1 testatt1="testattval1">text1</node1></first>' ) xml...
suite('Creating XML:', function() { return test('Multiple Instances', function() { var xml1, xml2; xml1 = xml('first').ele('node1', { 'testatt1': 'testattval1' }, 'text1'); eq(xml1.end(), '<?xml version="1.0"?><first><node1 testatt1="testattval1">text1</node1></first>'); xml2 = xml('second')...
CoffeeScript
JavaScript
oozcitak/xmlbuilder-js
test/basic/multipleinstances.coffee
MIT
ce625aeb9f52d1f75d5d94260794d3b5fd74a8b1
926
https://github.com/oozcitak/xmlbuilder-js/blob/ce625aeb9f52d1f75d5d94260794d3b5fd74a8b1/test/basic/multipleinstances.coffee
1
20
oozcitak/xmlbuilder-js:test/basic/multipleinstances.coffee:1:js_to_coffee
js_to_coffee
Convert this JavaScript to CoffeeScript. ```javascript suite('Creating XML:', function() { return test('Multiple Instances', function() { var xml1, xml2; xml1 = xml('first').ele('node1', { 'testatt1': 'testattval1' }, 'text1'); eq(xml1.end(), '<?xml version="1.0"?><first><node1 testatt1="testatt...
suite 'Creating XML:', -> test 'Multiple Instances', -> xml1 = xml('first').ele('node1', { 'testatt1': 'testattval1' }, 'text1') eq( xml1.end() '<?xml version="1.0"?><first><node1 testatt1="testattval1">text1</node1></first>' ) xml2 = xml('second').ele('node2', { 'testatt2': 'testattval2...
JavaScript
CoffeeScript
oozcitak/xmlbuilder-js
test/basic/multipleinstances.coffee
MIT
ce625aeb9f52d1f75d5d94260794d3b5fd74a8b1
926
https://github.com/oozcitak/xmlbuilder-js/blob/ce625aeb9f52d1f75d5d94260794d3b5fd74a8b1/test/basic/multipleinstances.coffee
1
20
oozcitak/xmlbuilder-js:test/basic/multipleinstances.coffee:1:completion
completion
suite 'Creating XML:', -> test 'Multiple Instances', -> xml1 = xml('first').ele('node1', { 'testatt1': 'testattval1' }, 'text1') eq( xml1.end() '<?xml version="1.0"?><first><node1 testatt1="testattval1">text1</node1></first>' ) xml2 = xml('second').ele('node2', { 'testatt2': 'testattval2...
eq( xml2.end() '<?xml version="1.0"?><second><node2 testatt2="testattval2">text2</node2></second>' ) # First instance should remain unchanged eq( xml1.end() '<?xml version="1.0"?><first><node1 testatt1="testattval1">text1</node1></first>' )
CoffeeScript
CoffeeScript
oozcitak/xmlbuilder-js
test/basic/multipleinstances.coffee
MIT
ce625aeb9f52d1f75d5d94260794d3b5fd74a8b1
926
https://github.com/oozcitak/xmlbuilder-js/blob/ce625aeb9f52d1f75d5d94260794d3b5fd74a8b1/test/basic/multipleinstances.coffee
1
20
jianliaoim/talk-os:talk-web/client/app/panel-room.coffee:1:raw_corpus
raw_corpus
module.exports = React.createClass displayName: 'panel-room' propTypes: _teamId: T.string.isRequired rooms: T.instanceOf(Immutable.List).isRequired archivedRooms: T.instanceOf(Immutable.List).isRequired onClose: T.func getDefaultProps: -> invitations: Immutable.List() getInitialState: -> ...
CoffeeScript
jianliaoim/talk-os
talk-web/client/app/panel-room.coffee
MIT
2545c4497865779a55762e03963a39237df9046b
2,703
https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-web/client/app/panel-room.coffee
28
77
jianliaoim/talk-os:talk-web/client/app/panel-room.coffee:1:coffee_to_js
coffee_to_js
Convert this CoffeeScript to JavaScript. ```coffeescript module.exports = React.createClass displayName: 'panel-room' propTypes: _teamId: T.string.isRequired rooms: T.instanceOf(Immutable.List).isRequired archivedRooms: T.instanceOf(Immutable.List).isRequired onClose: T.func getDefaultProps: -> ...
module.exports = React.createClass({ displayName: 'panel-room', propTypes: { _teamId: T.string.isRequired, rooms: T.instanceOf(Immutable.List).isRequired, archivedRooms: T.instanceOf(Immutable.List).isRequired, onClose: T.func }, getDefaultProps: function() { return { invitations: Immu...
CoffeeScript
JavaScript
jianliaoim/talk-os
talk-web/client/app/panel-room.coffee
MIT
2545c4497865779a55762e03963a39237df9046b
2,703
https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-web/client/app/panel-room.coffee
28
77
jianliaoim/talk-os:talk-web/client/app/panel-room.coffee:1:js_to_coffee
js_to_coffee
Convert this JavaScript to CoffeeScript. ```javascript module.exports = React.createClass({ displayName: 'panel-room', propTypes: { _teamId: T.string.isRequired, rooms: T.instanceOf(Immutable.List).isRequired, archivedRooms: T.instanceOf(Immutable.List).isRequired, onClose: T.func }, getDefaultP...
module.exports = React.createClass displayName: 'panel-room' propTypes: _teamId: T.string.isRequired rooms: T.instanceOf(Immutable.List).isRequired archivedRooms: T.instanceOf(Immutable.List).isRequired onClose: T.func getDefaultProps: -> invitations: Immutable.List() getInitialState: -> ...
JavaScript
CoffeeScript
jianliaoim/talk-os
talk-web/client/app/panel-room.coffee
MIT
2545c4497865779a55762e03963a39237df9046b
2,703
https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-web/client/app/panel-room.coffee
28
77
jianliaoim/talk-os:talk-web/client/app/panel-room.coffee:1:completion
completion
module.exports = React.createClass displayName: 'panel-room' propTypes: _teamId: T.string.isRequired rooms: T.instanceOf(Immutable.List).isRequired archivedRooms: T.instanceOf(Immutable.List).isRequired onClose: T.func getDefaultProps: -> invitations: Immutable.List() getInitialState: -> ...
@setState showCreate: false onAddClick: -> @setState showForm: (not @state.showForm) onChange: (value) -> @setState { value } onItemClick: (room) -> analytics.enterRoom() routerHandlers.room @props._teamId, room.get('_id'), {}, @props.onClose onTopicSave: (data, successCB, errorCB) -> da...
CoffeeScript
CoffeeScript
jianliaoim/talk-os
talk-web/client/app/panel-room.coffee
MIT
2545c4497865779a55762e03963a39237df9046b
2,703
https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-web/client/app/panel-room.coffee
28
77
jianliaoim/talk-os:talk-web/client/app/panel-room.coffee:2:raw_corpus
raw_corpus
value: @state.value onChange: @onChange locale: lang.getText('search-topics') autoFocus: not detect.isIPad() span className: 'muted or flex-static', lang.getText('or') button className: 'button flex-static', onClick: @onCreateShow,lang.getText('create-a-topic') getJoinedRooms: -> ...
CoffeeScript
jianliaoim/talk-os
talk-web/client/app/panel-room.coffee
MIT
2545c4497865779a55762e03963a39237df9046b
2,703
https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-web/client/app/panel-room.coffee
78
127
jianliaoim/talk-os:talk-web/client/app/panel-room.coffee:2:coffee_to_js
coffee_to_js
Convert this CoffeeScript to JavaScript. ```coffeescript value: @state.value onChange: @onChange locale: lang.getText('search-topics') autoFocus: not detect.isIPad() span className: 'muted or flex-static', lang.getText('or') button className: 'button flex-static', onClick: @onCreateS...
({ value: this.state.value({ onChange: this.onChange, locale: lang.getText('search-topics'), autoFocus: !detect.isIPad() }) }); span({ className: 'muted or flex-static' }, lang.getText('or')); button({ className: 'button flex-static', onClick: this.onCreateShow }, lang.getText('create-a-topic'))...
CoffeeScript
JavaScript
jianliaoim/talk-os
talk-web/client/app/panel-room.coffee
MIT
2545c4497865779a55762e03963a39237df9046b
2,703
https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-web/client/app/panel-room.coffee
78
127
jianliaoim/talk-os:talk-web/client/app/panel-room.coffee:2:js_to_coffee
js_to_coffee
Convert this JavaScript to CoffeeScript. ```javascript ({ value: this.state.value({ onChange: this.onChange, locale: lang.getText('search-topics'), autoFocus: !detect.isIPad() }) }); span({ className: 'muted or flex-static' }, lang.getText('or')); button({ className: 'button flex-static', onClic...
value: @state.value onChange: @onChange locale: lang.getText('search-topics') autoFocus: not detect.isIPad() span className: 'muted or flex-static', lang.getText('or') button className: 'button flex-static', onClick: @onCreateShow,lang.getText('create-a-topic') getJoinedRooms: -> ...
JavaScript
CoffeeScript
jianliaoim/talk-os
talk-web/client/app/panel-room.coffee
MIT
2545c4497865779a55762e03963a39237df9046b
2,703
https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-web/client/app/panel-room.coffee
78
127
jianliaoim/talk-os:talk-web/client/app/panel-room.coffee:2:completion
completion
value: @state.value onChange: @onChange locale: lang.getText('search-topics') autoFocus: not detect.isIPad() span className: 'muted or flex-static', lang.getText('or') button className: 'button flex-static', onClick: @onCreateShow,lang.getText('create-a-topic') getJoinedRooms: -> ...
if filteredList.size > 0 div className: 'item-list room-list', p className: 'info muted', info.replace('{{num}}', filteredList.size) filteredList.map (room) => onItemClick = => @onItemClick room RoomItem key: room.get('_id') _teamId: @props....
CoffeeScript
CoffeeScript
jianliaoim/talk-os
talk-web/client/app/panel-room.coffee
MIT
2545c4497865779a55762e03963a39237df9046b
2,703
https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-web/client/app/panel-room.coffee
78
127
jianliaoim/talk-os:talk-web/client/app/panel-room.coffee:3:raw_corpus
raw_corpus
saveConfigs: @onTopicSave render: -> div className: 'panel-chat panel-room', @renderHeader() @renderRooms('joined') @renderRooms() @renderRooms('archived') @renderCreate()
CoffeeScript
jianliaoim/talk-os
talk-web/client/app/panel-room.coffee
MIT
2545c4497865779a55762e03963a39237df9046b
2,703
https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-web/client/app/panel-room.coffee
128
136
jianliaoim/talk-os:talk-web/client/app/panel-room.coffee:3:coffee_to_js
coffee_to_js
Convert this CoffeeScript to JavaScript. ```coffeescript saveConfigs: @onTopicSave render: -> div className: 'panel-chat panel-room', @renderHeader() @renderRooms('joined') @renderRooms() @renderRooms('archived') @renderCreate() ```
({ saveConfigs: this.onTopicSave({ render: function() { return div({ className: 'panel-chat panel-room' }, this.renderHeader(), this.renderRooms('joined'), this.renderRooms(), this.renderRooms('archived'), this.renderCreate()); } }) });
CoffeeScript
JavaScript
jianliaoim/talk-os
talk-web/client/app/panel-room.coffee
MIT
2545c4497865779a55762e03963a39237df9046b
2,703
https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-web/client/app/panel-room.coffee
128
136
jianliaoim/talk-os:talk-web/client/app/panel-room.coffee:3:js_to_coffee
js_to_coffee
Convert this JavaScript to CoffeeScript. ```javascript ({ saveConfigs: this.onTopicSave({ render: function() { return div({ className: 'panel-chat panel-room' }, this.renderHeader(), this.renderRooms('joined'), this.renderRooms(), this.renderRooms('archived'), this.renderCreate()); } }) ...
saveConfigs: @onTopicSave render: -> div className: 'panel-chat panel-room', @renderHeader() @renderRooms('joined') @renderRooms() @renderRooms('archived') @renderCreate()
JavaScript
CoffeeScript
jianliaoim/talk-os
talk-web/client/app/panel-room.coffee
MIT
2545c4497865779a55762e03963a39237df9046b
2,703
https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-web/client/app/panel-room.coffee
128
136
jianliaoim/talk-os:talk-web/client/app/panel-room.coffee:3:completion
completion
saveConfigs: @onTopicSave render: -> div className: 'panel-chat panel-room',
@renderHeader() @renderRooms('joined') @renderRooms() @renderRooms('archived') @renderCreate()
CoffeeScript
CoffeeScript
jianliaoim/talk-os
talk-web/client/app/panel-room.coffee
MIT
2545c4497865779a55762e03963a39237df9046b
2,703
https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-web/client/app/panel-room.coffee
128
136
js2coffee/js2coffee:lib/transforms/blocks.coffee:1:raw_corpus
raw_corpus
TransformerBase = require('./base') ### # Flattens nested `BlockStatements`. ### module.exports = class BlockTransforms extends TransformerBase BlockStatement: (node, parent) -> @consolidateBlockIntoParent(node, parent) ### # Melds a block into a parent's body ### consolidateBlockIntoParent: (node, pa...
CoffeeScript
js2coffee/js2coffee
lib/transforms/blocks.coffee
MIT
47d3159aba94ffd4377138f7837717d8628eef9f
2,082
https://github.com/js2coffee/js2coffee/blob/47d3159aba94ffd4377138f7837717d8628eef9f/lib/transforms/blocks.coffee
1
31
js2coffee/js2coffee:lib/transforms/blocks.coffee:1:coffee_to_js
coffee_to_js
Convert this CoffeeScript to JavaScript. ```coffeescript TransformerBase = require('./base') ### # Flattens nested `BlockStatements`. ### module.exports = class BlockTransforms extends TransformerBase BlockStatement: (node, parent) -> @consolidateBlockIntoParent(node, parent) ### # Melds a block into a par...
var BlockTransforms, TransformerBase; TransformerBase = require('./base'); /* * Flattens nested `BlockStatements`. */ module.exports = BlockTransforms = class BlockTransforms extends TransformerBase { BlockStatement(node, parent) { return this.consolidateBlockIntoParent(node, parent); } /* * Melds a b...
CoffeeScript
JavaScript
js2coffee/js2coffee
lib/transforms/blocks.coffee
MIT
47d3159aba94ffd4377138f7837717d8628eef9f
2,082
https://github.com/js2coffee/js2coffee/blob/47d3159aba94ffd4377138f7837717d8628eef9f/lib/transforms/blocks.coffee
1
31
js2coffee/js2coffee:lib/transforms/blocks.coffee:1:js_to_coffee
js_to_coffee
Convert this JavaScript to CoffeeScript. ```javascript var BlockTransforms, TransformerBase; TransformerBase = require('./base'); /* * Flattens nested `BlockStatements`. */ module.exports = BlockTransforms = class BlockTransforms extends TransformerBase { BlockStatement(node, parent) { return this.consolidate...
TransformerBase = require('./base') ### # Flattens nested `BlockStatements`. ### module.exports = class BlockTransforms extends TransformerBase BlockStatement: (node, parent) -> @consolidateBlockIntoParent(node, parent) ### # Melds a block into a parent's body ### consolidateBlockIntoParent: (node, pa...
JavaScript
CoffeeScript
js2coffee/js2coffee
lib/transforms/blocks.coffee
MIT
47d3159aba94ffd4377138f7837717d8628eef9f
2,082
https://github.com/js2coffee/js2coffee/blob/47d3159aba94ffd4377138f7837717d8628eef9f/lib/transforms/blocks.coffee
1
31
js2coffee/js2coffee:lib/transforms/blocks.coffee:1:completion
completion
TransformerBase = require('./base') ### # Flattens nested `BlockStatements`. ### module.exports = class BlockTransforms extends TransformerBase BlockStatement: (node, parent) -> @consolidateBlockIntoParent(node, parent) ### # Melds a block into a parent's body ###
consolidateBlockIntoParent: (node, parent) -> skipped = false consolidateIf = (type, body) => if parent.type is type and parent[body]?.indexOf idx = parent[body].indexOf(node) if parent[body] and ~idx parent[body].splice idx, 1, node.body... skipped = true tru...
CoffeeScript
CoffeeScript
js2coffee/js2coffee
lib/transforms/blocks.coffee
MIT
47d3159aba94ffd4377138f7837717d8628eef9f
2,082
https://github.com/js2coffee/js2coffee/blob/47d3159aba94ffd4377138f7837717d8628eef9f/lib/transforms/blocks.coffee
1
31
js2coffee/js2coffee:lib/transforms/blocks.coffee:1:raw_corpus
raw_corpus
TransformerBase = require('./base') ### # Flattens nested `BlockStatements`. ### module.exports = class BlockTransforms extends TransformerBase BlockStatement: (node, parent) -> if parent.type is 'BlockStatement' parent.body.splice parent.body.indexOf(node), 1, node.body... return
CoffeeScript
js2coffee/js2coffee
lib/transforms/blocks.coffee
MIT
aeaa3cbb7c6c0f43c9bfc3f62b7eea4a0c1acfe4
2,082
https://github.com/js2coffee/js2coffee/blob/aeaa3cbb7c6c0f43c9bfc3f62b7eea4a0c1acfe4/lib/transforms/blocks.coffee
1
12
js2coffee/js2coffee:lib/transforms/blocks.coffee:1:coffee_to_js
coffee_to_js
Convert this CoffeeScript to JavaScript. ```coffeescript TransformerBase = require('./base') ### # Flattens nested `BlockStatements`. ### module.exports = class BlockTransforms extends TransformerBase BlockStatement: (node, parent) -> if parent.type is 'BlockStatement' parent.body.splice parent.body.index...
var BlockTransforms, TransformerBase; TransformerBase = require('./base'); /* * Flattens nested `BlockStatements`. */ module.exports = BlockTransforms = class BlockTransforms extends TransformerBase { BlockStatement(node, parent) { if (parent.type === 'BlockStatement') { parent.body.splice(parent.body.i...
CoffeeScript
JavaScript
js2coffee/js2coffee
lib/transforms/blocks.coffee
MIT
aeaa3cbb7c6c0f43c9bfc3f62b7eea4a0c1acfe4
2,082
https://github.com/js2coffee/js2coffee/blob/aeaa3cbb7c6c0f43c9bfc3f62b7eea4a0c1acfe4/lib/transforms/blocks.coffee
1
12
js2coffee/js2coffee:lib/transforms/blocks.coffee:1:js_to_coffee
js_to_coffee
Convert this JavaScript to CoffeeScript. ```javascript var BlockTransforms, TransformerBase; TransformerBase = require('./base'); /* * Flattens nested `BlockStatements`. */ module.exports = BlockTransforms = class BlockTransforms extends TransformerBase { BlockStatement(node, parent) { if (parent.type === 'Bl...
TransformerBase = require('./base') ### # Flattens nested `BlockStatements`. ### module.exports = class BlockTransforms extends TransformerBase BlockStatement: (node, parent) -> if parent.type is 'BlockStatement' parent.body.splice parent.body.indexOf(node), 1, node.body... return
JavaScript
CoffeeScript
js2coffee/js2coffee
lib/transforms/blocks.coffee
MIT
aeaa3cbb7c6c0f43c9bfc3f62b7eea4a0c1acfe4
2,082
https://github.com/js2coffee/js2coffee/blob/aeaa3cbb7c6c0f43c9bfc3f62b7eea4a0c1acfe4/lib/transforms/blocks.coffee
1
12
js2coffee/js2coffee:lib/transforms/blocks.coffee:1:completion
completion
TransformerBase = require('./base') ### # Flattens nested `BlockStatements`. ###
module.exports = class BlockTransforms extends TransformerBase BlockStatement: (node, parent) -> if parent.type is 'BlockStatement' parent.body.splice parent.body.indexOf(node), 1, node.body... return
CoffeeScript
CoffeeScript
js2coffee/js2coffee
lib/transforms/blocks.coffee
MIT
aeaa3cbb7c6c0f43c9bfc3f62b7eea4a0c1acfe4
2,082
https://github.com/js2coffee/js2coffee/blob/aeaa3cbb7c6c0f43c9bfc3f62b7eea4a0c1acfe4/lib/transforms/blocks.coffee
1
12
dropbox/zxcvbn:test/test-matching.coffee:1:raw_corpus
raw_corpus
genpws = (pattern, prefixes, suffixes) -> prefixes = prefixes.slice() suffixes = suffixes.slice() for lst in [prefixes, suffixes] lst.unshift '' if '' not in lst result = [] for prefix in prefixes for suffix in suffixes [i, j] = [prefix.length, prefix.length + pattern.length - 1] result.pu...
CoffeeScript
dropbox/zxcvbn
test/test-matching.coffee
MIT
f07ee0f098dcc50c86fa24def70aa5fc4c19f1e6
15,961
https://github.com/dropbox/zxcvbn/blob/f07ee0f098dcc50c86fa24def70aa5fc4c19f1e6/test/test-matching.coffee
8
18
dropbox/zxcvbn:test/test-matching.coffee:1:coffee_to_js
coffee_to_js
Convert this CoffeeScript to JavaScript. ```coffeescript genpws = (pattern, prefixes, suffixes) -> prefixes = prefixes.slice() suffixes = suffixes.slice() for lst in [prefixes, suffixes] lst.unshift '' if '' not in lst result = [] for prefix in prefixes for suffix in suffixes [i, j] = [prefix.le...
var genpws, indexOf = [].indexOf; genpws = function(pattern, prefixes, suffixes) { var i, j, k, l, len, len1, len2, lst, m, prefix, ref, result, suffix; prefixes = prefixes.slice(); suffixes = suffixes.slice(); ref = [prefixes, suffixes]; for (k = 0, len = ref.length; k < len; k++) { lst = ref[k]; ...
CoffeeScript
JavaScript
dropbox/zxcvbn
test/test-matching.coffee
MIT
f07ee0f098dcc50c86fa24def70aa5fc4c19f1e6
15,961
https://github.com/dropbox/zxcvbn/blob/f07ee0f098dcc50c86fa24def70aa5fc4c19f1e6/test/test-matching.coffee
8
18
dropbox/zxcvbn:test/test-matching.coffee:1:js_to_coffee
js_to_coffee
Convert this JavaScript to CoffeeScript. ```javascript var genpws, indexOf = [].indexOf; genpws = function(pattern, prefixes, suffixes) { var i, j, k, l, len, len1, len2, lst, m, prefix, ref, result, suffix; prefixes = prefixes.slice(); suffixes = suffixes.slice(); ref = [prefixes, suffixes]; for (k = 0, l...
genpws = (pattern, prefixes, suffixes) -> prefixes = prefixes.slice() suffixes = suffixes.slice() for lst in [prefixes, suffixes] lst.unshift '' if '' not in lst result = [] for prefix in prefixes for suffix in suffixes [i, j] = [prefix.length, prefix.length + pattern.length - 1] result.pu...
JavaScript
CoffeeScript
dropbox/zxcvbn
test/test-matching.coffee
MIT
f07ee0f098dcc50c86fa24def70aa5fc4c19f1e6
15,961
https://github.com/dropbox/zxcvbn/blob/f07ee0f098dcc50c86fa24def70aa5fc4c19f1e6/test/test-matching.coffee
8
18
dropbox/zxcvbn:test/test-matching.coffee:1:completion
completion
genpws = (pattern, prefixes, suffixes) -> prefixes = prefixes.slice() suffixes = suffixes.slice() for lst in [prefixes, suffixes] lst.unshift '' if '' not in lst
result = [] for prefix in prefixes for suffix in suffixes [i, j] = [prefix.length, prefix.length + pattern.length - 1] result.push [prefix + pattern + suffix, i, j] result
CoffeeScript
CoffeeScript
dropbox/zxcvbn
test/test-matching.coffee
MIT
f07ee0f098dcc50c86fa24def70aa5fc4c19f1e6
15,961
https://github.com/dropbox/zxcvbn/blob/f07ee0f098dcc50c86fa24def70aa5fc4c19f1e6/test/test-matching.coffee
8
18
dropbox/zxcvbn:test/test-matching.coffee:2:raw_corpus
raw_corpus
check_matches = (t, matches, pattern_names, patterns, ijs, props) -> if typeof pattern_names is "string" # shortcut: if checking for a list of the same type of patterns, # allow passing a string 'pat' instead of array ['pat', 'pat', ...] pattern_names = (pattern_names for i in [0...patterns.length]) is...
CoffeeScript
dropbox/zxcvbn
test/test-matching.coffee
MIT
f07ee0f098dcc50c86fa24def70aa5fc4c19f1e6
15,961
https://github.com/dropbox/zxcvbn/blob/f07ee0f098dcc50c86fa24def70aa5fc4c19f1e6/test/test-matching.coffee
20
69