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
meltingice/psd.js:lib/psd/resources/layer_comps.coffee:1:raw_corpus
raw_corpus
Descriptor = require '../descriptor.coffee' module.exports = class LayerComps id: 1065 name: 'layerComps' @visibilityCaptured: (comp) -> comp.capturedInfo & parseInt('001', 2) > 0 @positionCaptured: (comp) -> comp.positionCaptured & parseInt('010', 2) > 0 @appearanceCaptured: (comp) -> comp.ap...
CoffeeScript
meltingice/psd.js
lib/psd/resources/layer_comps.coffee
MIT
7e8392d20fd5d66ad70ddda7309661b9a0ca67c8
2,846
https://github.com/meltingice/psd.js/blob/7e8392d20fd5d66ad70ddda7309661b9a0ca67c8/lib/psd/resources/layer_comps.coffee
1
28
meltingice/psd.js:lib/psd/resources/layer_comps.coffee:1:coffee_to_js
coffee_to_js
Convert this CoffeeScript to JavaScript. ```coffeescript Descriptor = require '../descriptor.coffee' module.exports = class LayerComps id: 1065 name: 'layerComps' @visibilityCaptured: (comp) -> comp.capturedInfo & parseInt('001', 2) > 0 @positionCaptured: (comp) -> comp.positionCaptured & parseInt('0...
var Descriptor, LayerComps; Descriptor = require('../descriptor.coffee'); module.exports = LayerComps = (function() { class LayerComps { static visibilityCaptured(comp) { return comp.capturedInfo & parseInt('001', 2) > 0; } static positionCaptured(comp) { return comp.positionCaptured & pars...
CoffeeScript
JavaScript
meltingice/psd.js
lib/psd/resources/layer_comps.coffee
MIT
7e8392d20fd5d66ad70ddda7309661b9a0ca67c8
2,846
https://github.com/meltingice/psd.js/blob/7e8392d20fd5d66ad70ddda7309661b9a0ca67c8/lib/psd/resources/layer_comps.coffee
1
28
meltingice/psd.js:lib/psd/resources/layer_comps.coffee:1:js_to_coffee
js_to_coffee
Convert this JavaScript to CoffeeScript. ```javascript var Descriptor, LayerComps; Descriptor = require('../descriptor.coffee'); module.exports = LayerComps = (function() { class LayerComps { static visibilityCaptured(comp) { return comp.capturedInfo & parseInt('001', 2) > 0; } static positionCap...
Descriptor = require '../descriptor.coffee' module.exports = class LayerComps id: 1065 name: 'layerComps' @visibilityCaptured: (comp) -> comp.capturedInfo & parseInt('001', 2) > 0 @positionCaptured: (comp) -> comp.positionCaptured & parseInt('010', 2) > 0 @appearanceCaptured: (comp) -> comp.ap...
JavaScript
CoffeeScript
meltingice/psd.js
lib/psd/resources/layer_comps.coffee
MIT
7e8392d20fd5d66ad70ddda7309661b9a0ca67c8
2,846
https://github.com/meltingice/psd.js/blob/7e8392d20fd5d66ad70ddda7309661b9a0ca67c8/lib/psd/resources/layer_comps.coffee
1
28
meltingice/psd.js:lib/psd/resources/layer_comps.coffee:1:completion
completion
Descriptor = require '../descriptor.coffee' module.exports = class LayerComps id: 1065 name: 'layerComps' @visibilityCaptured: (comp) -> comp.capturedInfo & parseInt('001', 2) > 0 @positionCaptured: (comp) -> comp.positionCaptured & parseInt('010', 2) > 0 @appearanceCaptured: (comp) -> comp.ap...
constructor: (@resource) -> @file = @resource.file parse: -> @file.seek 4, true @data = new Descriptor(@file).parse() names: -> @data.list.map (comp) -> comp['Nm '] export: -> @data.list.map (comp) -> id: comp.compID name: comp['Nm '] capturedInfo: comp.capturedInfo
CoffeeScript
CoffeeScript
meltingice/psd.js
lib/psd/resources/layer_comps.coffee
MIT
7e8392d20fd5d66ad70ddda7309661b9a0ca67c8
2,846
https://github.com/meltingice/psd.js/blob/7e8392d20fd5d66ad70ddda7309661b9a0ca67c8/lib/psd/resources/layer_comps.coffee
1
28
jianliaoim/talk-os:talk-api2x/test/services/talkai.coffee:1:raw_corpus
raw_corpus
should = require 'should' Promise = require 'bluebird' limbo = require 'limbo' serviceLoader = require 'talk-services' app = require '../app' {prepare, cleanup, request, requestAsync} = app { PreferenceModel } = limbo.use 'talk' describe 'Service#Talkai', -> before prepare it 'should send message to talkai',...
CoffeeScript
jianliaoim/talk-os
talk-api2x/test/services/talkai.coffee
MIT
2545c4497865779a55762e03963a39237df9046b
2,703
https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-api2x/test/services/talkai.coffee
1
50
jianliaoim/talk-os:talk-api2x/test/services/talkai.coffee:1:coffee_to_js
coffee_to_js
Convert this CoffeeScript to JavaScript. ```coffeescript should = require 'should' Promise = require 'bluebird' limbo = require 'limbo' serviceLoader = require 'talk-services' app = require '../app' {prepare, cleanup, request, requestAsync} = app { PreferenceModel } = limbo.use 'talk' describe 'Service#Talkai', ->...
var PreferenceModel, Promise, app, cleanup, limbo, prepare, request, requestAsync, serviceLoader, should; should = require('should'); Promise = require('bluebird'); limbo = require('limbo'); serviceLoader = require('talk-services'); app = require('../app'); ({prepare, cleanup, request, requestAsync} = app); ({Pr...
CoffeeScript
JavaScript
jianliaoim/talk-os
talk-api2x/test/services/talkai.coffee
MIT
2545c4497865779a55762e03963a39237df9046b
2,703
https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-api2x/test/services/talkai.coffee
1
50
jianliaoim/talk-os:talk-api2x/test/services/talkai.coffee:1:js_to_coffee
js_to_coffee
Convert this JavaScript to CoffeeScript. ```javascript var PreferenceModel, Promise, app, cleanup, limbo, prepare, request, requestAsync, serviceLoader, should; should = require('should'); Promise = require('bluebird'); limbo = require('limbo'); serviceLoader = require('talk-services'); app = require('../app'); (...
should = require 'should' Promise = require 'bluebird' limbo = require 'limbo' serviceLoader = require 'talk-services' app = require '../app' {prepare, cleanup, request, requestAsync} = app { PreferenceModel } = limbo.use 'talk' describe 'Service#Talkai', -> before prepare it 'should send message to talkai',...
JavaScript
CoffeeScript
jianliaoim/talk-os
talk-api2x/test/services/talkai.coffee
MIT
2545c4497865779a55762e03963a39237df9046b
2,703
https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-api2x/test/services/talkai.coffee
1
50
jianliaoim/talk-os:talk-api2x/test/services/talkai.coffee:1:completion
completion
should = require 'should' Promise = require 'bluebird' limbo = require 'limbo' serviceLoader = require 'talk-services' app = require '../app' {prepare, cleanup, request, requestAsync} = app { PreferenceModel } = limbo.use 'talk' describe 'Service#Talkai', -> before prepare it 'should send message to talkai',...
preference.$save() $broadcast = $service.then (service) -> new Promise (resolve, reject) -> hits = 0 app.broadcast = (channel, event, data) -> try if event is 'message:create' and "#{data._creatorId}" is "#{service.robot._id}" hits |= 0b1 data...
CoffeeScript
CoffeeScript
jianliaoim/talk-os
talk-api2x/test/services/talkai.coffee
MIT
2545c4497865779a55762e03963a39237df9046b
2,703
https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-api2x/test/services/talkai.coffee
1
50
Pagedraw/pagedraw:sketch-importer/importer-server.coffee:1:raw_corpus
raw_corpus
upload_to_s3 = (filename, data, content_type, callback) -> s3.upload {Bucket: S3_BUCKET, Key: filename, Body: data, ContentType: content_type}, (err, data) -> callback(err, data) ## Express setup app = express() app.set('port', process.env.PORT || 2083) app.set('host', process.env.host || 'localhost') # E...
CoffeeScript
Pagedraw/pagedraw
sketch-importer/importer-server.coffee
MIT
aba1bd1b8ef6bb7f58866a9d11ebb7f1e0e18a8e
3,558
https://github.com/Pagedraw/pagedraw/blob/aba1bd1b8ef6bb7f58866a9d11ebb7f1e0e18a8e/sketch-importer/importer-server.coffee
24
73
Pagedraw/pagedraw:sketch-importer/importer-server.coffee:1:coffee_to_js
coffee_to_js
Convert this CoffeeScript to JavaScript. ```coffeescript upload_to_s3 = (filename, data, content_type, callback) -> s3.upload {Bucket: S3_BUCKET, Key: filename, Body: data, ContentType: content_type}, (err, data) -> callback(err, data) ## Express setup app = express() app.set('port', process.env.PORT || 20...
var MAX_SKETCH_SIZE, app, temp_dir, upload, upload_to_s3; upload_to_s3 = function(filename, data, content_type, callback) { return s3.upload({ Bucket: S3_BUCKET, Key: filename, Body: data, ContentType: content_type }, function(err, data) { return callback(err, data); }); }; //# Express setup...
CoffeeScript
JavaScript
Pagedraw/pagedraw
sketch-importer/importer-server.coffee
MIT
aba1bd1b8ef6bb7f58866a9d11ebb7f1e0e18a8e
3,558
https://github.com/Pagedraw/pagedraw/blob/aba1bd1b8ef6bb7f58866a9d11ebb7f1e0e18a8e/sketch-importer/importer-server.coffee
24
73
Pagedraw/pagedraw:sketch-importer/importer-server.coffee:1:js_to_coffee
js_to_coffee
Convert this JavaScript to CoffeeScript. ```javascript var MAX_SKETCH_SIZE, app, temp_dir, upload, upload_to_s3; upload_to_s3 = function(filename, data, content_type, callback) { return s3.upload({ Bucket: S3_BUCKET, Key: filename, Body: data, ContentType: content_type }, function(err, data) { ...
upload_to_s3 = (filename, data, content_type, callback) -> s3.upload {Bucket: S3_BUCKET, Key: filename, Body: data, ContentType: content_type}, (err, data) -> callback(err, data) ## Express setup app = express() app.set('port', process.env.PORT || 2083) app.set('host', process.env.host || 'localhost') # E...
JavaScript
CoffeeScript
Pagedraw/pagedraw
sketch-importer/importer-server.coffee
MIT
aba1bd1b8ef6bb7f58866a9d11ebb7f1e0e18a8e
3,558
https://github.com/Pagedraw/pagedraw/blob/aba1bd1b8ef6bb7f58866a9d11ebb7f1e0e18a8e/sketch-importer/importer-server.coffee
24
73
Pagedraw/pagedraw:sketch-importer/importer-server.coffee:1:completion
completion
upload_to_s3 = (filename, data, content_type, callback) -> s3.upload {Bucket: S3_BUCKET, Key: filename, Body: data, ContentType: content_type}, (err, data) -> callback(err, data) ## Express setup app = express() app.set('port', process.env.PORT || 2083) app.set('host', process.env.host || 'localhost') # E...
temp_dir = 'tmp/' MAX_SKETCH_SIZE = 100 # in MB's ## FIXME delete files after we're done uploading them # 0. delete upload when we're through with it # 1. https://stackoverflow.com/questions/38312926/how-to-cleanup-temp-files-using-multer # 2. also run a cron job to clear old files # 3. clear uploads/ and artifacts/ ...
CoffeeScript
CoffeeScript
Pagedraw/pagedraw
sketch-importer/importer-server.coffee
MIT
aba1bd1b8ef6bb7f58866a9d11ebb7f1e0e18a8e
3,558
https://github.com/Pagedraw/pagedraw/blob/aba1bd1b8ef6bb7f58866a9d11ebb7f1e0e18a8e/sketch-importer/importer-server.coffee
24
73
Pagedraw/pagedraw:sketch-importer/importer-server.coffee:2:raw_corpus
raw_corpus
scratch_dir = path.join(temp_dir, String(req.id)) new Promise (resolve, reject) -> fs.mkdir scratch_dir, (err) -> return reject(err) if err resolve() .then -> # TODO we should allow only one person at a time through importFromSketch- it's very m...
CoffeeScript
Pagedraw/pagedraw
sketch-importer/importer-server.coffee
MIT
aba1bd1b8ef6bb7f58866a9d11ebb7f1e0e18a8e
3,558
https://github.com/Pagedraw/pagedraw/blob/aba1bd1b8ef6bb7f58866a9d11ebb7f1e0e18a8e/sketch-importer/importer-server.coffee
74
120
Pagedraw/pagedraw:sketch-importer/importer-server.coffee:2:completion
completion
scratch_dir = path.join(temp_dir, String(req.id)) new Promise (resolve, reject) -> fs.mkdir scratch_dir, (err) -> return reject(err) if err resolve() .then -> # TODO we should allow only one person at a time through importFromSketch- it's very m...
file containing only the Artboards you want to use.") else if err == "Using legacy Sketch format" res.status(400).send("You are using a legacy Sketch format that is not supported. Upgrade to Sketch 43+ to use the Sketch importer") else ...
CoffeeScript
CoffeeScript
Pagedraw/pagedraw
sketch-importer/importer-server.coffee
MIT
aba1bd1b8ef6bb7f58866a9d11ebb7f1e0e18a8e
3,558
https://github.com/Pagedraw/pagedraw/blob/aba1bd1b8ef6bb7f58866a9d11ebb7f1e0e18a8e/sketch-importer/importer-server.coffee
74
120
Pagedraw/pagedraw:sketch-importer/importer-server.coffee:3:raw_corpus
raw_corpus
server = app.listen app.get('port'), -> console.log('Sketch Importer Server listening at http://%s:%s', server.address().address, server.address().port) # Up timout to 5 minutes server.timeout = 300000
CoffeeScript
Pagedraw/pagedraw
sketch-importer/importer-server.coffee
MIT
aba1bd1b8ef6bb7f58866a9d11ebb7f1e0e18a8e
3,558
https://github.com/Pagedraw/pagedraw/blob/aba1bd1b8ef6bb7f58866a9d11ebb7f1e0e18a8e/sketch-importer/importer-server.coffee
122
126
Pagedraw/pagedraw:sketch-importer/importer-server.coffee:3:coffee_to_js
coffee_to_js
Convert this CoffeeScript to JavaScript. ```coffeescript server = app.listen app.get('port'), -> console.log('Sketch Importer Server listening at http://%s:%s', server.address().address, server.address().port) # Up timout to 5 minutes server.timeout = 300000 ```
var server; server = app.listen(app.get('port'), function() { return console.log('Sketch Importer Server listening at http://%s:%s', server.address().address, server.address().port); }); // Up timout to 5 minutes server.timeout = 300000;
CoffeeScript
JavaScript
Pagedraw/pagedraw
sketch-importer/importer-server.coffee
MIT
aba1bd1b8ef6bb7f58866a9d11ebb7f1e0e18a8e
3,558
https://github.com/Pagedraw/pagedraw/blob/aba1bd1b8ef6bb7f58866a9d11ebb7f1e0e18a8e/sketch-importer/importer-server.coffee
122
126
Pagedraw/pagedraw:sketch-importer/importer-server.coffee:3:js_to_coffee
js_to_coffee
Convert this JavaScript to CoffeeScript. ```javascript var server; server = app.listen(app.get('port'), function() { return console.log('Sketch Importer Server listening at http://%s:%s', server.address().address, server.address().port); }); // Up timout to 5 minutes server.timeout = 300000; ```
server = app.listen app.get('port'), -> console.log('Sketch Importer Server listening at http://%s:%s', server.address().address, server.address().port) # Up timout to 5 minutes server.timeout = 300000
JavaScript
CoffeeScript
Pagedraw/pagedraw
sketch-importer/importer-server.coffee
MIT
aba1bd1b8ef6bb7f58866a9d11ebb7f1e0e18a8e
3,558
https://github.com/Pagedraw/pagedraw/blob/aba1bd1b8ef6bb7f58866a9d11ebb7f1e0e18a8e/sketch-importer/importer-server.coffee
122
126
Pagedraw/pagedraw:sketch-importer/importer-server.coffee:3:completion
completion
server = app.listen app.get('port'), -> console.log('Sketch Importer Server listening at http://%s:%s', server.address().address, server.address().port)
# Up timout to 5 minutes server.timeout = 300000
CoffeeScript
CoffeeScript
Pagedraw/pagedraw
sketch-importer/importer-server.coffee
MIT
aba1bd1b8ef6bb7f58866a9d11ebb7f1e0e18a8e
3,558
https://github.com/Pagedraw/pagedraw/blob/aba1bd1b8ef6bb7f58866a9d11ebb7f1e0e18a8e/sketch-importer/importer-server.coffee
122
126
gss/engine:src/engine/domains/Data.coffee:1:raw_corpus
raw_corpus
### Domain: Given values Provides values that don't need to be solved ### Domain = require('../Domain') Command = require('../Command') Variable = require('../commands/Variable') class Data extends Domain priority: 200 static: true # Data domains usually dont use worker url: null # When should Data dom...
CoffeeScript
gss/engine
src/engine/domains/Data.coffee
MIT
be430ea249f8030e11c8e03a8e170dcc8b8cf5fb
2,854
https://github.com/gss/engine/blob/be430ea249f8030e11c8e03a8e170dcc8b8cf5fb/src/engine/domains/Data.coffee
1
50
gss/engine:src/engine/domains/Data.coffee:1:coffee_to_js
coffee_to_js
Convert this CoffeeScript to JavaScript. ```coffeescript ### Domain: Given values Provides values that don't need to be solved ### Domain = require('../Domain') Command = require('../Command') Variable = require('../commands/Variable') class Data extends Domain priority: 200 static: true # Data domains usua...
/* Domain: Given values Provides values that don't need to be solved */ var Command, Data, Domain, Variable; Domain = require('../Domain'); Command = require('../Command'); Variable = require('../commands/Variable'); Data = (function() { class Data extends Domain { // When should Data domain take ownership o...
CoffeeScript
JavaScript
gss/engine
src/engine/domains/Data.coffee
MIT
be430ea249f8030e11c8e03a8e170dcc8b8cf5fb
2,854
https://github.com/gss/engine/blob/be430ea249f8030e11c8e03a8e170dcc8b8cf5fb/src/engine/domains/Data.coffee
1
50
gss/engine:src/engine/domains/Data.coffee:1:js_to_coffee
js_to_coffee
Convert this JavaScript to CoffeeScript. ```javascript /* Domain: Given values Provides values that don't need to be solved */ var Command, Data, Domain, Variable; Domain = require('../Domain'); Command = require('../Command'); Variable = require('../commands/Variable'); Data = (function() { class Data extends D...
### Domain: Given values Provides values that don't need to be solved ### Domain = require('../Domain') Command = require('../Command') Variable = require('../commands/Variable') class Data extends Domain priority: 200 static: true # Data domains usually dont use worker url: null # When should Data dom...
JavaScript
CoffeeScript
gss/engine
src/engine/domains/Data.coffee
MIT
be430ea249f8030e11c8e03a8e170dcc8b8cf5fb
2,854
https://github.com/gss/engine/blob/be430ea249f8030e11c8e03a8e170dcc8b8cf5fb/src/engine/domains/Data.coffee
1
50
gss/engine:src/engine/domains/Data.coffee:1:completion
completion
### Domain: Given values Provides values that don't need to be solved ### Domain = require('../Domain') Command = require('../Command') Variable = require('../commands/Variable') class Data extends Domain priority: 200 static: true # Data domains usually dont use worker url: null # When should Data dom...
verify: (object, property) -> path = @getPath(object, property) if @values.hasOwnProperty(path) @set(null, path, @fetch(path)) Data::Variable = Variable.extend {}, get: (path, engine, operation, continuation, scope) -> if meta = @getMeta(operation) continuation = meta.key scope ||= meta...
CoffeeScript
CoffeeScript
gss/engine
src/engine/domains/Data.coffee
MIT
be430ea249f8030e11c8e03a8e170dcc8b8cf5fb
2,854
https://github.com/gss/engine/blob/be430ea249f8030e11c8e03a8e170dcc8b8cf5fb/src/engine/domains/Data.coffee
1
50
gss/engine:src/engine/domains/Data.coffee:2:raw_corpus
raw_corpus
descend: (engine, operation, continuation, scope, ascender, ascending) -> if ascender? return [ascending] meta = operation[0] scope = meta.scope && engine.identity[meta.scope] || engine.scope [operation[1].command.solve(engine, operation[1], meta.key, scope, undefined, operation[0])] mo...
CoffeeScript
gss/engine
src/engine/domains/Data.coffee
MIT
be430ea249f8030e11c8e03a8e170dcc8b8cf5fb
2,854
https://github.com/gss/engine/blob/be430ea249f8030e11c8e03a8e170dcc8b8cf5fb/src/engine/domains/Data.coffee
51
58
gss/engine:src/engine/domains/Data.coffee:2:coffee_to_js
coffee_to_js
Convert this CoffeeScript to JavaScript. ```coffeescript descend: (engine, operation, continuation, scope, ascender, ascending) -> if ascender? return [ascending] meta = operation[0] scope = meta.scope && engine.identity[meta.scope] || engine.scope [operation[1].command.solve(engine, ope...
({ descend: function(engine, operation, continuation, scope, ascender, ascending) { var meta; if (ascender != null) { return [ascending]; } meta = operation[0]; scope = meta.scope && engine.identity[meta.scope] || engine.scope; return [operation[1].command.solve(engine, operation[1], met...
CoffeeScript
JavaScript
gss/engine
src/engine/domains/Data.coffee
MIT
be430ea249f8030e11c8e03a8e170dcc8b8cf5fb
2,854
https://github.com/gss/engine/blob/be430ea249f8030e11c8e03a8e170dcc8b8cf5fb/src/engine/domains/Data.coffee
51
58
gss/engine:src/engine/domains/Data.coffee:2:js_to_coffee
js_to_coffee
Convert this JavaScript to CoffeeScript. ```javascript ({ descend: function(engine, operation, continuation, scope, ascender, ascending) { var meta; if (ascender != null) { return [ascending]; } meta = operation[0]; scope = meta.scope && engine.identity[meta.scope] || engine.scope; retur...
descend: (engine, operation, continuation, scope, ascender, ascending) -> if ascender? return [ascending] meta = operation[0] scope = meta.scope && engine.identity[meta.scope] || engine.scope [operation[1].command.solve(engine, operation[1], meta.key, scope, undefined, operation[0])] mo...
JavaScript
CoffeeScript
gss/engine
src/engine/domains/Data.coffee
MIT
be430ea249f8030e11c8e03a8e170dcc8b8cf5fb
2,854
https://github.com/gss/engine/blob/be430ea249f8030e11c8e03a8e170dcc8b8cf5fb/src/engine/domains/Data.coffee
51
58
gss/engine:src/engine/domains/Data.coffee:2:completion
completion
descend: (engine, operation, continuation, scope, ascender, ascending) -> if ascender? return [ascending] meta = operation[0]
scope = meta.scope && engine.identity[meta.scope] || engine.scope [operation[1].command.solve(engine, operation[1], meta.key, scope, undefined, operation[0])] module.exports = Data
CoffeeScript
CoffeeScript
gss/engine
src/engine/domains/Data.coffee
MIT
be430ea249f8030e11c8e03a8e170dcc8b8cf5fb
2,854
https://github.com/gss/engine/blob/be430ea249f8030e11c8e03a8e170dcc8b8cf5fb/src/engine/domains/Data.coffee
51
58
gss/engine:src/engine/domains/Data.coffee:1:raw_corpus
raw_corpus
### Domain: Given values Provides values that don't need to be solved ### Domain = require('../Domain') Command = require('../Command') Variable = require('../commands/Variable') class Data extends Domain priority: 200 static: true @Measurement: require('../types/Measurement') Length: @Measurement....
CoffeeScript
gss/engine
src/engine/domains/Data.coffee
MIT
daa2a82301cb1696b74d4bda01f1eefdbc0a3151
2,854
https://github.com/gss/engine/blob/daa2a82301cb1696b74d4bda01f1eefdbc0a3151/src/engine/domains/Data.coffee
1
50
gss/engine:src/engine/domains/Data.coffee:1:coffee_to_js
coffee_to_js
Convert this CoffeeScript to JavaScript. ```coffeescript ### Domain: Given values Provides values that don't need to be solved ### Domain = require('../Domain') Command = require('../Command') Variable = require('../commands/Variable') class Data extends Domain priority: 200 static: true @Measurement: requ...
/* Domain: Given values Provides values that don't need to be solved */ var Command, Data, Domain, Variable; Domain = require('../Domain'); Command = require('../Command'); Variable = require('../commands/Variable'); Data = (function() { class Data extends Domain { check(id, property) { if ((this.prope...
CoffeeScript
JavaScript
gss/engine
src/engine/domains/Data.coffee
MIT
daa2a82301cb1696b74d4bda01f1eefdbc0a3151
2,854
https://github.com/gss/engine/blob/daa2a82301cb1696b74d4bda01f1eefdbc0a3151/src/engine/domains/Data.coffee
1
50
gss/engine:src/engine/domains/Data.coffee:1:js_to_coffee
js_to_coffee
Convert this JavaScript to CoffeeScript. ```javascript /* Domain: Given values Provides values that don't need to be solved */ var Command, Data, Domain, Variable; Domain = require('../Domain'); Command = require('../Command'); Variable = require('../commands/Variable'); Data = (function() { class Data extends D...
### Domain: Given values Provides values that don't need to be solved ### Domain = require('../Domain') Command = require('../Command') Variable = require('../commands/Variable') class Data extends Domain priority: 200 static: true @Measurement: require('../types/Measurement') Length: @Measurement....
JavaScript
CoffeeScript
gss/engine
src/engine/domains/Data.coffee
MIT
daa2a82301cb1696b74d4bda01f1eefdbc0a3151
2,854
https://github.com/gss/engine/blob/daa2a82301cb1696b74d4bda01f1eefdbc0a3151/src/engine/domains/Data.coffee
1
50
gss/engine:src/engine/domains/Data.coffee:1:completion
completion
### Domain: Given values Provides values that don't need to be solved ### Domain = require('../Domain') Command = require('../Command') Variable = require('../commands/Variable') class Data extends Domain priority: 200 static: true @Measurement: require('../types/Measurement') Length: @Measurement....
if @properties[property]? || property.indexOf('intrinsic-') == 0 || property.indexOf('computed-') == 0 return true if @properties[id._gss_id || id] if @properties[(id._gss_id || id) + '[' + property + ']']? return true verify: (object, property) -> path = @getPath(object, property) if...
CoffeeScript
CoffeeScript
gss/engine
src/engine/domains/Data.coffee
MIT
daa2a82301cb1696b74d4bda01f1eefdbc0a3151
2,854
https://github.com/gss/engine/blob/daa2a82301cb1696b74d4bda01f1eefdbc0a3151/src/engine/domains/Data.coffee
1
50
gss/engine:src/engine/domains/Data.coffee:2:raw_corpus
raw_corpus
Data::Meta = Command.Meta.extend {}, 'object': execute: (result) -> return result descend: (engine, operation, continuation, scope, ascender, ascending) -> if ascender? return [ascending] meta = operation[0] scope = meta.scope && engine.identity[meta.scope] || engine.scope ...
CoffeeScript
gss/engine
src/engine/domains/Data.coffee
MIT
daa2a82301cb1696b74d4bda01f1eefdbc0a3151
2,854
https://github.com/gss/engine/blob/daa2a82301cb1696b74d4bda01f1eefdbc0a3151/src/engine/domains/Data.coffee
51
65
gss/engine:src/engine/domains/Data.coffee:2:coffee_to_js
coffee_to_js
Convert this CoffeeScript to JavaScript. ```coffeescript Data::Meta = Command.Meta.extend {}, 'object': execute: (result) -> return result descend: (engine, operation, continuation, scope, ascender, ascending) -> if ascender? return [ascending] meta = operation[0] scope = met...
Data.prototype.Meta = Command.Meta.extend({}, { 'object': { execute: function(result) { return result; }, descend: function(engine, operation, continuation, scope, ascender, ascending) { var meta; if (ascender != null) { return [ascending]; } meta = operation[0]; ...
CoffeeScript
JavaScript
gss/engine
src/engine/domains/Data.coffee
MIT
daa2a82301cb1696b74d4bda01f1eefdbc0a3151
2,854
https://github.com/gss/engine/blob/daa2a82301cb1696b74d4bda01f1eefdbc0a3151/src/engine/domains/Data.coffee
51
65
gss/engine:src/engine/domains/Data.coffee:2:js_to_coffee
js_to_coffee
Convert this JavaScript to CoffeeScript. ```javascript Data.prototype.Meta = Command.Meta.extend({}, { 'object': { execute: function(result) { return result; }, descend: function(engine, operation, continuation, scope, ascender, ascending) { var meta; if (ascender != null) { retu...
Data::Meta = Command.Meta.extend {}, 'object': execute: (result) -> return result descend: (engine, operation, continuation, scope, ascender, ascending) -> if ascender? return [ascending] meta = operation[0] scope = meta.scope && engine.identity[meta.scope] || engine.scope ...
JavaScript
CoffeeScript
gss/engine
src/engine/domains/Data.coffee
MIT
daa2a82301cb1696b74d4bda01f1eefdbc0a3151
2,854
https://github.com/gss/engine/blob/daa2a82301cb1696b74d4bda01f1eefdbc0a3151/src/engine/domains/Data.coffee
51
65
gss/engine:src/engine/domains/Data.coffee:2:completion
completion
Data::Meta = Command.Meta.extend {}, 'object': execute: (result) -> return result descend: (engine, operation, continuation, scope, ascender, ascending) ->
if ascender? return [ascending] meta = operation[0] scope = meta.scope && engine.identity[meta.scope] || engine.scope [operation[1].command.solve(engine, operation[1], meta.key, scope, undefined, operation[0])] module.exports = Data
CoffeeScript
CoffeeScript
gss/engine
src/engine/domains/Data.coffee
MIT
daa2a82301cb1696b74d4bda01f1eefdbc0a3151
2,854
https://github.com/gss/engine/blob/daa2a82301cb1696b74d4bda01f1eefdbc0a3151/src/engine/domains/Data.coffee
51
65
gss/engine:src/engine/domains/Data.coffee:1:raw_corpus
raw_corpus
### Domain: Solved values Merges values from all other domains, enables anonymous constraints on immutable values ### Domain = require('../Domain') Command = require('../Command') Variable = require('../commands/Variable') class Numeric extends Domain priority: 200 static: true @Measurement: require('../t...
CoffeeScript
gss/engine
src/engine/domains/Data.coffee
MIT
237252c14721b761f4555f959d9ea5e479774c1f
2,854
https://github.com/gss/engine/blob/237252c14721b761f4555f959d9ea5e479774c1f/src/engine/domains/Data.coffee
1
50
gss/engine:src/engine/domains/Data.coffee:1:coffee_to_js
coffee_to_js
Convert this CoffeeScript to JavaScript. ```coffeescript ### Domain: Solved values Merges values from all other domains, enables anonymous constraints on immutable values ### Domain = require('../Domain') Command = require('../Command') Variable = require('../commands/Variable') class Numeric extends Domain pr...
/* Domain: Solved values Merges values from all other domains, enables anonymous constraints on immutable values */ var Command, Domain, Numeric, Variable; Domain = require('../Domain'); Command = require('../Command'); Variable = require('../commands/Variable'); Numeric = (function() { class Numeric extends Do...
CoffeeScript
JavaScript
gss/engine
src/engine/domains/Data.coffee
MIT
237252c14721b761f4555f959d9ea5e479774c1f
2,854
https://github.com/gss/engine/blob/237252c14721b761f4555f959d9ea5e479774c1f/src/engine/domains/Data.coffee
1
50
gss/engine:src/engine/domains/Data.coffee:1:js_to_coffee
js_to_coffee
Convert this JavaScript to CoffeeScript. ```javascript /* Domain: Solved values Merges values from all other domains, enables anonymous constraints on immutable values */ var Command, Domain, Numeric, Variable; Domain = require('../Domain'); Command = require('../Command'); Variable = require('../commands/Variable...
### Domain: Solved values Merges values from all other domains, enables anonymous constraints on immutable values ### Domain = require('../Domain') Command = require('../Command') Variable = require('../commands/Variable') class Numeric extends Domain priority: 200 static: true @Measurement: require('../t...
JavaScript
CoffeeScript
gss/engine
src/engine/domains/Data.coffee
MIT
237252c14721b761f4555f959d9ea5e479774c1f
2,854
https://github.com/gss/engine/blob/237252c14721b761f4555f959d9ea5e479774c1f/src/engine/domains/Data.coffee
1
50
gss/engine:src/engine/domains/Data.coffee:1:completion
completion
### Domain: Solved values Merges values from all other domains, enables anonymous constraints on immutable values ### Domain = require('../Domain') Command = require('../Command') Variable = require('../commands/Variable') class Numeric extends Domain priority: 200 static: true @Measurement: require('../t...
Numeric::Variable = Variable.extend {}, get: (path, engine, operation, continuation, scope) -> if meta = @getMeta(operation) continuation = meta.key scope ||= meta.scope && engine.identity[meta.scope] || engine.scope return engine.watch(null, path, operation, @delimit(continuation || ''), scope) ...
CoffeeScript
CoffeeScript
gss/engine
src/engine/domains/Data.coffee
MIT
237252c14721b761f4555f959d9ea5e479774c1f
2,854
https://github.com/gss/engine/blob/237252c14721b761f4555f959d9ea5e479774c1f/src/engine/domains/Data.coffee
1
50
gss/engine:src/structures/Events.coffee:1:raw_corpus
raw_corpus
# Simple event trigger that yields `handleEvent` interface # and calls `on<event>` function on the object if defined CustomEvent = (event, params = {bubbles: false, cancelable: false, detail: undefined}) -> evt = document.createEvent("CustomEvent") evt.initCustomEvent(event, params.bubbles, params.cancelable, par...
CoffeeScript
gss/engine
src/structures/Events.coffee
MIT
cbe5f62380054c95fc8762a58d504b6b5729d89b
2,854
https://github.com/gss/engine/blob/cbe5f62380054c95fc8762a58d504b6b5729d89b/src/structures/Events.coffee
1
50
gss/engine:src/structures/Events.coffee:1:completion
completion
# Simple event trigger that yields `handleEvent` interface # and calls `on<event>` function on the object if defined CustomEvent = (event, params = {bubbles: false, cancelable: false, detail: undefined}) -> evt = document.createEvent("CustomEvent") evt.initCustomEvent(event, params.bubbles, params.cancelable, par...
addListeners: (listeners) -> for name, callback of listeners @addEventListener name, callback removeListeners: (listeners) -> for name, callback of listeners @removeEventListener name, callback once: (type, fn) -> fn.once = true @addEventListener(type, fn) addEventListener: (type, f...
CoffeeScript
CoffeeScript
gss/engine
src/structures/Events.coffee
MIT
cbe5f62380054c95fc8762a58d504b6b5729d89b
2,854
https://github.com/gss/engine/blob/cbe5f62380054c95fc8762a58d504b6b5729d89b/src/structures/Events.coffee
1
50
gss/engine:src/structures/Events.coffee:2:raw_corpus
raw_corpus
fn = group[index] if fn.once group.splice(index--, 1) j-- fn.call(@, a, b, c) index++ if @[method = 'on' + type] return @[method](a, b, c) dispatchEvent: (element, type, data, bubbles, cancelable) -> return unless @scope detail = {engine: @} for prop,...
CoffeeScript
gss/engine
src/structures/Events.coffee
MIT
cbe5f62380054c95fc8762a58d504b6b5729d89b
2,854
https://github.com/gss/engine/blob/cbe5f62380054c95fc8762a58d504b6b5729d89b/src/structures/Events.coffee
51
75
gss/engine:src/structures/Events.coffee:2:completion
completion
fn = group[index] if fn.once group.splice(index--, 1) j-- fn.call(@, a, b, c) index++ if @[method = 'on' + type] return @[method](a, b, c) dispatchEvent: (element, type, data, bubbles, cancelable) -> return unless @scope detail = {engine: @}
for prop, value of data detail[prop] = value element.dispatchEvent new CustomEvent(type, {detail,bubbles,cancelable}) # Catch-all event listener handleEvent: (e) -> @triggerEvent(e.type, e) then: (callback) -> @once @DONE, callback module.exports = Events
CoffeeScript
CoffeeScript
gss/engine
src/structures/Events.coffee
MIT
cbe5f62380054c95fc8762a58d504b6b5729d89b
2,854
https://github.com/gss/engine/blob/cbe5f62380054c95fc8762a58d504b6b5729d89b/src/structures/Events.coffee
51
75
jianliaoim/talk-os:talk-web/client/config.coffee:1:raw_corpus
raw_corpus
if typeof window isnt 'undefined' module.exports = window._initialStore.config else module.exports = {}
CoffeeScript
jianliaoim/talk-os
talk-web/client/config.coffee
MIT
2545c4497865779a55762e03963a39237df9046b
2,703
https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-web/client/config.coffee
1
4
jianliaoim/talk-os:talk-web/client/config.coffee:1:coffee_to_js
coffee_to_js
Convert this CoffeeScript to JavaScript. ```coffeescript if typeof window isnt 'undefined' module.exports = window._initialStore.config else module.exports = {} ```
if (typeof window !== 'undefined') { module.exports = window._initialStore.config; } else { module.exports = {}; }
CoffeeScript
JavaScript
jianliaoim/talk-os
talk-web/client/config.coffee
MIT
2545c4497865779a55762e03963a39237df9046b
2,703
https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-web/client/config.coffee
1
4
jianliaoim/talk-os:talk-web/client/config.coffee:1:js_to_coffee
js_to_coffee
Convert this JavaScript to CoffeeScript. ```javascript if (typeof window !== 'undefined') { module.exports = window._initialStore.config; } else { module.exports = {}; } ```
if typeof window isnt 'undefined' module.exports = window._initialStore.config else module.exports = {}
JavaScript
CoffeeScript
jianliaoim/talk-os
talk-web/client/config.coffee
MIT
2545c4497865779a55762e03963a39237df9046b
2,703
https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-web/client/config.coffee
1
4
jianliaoim/talk-os:talk-web/client/config.coffee:1:completion
completion
if typeof window isnt 'undefined' module.exports = window._initialStore.config
else module.exports = {}
CoffeeScript
CoffeeScript
jianliaoim/talk-os
talk-web/client/config.coffee
MIT
2545c4497865779a55762e03963a39237df9046b
2,703
https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-web/client/config.coffee
1
4
octoblu/meshblu:test/lib/register-spec.coffee:1:raw_corpus
raw_corpus
_ = require 'lodash' moment = require 'moment' TestDatabase = require '../test-database' describe 'register', -> beforeEach (done) -> @sut = require '../../lib/register' @oldUpdateDevice = sinon.stub() TestDatabase.open (error, database) => @database = database @devices = @database.devi...
CoffeeScript
octoblu/meshblu
test/lib/register-spec.coffee
MIT
6c6af069bb29f9ffd0684eb6e519011774bf6579
815
https://github.com/octoblu/meshblu/blob/6c6af069bb29f9ffd0684eb6e519011774bf6579/test/lib/register-spec.coffee
1
39
octoblu/meshblu:test/lib/register-spec.coffee:1:coffee_to_js
coffee_to_js
Convert this CoffeeScript to JavaScript. ```coffeescript _ = require 'lodash' moment = require 'moment' TestDatabase = require '../test-database' describe 'register', -> beforeEach (done) -> @sut = require '../../lib/register' @oldUpdateDevice = sinon.stub() TestDatabase.open (error, database) => ...
var TestDatabase, _, moment; _ = require('lodash'); moment = require('moment'); TestDatabase = require('../test-database'); describe('register', function() { beforeEach(function(done) { this.sut = require('../../lib/register'); this.oldUpdateDevice = sinon.stub(); return TestDatabase.open((error, data...
CoffeeScript
JavaScript
octoblu/meshblu
test/lib/register-spec.coffee
MIT
6c6af069bb29f9ffd0684eb6e519011774bf6579
815
https://github.com/octoblu/meshblu/blob/6c6af069bb29f9ffd0684eb6e519011774bf6579/test/lib/register-spec.coffee
1
39
octoblu/meshblu:test/lib/register-spec.coffee:1:js_to_coffee
js_to_coffee
Convert this JavaScript to CoffeeScript. ```javascript var TestDatabase, _, moment; _ = require('lodash'); moment = require('moment'); TestDatabase = require('../test-database'); describe('register', function() { beforeEach(function(done) { this.sut = require('../../lib/register'); this.oldUpdateDevice = ...
_ = require 'lodash' moment = require 'moment' TestDatabase = require '../test-database' describe 'register', -> beforeEach (done) -> @sut = require '../../lib/register' @oldUpdateDevice = sinon.stub() TestDatabase.open (error, database) => @database = database @devices = @database.devi...
JavaScript
CoffeeScript
octoblu/meshblu
test/lib/register-spec.coffee
MIT
6c6af069bb29f9ffd0684eb6e519011774bf6579
815
https://github.com/octoblu/meshblu/blob/6c6af069bb29f9ffd0684eb6e519011774bf6579/test/lib/register-spec.coffee
1
39
octoblu/meshblu:test/lib/register-spec.coffee:1:completion
completion
_ = require 'lodash' moment = require 'moment' TestDatabase = require '../test-database' describe 'register', -> beforeEach (done) -> @sut = require '../../lib/register' @oldUpdateDevice = sinon.stub() TestDatabase.open (error, database) => @database = database @devices = @database.devi...
beforeEach (done) -> @timestamp = moment().toISOString() @oldUpdateDevice.yields null, timestamp: @timestamp storeDevice = (@error, @device) => done() @sut null, storeDevice, @dependencies it 'should return a device', -> expect(@device).to.exist it 'should create a device', (done...
CoffeeScript
CoffeeScript
octoblu/meshblu
test/lib/register-spec.coffee
MIT
6c6af069bb29f9ffd0684eb6e519011774bf6579
815
https://github.com/octoblu/meshblu/blob/6c6af069bb29f9ffd0684eb6e519011774bf6579/test/lib/register-spec.coffee
1
39
octoblu/meshblu:test/lib/register-spec.coffee:2:raw_corpus
raw_corpus
it 'should generate a new token', -> expect(@device.token).to.exist it 'should call oldUpdateDevice', -> expect(@oldUpdateDevice).to.have.been.called it 'should merge in the timestamp from update Device', -> expect(@device.timestamp).to.equal @timestamp describe 'when called again with ...
CoffeeScript
octoblu/meshblu
test/lib/register-spec.coffee
MIT
6c6af069bb29f9ffd0684eb6e519011774bf6579
815
https://github.com/octoblu/meshblu/blob/6c6af069bb29f9ffd0684eb6e519011774bf6579/test/lib/register-spec.coffee
41
79
octoblu/meshblu:test/lib/register-spec.coffee:2:coffee_to_js
coffee_to_js
Convert this CoffeeScript to JavaScript. ```coffeescript it 'should generate a new token', -> expect(@device.token).to.exist it 'should call oldUpdateDevice', -> expect(@oldUpdateDevice).to.have.been.called it 'should merge in the timestamp from update Device', -> expect(@device.timestamp).t...
it('should generate a new token', function() { return expect(this.device.token).to.exist; }); it('should call oldUpdateDevice', function() { return expect(this.oldUpdateDevice).to.have.been.called; }); it('should merge in the timestamp from update Device', function() { return expect(this.device.timestamp).to.eq...
CoffeeScript
JavaScript
octoblu/meshblu
test/lib/register-spec.coffee
MIT
6c6af069bb29f9ffd0684eb6e519011774bf6579
815
https://github.com/octoblu/meshblu/blob/6c6af069bb29f9ffd0684eb6e519011774bf6579/test/lib/register-spec.coffee
41
79
octoblu/meshblu:test/lib/register-spec.coffee:2:js_to_coffee
js_to_coffee
Convert this JavaScript to CoffeeScript. ```javascript it('should generate a new token', function() { return expect(this.device.token).to.exist; }); it('should call oldUpdateDevice', function() { return expect(this.oldUpdateDevice).to.have.been.called; }); it('should merge in the timestamp from update Device', fu...
it 'should generate a new token', -> expect(@device.token).to.exist it 'should call oldUpdateDevice', -> expect(@oldUpdateDevice).to.have.been.called it 'should merge in the timestamp from update Device', -> expect(@device.timestamp).to.equal @timestamp describe 'when called again with ...
JavaScript
CoffeeScript
octoblu/meshblu
test/lib/register-spec.coffee
MIT
6c6af069bb29f9ffd0684eb6e519011774bf6579
815
https://github.com/octoblu/meshblu/blob/6c6af069bb29f9ffd0684eb6e519011774bf6579/test/lib/register-spec.coffee
41
79
octoblu/meshblu:test/lib/register-spec.coffee:2:completion
completion
it 'should generate a new token', -> expect(@device.token).to.exist it 'should call oldUpdateDevice', -> expect(@oldUpdateDevice).to.have.been.called it 'should merge in the timestamp from update Device', -> expect(@device.timestamp).to.equal @timestamp describe 'when called again with ...
expect(@newerDevice.token).to.not.equal @device.token describe 'when called with a specific uuid', -> beforeEach (done) -> @oldUpdateDevice.yields null, {} @dependencies.uuid = v4: sinon.stub().returns 'some-other-uuid' @sut {uuid: 'some-uuid'}, done, @dependencies it 'should gene...
CoffeeScript
CoffeeScript
octoblu/meshblu
test/lib/register-spec.coffee
MIT
6c6af069bb29f9ffd0684eb6e519011774bf6579
815
https://github.com/octoblu/meshblu/blob/6c6af069bb29f9ffd0684eb6e519011774bf6579/test/lib/register-spec.coffee
41
79
octoblu/meshblu:test/lib/register-spec.coffee:3:raw_corpus
raw_corpus
it 'should set the discoverWhitelist to the owners UUID', -> expect(@oldUpdateDevice).to.have.been.calledWith( sinon.match.any sinon.match token: 'token' owner: 'other-uuid' discoverWhitelist: ['other-uuid'] ) describe 'when called without an online', -> ...
CoffeeScript
octoblu/meshblu
test/lib/register-spec.coffee
MIT
6c6af069bb29f9ffd0684eb6e519011774bf6579
815
https://github.com/octoblu/meshblu/blob/6c6af069bb29f9ffd0684eb6e519011774bf6579/test/lib/register-spec.coffee
81
123
octoblu/meshblu:test/lib/register-spec.coffee:3:coffee_to_js
coffee_to_js
Convert this CoffeeScript to JavaScript. ```coffeescript it 'should set the discoverWhitelist to the owners UUID', -> expect(@oldUpdateDevice).to.have.been.calledWith( sinon.match.any sinon.match token: 'token' owner: 'other-uuid' discoverWhitelist: ['other-uuid'] ...
it('should set the discoverWhitelist to the owners UUID', function() { return expect(this.oldUpdateDevice).to.have.been.calledWith(sinon.match.any, sinon.match({ token: 'token', owner: 'other-uuid', discoverWhitelist: ['other-uuid'] })); }); describe('when called without an online', function() { befo...
CoffeeScript
JavaScript
octoblu/meshblu
test/lib/register-spec.coffee
MIT
6c6af069bb29f9ffd0684eb6e519011774bf6579
815
https://github.com/octoblu/meshblu/blob/6c6af069bb29f9ffd0684eb6e519011774bf6579/test/lib/register-spec.coffee
81
123
octoblu/meshblu:test/lib/register-spec.coffee:3:js_to_coffee
js_to_coffee
Convert this JavaScript to CoffeeScript. ```javascript it('should set the discoverWhitelist to the owners UUID', function() { return expect(this.oldUpdateDevice).to.have.been.calledWith(sinon.match.any, sinon.match({ token: 'token', owner: 'other-uuid', discoverWhitelist: ['other-uuid'] })); }); descri...
it 'should set the discoverWhitelist to the owners UUID', -> expect(@oldUpdateDevice).to.have.been.calledWith( sinon.match.any sinon.match token: 'token' owner: 'other-uuid' discoverWhitelist: ['other-uuid'] ) describe 'when called without an online', -> ...
JavaScript
CoffeeScript
octoblu/meshblu
test/lib/register-spec.coffee
MIT
6c6af069bb29f9ffd0684eb6e519011774bf6579
815
https://github.com/octoblu/meshblu/blob/6c6af069bb29f9ffd0684eb6e519011774bf6579/test/lib/register-spec.coffee
81
123
octoblu/meshblu:test/lib/register-spec.coffee:3:completion
completion
it 'should set the discoverWhitelist to the owners UUID', -> expect(@oldUpdateDevice).to.have.been.calledWith( sinon.match.any sinon.match token: 'token' owner: 'other-uuid' discoverWhitelist: ['other-uuid'] ) describe 'when called without an online', -> ...
beforeEach (done) -> @devices.insert {uuid : 'some-uuid', name: 'Somebody.'}, done describe 'trying to create a new device with a different uuid', -> beforeEach (done) -> @oldUpdateDevice.yields null, {} storeDevice = (@error, @device) => done() @sut {uuid: 'some-other-uuid'}, s...
CoffeeScript
CoffeeScript
octoblu/meshblu
test/lib/register-spec.coffee
MIT
6c6af069bb29f9ffd0684eb6e519011774bf6579
815
https://github.com/octoblu/meshblu/blob/6c6af069bb29f9ffd0684eb6e519011774bf6579/test/lib/register-spec.coffee
81
123
linemanjs/lineman:tasks/webfonts.coffee:1:raw_corpus
raw_corpus
### Task: webfonts Description: copy webfonts from 'vendor/webfonts' to 'generated' & 'dist' Dependencies: grunt Contributor: @davemo Configuration: "root" - the path to which webfonts will be copied under 'generated' and 'dist' (default: "webfonts") ### module.exports = (grunt) -> _ = require("lodash") copy = req...
CoffeeScript
linemanjs/lineman
tasks/webfonts.coffee
MIT
61d681532d9621e578d319c279006bbb728ece4b
1,168
https://github.com/linemanjs/lineman/blob/61d681532d9621e578d319c279006bbb728ece4b/tasks/webfonts.coffee
1
34
linemanjs/lineman:tasks/webfonts.coffee:1:coffee_to_js
coffee_to_js
Convert this CoffeeScript to JavaScript. ```coffeescript ### Task: webfonts Description: copy webfonts from 'vendor/webfonts' to 'generated' & 'dist' Dependencies: grunt Contributor: @davemo Configuration: "root" - the path to which webfonts will be copied under 'generated' and 'dist' (default: "webfonts") ### module....
/* Task: webfonts Description: copy webfonts from 'vendor/webfonts' to 'generated' & 'dist' Dependencies: grunt Contributor: @davemo Configuration: "root" - the path to which webfonts will be copied under 'generated' and 'dist' (default: "webfonts") */ module.exports = function(grunt) { var _, copy; _ = require("l...
CoffeeScript
JavaScript
linemanjs/lineman
tasks/webfonts.coffee
MIT
61d681532d9621e578d319c279006bbb728ece4b
1,168
https://github.com/linemanjs/lineman/blob/61d681532d9621e578d319c279006bbb728ece4b/tasks/webfonts.coffee
1
34
linemanjs/lineman:tasks/webfonts.coffee:1:js_to_coffee
js_to_coffee
Convert this JavaScript to CoffeeScript. ```javascript /* Task: webfonts Description: copy webfonts from 'vendor/webfonts' to 'generated' & 'dist' Dependencies: grunt Contributor: @davemo Configuration: "root" - the path to which webfonts will be copied under 'generated' and 'dist' (default: "webfonts") */ module.expo...
### Task: webfonts Description: copy webfonts from 'vendor/webfonts' to 'generated' & 'dist' Dependencies: grunt Contributor: @davemo Configuration: "root" - the path to which webfonts will be copied under 'generated' and 'dist' (default: "webfonts") ### module.exports = (grunt) -> _ = require("lodash") copy = req...
JavaScript
CoffeeScript
linemanjs/lineman
tasks/webfonts.coffee
MIT
61d681532d9621e578d319c279006bbb728ece4b
1,168
https://github.com/linemanjs/lineman/blob/61d681532d9621e578d319c279006bbb728ece4b/tasks/webfonts.coffee
1
34
linemanjs/lineman:tasks/webfonts.coffee:1:completion
completion
### Task: webfonts Description: copy webfonts from 'vendor/webfonts' to 'generated' & 'dist' Dependencies: grunt Contributor: @davemo Configuration: "root" - the path to which webfonts will be copied under 'generated' and 'dist' (default: "webfonts") ### module.exports = (grunt) -> _ = require("lodash") copy = req...
taskConfig = grunt.config.get("webfonts") targetConfig = grunt.config.get("webfonts.#{target}") destinationPath = "#{targetConfig.dest}/#{taskConfig.root}" if grunt.config("webfonts.#{target}.files")? or grunt.config("webfonts.#{target}.src")? grunt.warn """ The 'webfonts' task imple...
CoffeeScript
CoffeeScript
linemanjs/lineman
tasks/webfonts.coffee
MIT
61d681532d9621e578d319c279006bbb728ece4b
1,168
https://github.com/linemanjs/lineman/blob/61d681532d9621e578d319c279006bbb728ece4b/tasks/webfonts.coffee
1
34
linemanjs/lineman:tasks/webfonts.coffee:1:raw_corpus
raw_corpus
### Task: webfonts Description: copy webfonts from 'vendor/webfonts' to 'generated' & 'dist' Dependencies: grunt Contributor: @davemo Configuration: "root" - the path to which webfonts will be copied under 'generated' and 'dist' (default: "webfonts") ### module.exports = (grunt) -> _ = require("lodash") copy = req...
CoffeeScript
linemanjs/lineman
tasks/webfonts.coffee
MIT
da7b69982e44220bdd107798d86abc78749dc125
1,168
https://github.com/linemanjs/lineman/blob/da7b69982e44220bdd107798d86abc78749dc125/tasks/webfonts.coffee
1
34
linemanjs/lineman:tasks/webfonts.coffee:1:coffee_to_js
coffee_to_js
Convert this CoffeeScript to JavaScript. ```coffeescript ### Task: webfonts Description: copy webfonts from 'vendor/webfonts' to 'generated' & 'dist' Dependencies: grunt Contributor: @davemo Configuration: "root" - the path to which webfonts will be copied under 'generated' and 'dist' (default: "webfonts") ### module....
/* Task: webfonts Description: copy webfonts from 'vendor/webfonts' to 'generated' & 'dist' Dependencies: grunt Contributor: @davemo Configuration: "root" - the path to which webfonts will be copied under 'generated' and 'dist' (default: "webfonts") */ module.exports = function(grunt) { var _, copy; _ = require("l...
CoffeeScript
JavaScript
linemanjs/lineman
tasks/webfonts.coffee
MIT
da7b69982e44220bdd107798d86abc78749dc125
1,168
https://github.com/linemanjs/lineman/blob/da7b69982e44220bdd107798d86abc78749dc125/tasks/webfonts.coffee
1
34
linemanjs/lineman:tasks/webfonts.coffee:1:js_to_coffee
js_to_coffee
Convert this JavaScript to CoffeeScript. ```javascript /* Task: webfonts Description: copy webfonts from 'vendor/webfonts' to 'generated' & 'dist' Dependencies: grunt Contributor: @davemo Configuration: "root" - the path to which webfonts will be copied under 'generated' and 'dist' (default: "webfonts") */ module.expo...
### Task: webfonts Description: copy webfonts from 'vendor/webfonts' to 'generated' & 'dist' Dependencies: grunt Contributor: @davemo Configuration: "root" - the path to which webfonts will be copied under 'generated' and 'dist' (default: "webfonts") ### module.exports = (grunt) -> _ = require("lodash") copy = req...
JavaScript
CoffeeScript
linemanjs/lineman
tasks/webfonts.coffee
MIT
da7b69982e44220bdd107798d86abc78749dc125
1,168
https://github.com/linemanjs/lineman/blob/da7b69982e44220bdd107798d86abc78749dc125/tasks/webfonts.coffee
1
34
linemanjs/lineman:tasks/webfonts.coffee:1:completion
completion
### Task: webfonts Description: copy webfonts from 'vendor/webfonts' to 'generated' & 'dist' Dependencies: grunt Contributor: @davemo Configuration: "root" - the path to which webfonts will be copied under 'generated' and 'dist' (default: "webfonts") ### module.exports = (grunt) -> _ = require("lodash") copy = req...
taskConfig = grunt.config.get("webfonts") targetConfig = grunt.config.get("webfonts.#{target}") destinationPath = "#{targetConfig.dest}/#{taskConfig.root}" if grunt.config("webfonts.#{target}.files")? or grunt.config("webfonts.#{target}.src")? grunt.warn """ The 'webfonts' task imple...
CoffeeScript
CoffeeScript
linemanjs/lineman
tasks/webfonts.coffee
MIT
da7b69982e44220bdd107798d86abc78749dc125
1,168
https://github.com/linemanjs/lineman/blob/da7b69982e44220bdd107798d86abc78749dc125/tasks/webfonts.coffee
1
34
linemanjs/lineman:tasks/webfonts.coffee:1:raw_corpus
raw_corpus
### Task: webfonts Description: copy webfonts from 'vendor/webfonts' to 'generated' & 'dist' Dependencies: grunt Contributor: @davemo Configuration: "root" - the path to which webfonts will be copied under 'generated' and 'dist' (default: "webfonts") ### module.exports = (grunt) -> _ = grunt.util._ copy = require(...
CoffeeScript
linemanjs/lineman
tasks/webfonts.coffee
MIT
5d013b6f7bd0fbfeb9eb250c3da89021b84ab349
1,168
https://github.com/linemanjs/lineman/blob/5d013b6f7bd0fbfeb9eb250c3da89021b84ab349/tasks/webfonts.coffee
1
34
linemanjs/lineman:tasks/webfonts.coffee:1:coffee_to_js
coffee_to_js
Convert this CoffeeScript to JavaScript. ```coffeescript ### Task: webfonts Description: copy webfonts from 'vendor/webfonts' to 'generated' & 'dist' Dependencies: grunt Contributor: @davemo Configuration: "root" - the path to which webfonts will be copied under 'generated' and 'dist' (default: "webfonts") ### module....
/* Task: webfonts Description: copy webfonts from 'vendor/webfonts' to 'generated' & 'dist' Dependencies: grunt Contributor: @davemo Configuration: "root" - the path to which webfonts will be copied under 'generated' and 'dist' (default: "webfonts") */ module.exports = function(grunt) { var _, copy; _ = grunt.util...
CoffeeScript
JavaScript
linemanjs/lineman
tasks/webfonts.coffee
MIT
5d013b6f7bd0fbfeb9eb250c3da89021b84ab349
1,168
https://github.com/linemanjs/lineman/blob/5d013b6f7bd0fbfeb9eb250c3da89021b84ab349/tasks/webfonts.coffee
1
34
linemanjs/lineman:tasks/webfonts.coffee:1:js_to_coffee
js_to_coffee
Convert this JavaScript to CoffeeScript. ```javascript /* Task: webfonts Description: copy webfonts from 'vendor/webfonts' to 'generated' & 'dist' Dependencies: grunt Contributor: @davemo Configuration: "root" - the path to which webfonts will be copied under 'generated' and 'dist' (default: "webfonts") */ module.expo...
### Task: webfonts Description: copy webfonts from 'vendor/webfonts' to 'generated' & 'dist' Dependencies: grunt Contributor: @davemo Configuration: "root" - the path to which webfonts will be copied under 'generated' and 'dist' (default: "webfonts") ### module.exports = (grunt) -> _ = grunt.util._ copy = require(...
JavaScript
CoffeeScript
linemanjs/lineman
tasks/webfonts.coffee
MIT
5d013b6f7bd0fbfeb9eb250c3da89021b84ab349
1,168
https://github.com/linemanjs/lineman/blob/5d013b6f7bd0fbfeb9eb250c3da89021b84ab349/tasks/webfonts.coffee
1
34
linemanjs/lineman:tasks/webfonts.coffee:1:completion
completion
### Task: webfonts Description: copy webfonts from 'vendor/webfonts' to 'generated' & 'dist' Dependencies: grunt Contributor: @davemo Configuration: "root" - the path to which webfonts will be copied under 'generated' and 'dist' (default: "webfonts") ### module.exports = (grunt) -> _ = grunt.util._ copy = require(...
taskConfig = grunt.config.get("webfonts") targetConfig = grunt.config.get("webfonts.#{target}") destinationPath = "#{targetConfig.dest}/#{taskConfig.root}" if grunt.config("webfonts.#{target}.files")? or grunt.config("webfonts.#{target}.src")? grunt.warn """ The 'webfonts' task imple...
CoffeeScript
CoffeeScript
linemanjs/lineman
tasks/webfonts.coffee
MIT
5d013b6f7bd0fbfeb9eb250c3da89021b84ab349
1,168
https://github.com/linemanjs/lineman/blob/5d013b6f7bd0fbfeb9eb250c3da89021b84ab349/tasks/webfonts.coffee
1
34
linemanjs/lineman:tasks/webfonts.coffee:1:raw_corpus
raw_corpus
### Task: webfonts Description: copy webfonts from 'vendor/webfonts' to 'generated' & 'dist' Dependencies: grunt Contributor: @davemo Configuration: "root" - the path to which webfonts will be copied under 'generated' and 'dist' (default: "webfonts") ### module.exports = (grunt) -> _ = grunt.util._ copy = require(...
CoffeeScript
linemanjs/lineman
tasks/webfonts.coffee
MIT
3428e18b30a667d4f4cdfd6462b7c59a43b16816
1,168
https://github.com/linemanjs/lineman/blob/3428e18b30a667d4f4cdfd6462b7c59a43b16816/tasks/webfonts.coffee
1
26
linemanjs/lineman:tasks/webfonts.coffee:1:coffee_to_js
coffee_to_js
Convert this CoffeeScript to JavaScript. ```coffeescript ### Task: webfonts Description: copy webfonts from 'vendor/webfonts' to 'generated' & 'dist' Dependencies: grunt Contributor: @davemo Configuration: "root" - the path to which webfonts will be copied under 'generated' and 'dist' (default: "webfonts") ### module....
/* Task: webfonts Description: copy webfonts from 'vendor/webfonts' to 'generated' & 'dist' Dependencies: grunt Contributor: @davemo Configuration: "root" - the path to which webfonts will be copied under 'generated' and 'dist' (default: "webfonts") */ module.exports = function(grunt) { var _, copy; _ = grunt.util...
CoffeeScript
JavaScript
linemanjs/lineman
tasks/webfonts.coffee
MIT
3428e18b30a667d4f4cdfd6462b7c59a43b16816
1,168
https://github.com/linemanjs/lineman/blob/3428e18b30a667d4f4cdfd6462b7c59a43b16816/tasks/webfonts.coffee
1
26
linemanjs/lineman:tasks/webfonts.coffee:1:js_to_coffee
js_to_coffee
Convert this JavaScript to CoffeeScript. ```javascript /* Task: webfonts Description: copy webfonts from 'vendor/webfonts' to 'generated' & 'dist' Dependencies: grunt Contributor: @davemo Configuration: "root" - the path to which webfonts will be copied under 'generated' and 'dist' (default: "webfonts") */ module.expo...
### Task: webfonts Description: copy webfonts from 'vendor/webfonts' to 'generated' & 'dist' Dependencies: grunt Contributor: @davemo Configuration: "root" - the path to which webfonts will be copied under 'generated' and 'dist' (default: "webfonts") ### module.exports = (grunt) -> _ = grunt.util._ copy = require(...
JavaScript
CoffeeScript
linemanjs/lineman
tasks/webfonts.coffee
MIT
3428e18b30a667d4f4cdfd6462b7c59a43b16816
1,168
https://github.com/linemanjs/lineman/blob/3428e18b30a667d4f4cdfd6462b7c59a43b16816/tasks/webfonts.coffee
1
26
linemanjs/lineman:tasks/webfonts.coffee:1:completion
completion
### Task: webfonts Description: copy webfonts from 'vendor/webfonts' to 'generated' & 'dist' Dependencies: grunt Contributor: @davemo Configuration: "root" - the path to which webfonts will be copied under 'generated' and 'dist' (default: "webfonts") ### module.exports = (grunt) -> _ = grunt.util._ copy = require(...
grunt.registerTask "webfonts", "copy webfonts to dist/webfonts", (target) -> target = target or "dist" @requiresConfig "webfonts.files" @requiresConfig "webfonts.#{target}" taskConfig = grunt.config.get("webfonts") targetConfig = grunt.config.get("webfonts.#{target}") destinationPath = "#{target...
CoffeeScript
CoffeeScript
linemanjs/lineman
tasks/webfonts.coffee
MIT
3428e18b30a667d4f4cdfd6462b7c59a43b16816
1,168
https://github.com/linemanjs/lineman/blob/3428e18b30a667d4f4cdfd6462b7c59a43b16816/tasks/webfonts.coffee
1
26
jianliaoim/talk-os:talk-account/server/schemas/index.coffee:1:raw_corpus
raw_corpus
statics = findOneAndSave: (conditions, update, options, callback = ->) -> if typeof options is 'function' callback = options options = {} if options.keep instanceof Array # These properties will not override old properties options.keep = ['createdAt'].concat(options.keep) else op...
CoffeeScript
jianliaoim/talk-os
talk-account/server/schemas/index.coffee
MIT
2545c4497865779a55762e03963a39237df9046b
2,703
https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-account/server/schemas/index.coffee
5
54
jianliaoim/talk-os:talk-account/server/schemas/index.coffee:1:coffee_to_js
coffee_to_js
Convert this CoffeeScript to JavaScript. ```coffeescript statics = findOneAndSave: (conditions, update, options, callback = ->) -> if typeof options is 'function' callback = options options = {} if options.keep instanceof Array # These properties will not override old properties options.ke...
var statics, indexOf = [].indexOf; statics = { findOneAndSave: function(conditions, update, options, callback = function() {}) { var self; if (typeof options === 'function') { callback = options; options = {}; } if (options.keep instanceof Array) { // These properties will not override ...
CoffeeScript
JavaScript
jianliaoim/talk-os
talk-account/server/schemas/index.coffee
MIT
2545c4497865779a55762e03963a39237df9046b
2,703
https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-account/server/schemas/index.coffee
5
54
jianliaoim/talk-os:talk-account/server/schemas/index.coffee:1:js_to_coffee
js_to_coffee
Convert this JavaScript to CoffeeScript. ```javascript var statics, indexOf = [].indexOf; statics = { findOneAndSave: function(conditions, update, options, callback = function() {}) { var self; if (typeof options === 'function') { callback = options; options = {}; } if (options.keep ins...
statics = findOneAndSave: (conditions, update, options, callback = ->) -> if typeof options is 'function' callback = options options = {} if options.keep instanceof Array # These properties will not override old properties options.keep = ['createdAt'].concat(options.keep) else op...
JavaScript
CoffeeScript
jianliaoim/talk-os
talk-account/server/schemas/index.coffee
MIT
2545c4497865779a55762e03963a39237df9046b
2,703
https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-account/server/schemas/index.coffee
5
54
jianliaoim/talk-os:talk-account/server/schemas/index.coffee:1:completion
completion
statics = findOneAndSave: (conditions, update, options, callback = ->) -> if typeof options is 'function' callback = options options = {} if options.keep instanceof Array # These properties will not override old properties options.keep = ['createdAt'].concat(options.keep) else op...
doc.updatedAt = new Date # Ignore the numberAffected param doc.save (err, doc) -> callback err, doc else if options.upsert conditions = _.extend conditions, update conditions.createdAt = new Date conditions.updatedAt = new Date self.create conditions, callback ...
CoffeeScript
CoffeeScript
jianliaoim/talk-os
talk-account/server/schemas/index.coffee
MIT
2545c4497865779a55762e03963a39237df9046b
2,703
https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-account/server/schemas/index.coffee
5
54
jianliaoim/talk-os:talk-account/server/schemas/index.coffee:2:raw_corpus
raw_corpus
, upsert: true new: true , (err, model) -> callback err, model findAndRemove: (conditions, callback = ->) -> @find conditions, (err, items = []) => return callback(err) if err? @remove conditions, (err) -> callback err, items _buildQuery: (conditions, options = {}) ->...
CoffeeScript
jianliaoim/talk-os
talk-account/server/schemas/index.coffee
MIT
2545c4497865779a55762e03963a39237df9046b
2,703
https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-account/server/schemas/index.coffee
55
86
jianliaoim/talk-os:talk-account/server/schemas/index.coffee:2:completion
completion
, upsert: true new: true , (err, model) -> callback err, model findAndRemove: (conditions, callback = ->) -> @find conditions, (err, items = []) => return callback(err) if err? @remove conditions, (err) -> callback err, items _buildQuery: (conditions, options = {}) ->...
conditions.createdAt = $lt: maxDate if maxDate? sort or= _id: -1 if _maxId conditions._id or= {} conditions._id.$lt = _maxId else if _minId conditions._id or= {} conditions._id.$gt = _minId sort = _id: 1 query = @find conditions .limit limit .skip limit * (pag...
CoffeeScript
CoffeeScript
jianliaoim/talk-os
talk-account/server/schemas/index.coffee
MIT
2545c4497865779a55762e03963a39237df9046b
2,703
https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-account/server/schemas/index.coffee
55
86
jianliaoim/talk-os:talk-account/server/schemas/index.coffee:3:raw_corpus
raw_corpus
methods = $save: -> model = this new Promise (resolve, reject) -> model.save (err, model) -> return reject(err) if err resolve model $remove: -> model = this new Promise (resolve, reject) -> model.remove (err, model) -> return reject(err) if err resolve mo...
CoffeeScript
jianliaoim/talk-os
talk-account/server/schemas/index.coffee
MIT
2545c4497865779a55762e03963a39237df9046b
2,703
https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-account/server/schemas/index.coffee
88
108
jianliaoim/talk-os:talk-account/server/schemas/index.coffee:3:coffee_to_js
coffee_to_js
Convert this CoffeeScript to JavaScript. ```coffeescript methods = $save: -> model = this new Promise (resolve, reject) -> model.save (err, model) -> return reject(err) if err resolve model $remove: -> model = this new Promise (resolve, reject) -> model.remove (err, model...
var methods, overwrites, schemas; methods = { $save: function() { var model; model = this; return new Promise(function(resolve, reject) { return model.save(function(err, model) { if (err) { return reject(err); } return resolve(model); }); }); }, $remo...
CoffeeScript
JavaScript
jianliaoim/talk-os
talk-account/server/schemas/index.coffee
MIT
2545c4497865779a55762e03963a39237df9046b
2,703
https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-account/server/schemas/index.coffee
88
108
jianliaoim/talk-os:talk-account/server/schemas/index.coffee:3:js_to_coffee
js_to_coffee
Convert this JavaScript to CoffeeScript. ```javascript var methods, overwrites, schemas; methods = { $save: function() { var model; model = this; return new Promise(function(resolve, reject) { return model.save(function(err, model) { if (err) { return reject(err); } ...
methods = $save: -> model = this new Promise (resolve, reject) -> model.save (err, model) -> return reject(err) if err resolve model $remove: -> model = this new Promise (resolve, reject) -> model.remove (err, model) -> return reject(err) if err resolve mo...
JavaScript
CoffeeScript
jianliaoim/talk-os
talk-account/server/schemas/index.coffee
MIT
2545c4497865779a55762e03963a39237df9046b
2,703
https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-account/server/schemas/index.coffee
88
108
jianliaoim/talk-os:talk-account/server/schemas/index.coffee:3:completion
completion
methods = $save: -> model = this new Promise (resolve, reject) -> model.save (err, model) -> return reject(err) if err resolve model $remove: -> model = this new Promise (resolve, reject) ->
model.remove (err, model) -> return reject(err) if err resolve model overwrites = {} schemas = User: require './user' Union: require './union' Email: require './email' Mobile: require './mobile'
CoffeeScript
CoffeeScript
jianliaoim/talk-os
talk-account/server/schemas/index.coffee
MIT
2545c4497865779a55762e03963a39237df9046b
2,703
https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-account/server/schemas/index.coffee
88
108
jianliaoim/talk-os:talk-account/test/util.coffee:1:raw_corpus
raw_corpus
Promise = require 'bluebird' _ = require 'lodash' path = require 'path' request = require 'supertest' BaseMailer = require '../server/mailers/base' BaseMailer.prototype._send = (email) -> util.checkEmail email limbo = require 'limbo' accountDB = limbo.use 'account' redis = require '../server/components/redis' app = r...
CoffeeScript
jianliaoim/talk-os
talk-account/test/util.coffee
MIT
2545c4497865779a55762e03963a39237df9046b
2,703
https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-account/test/util.coffee
1
50
jianliaoim/talk-os:talk-account/test/util.coffee:1:coffee_to_js
coffee_to_js
Convert this CoffeeScript to JavaScript. ```coffeescript Promise = require 'bluebird' _ = require 'lodash' path = require 'path' request = require 'supertest' BaseMailer = require '../server/mailers/base' BaseMailer.prototype._send = (email) -> util.checkEmail email limbo = require 'limbo' accountDB = limbo.use 'acco...
var BaseMailer, Promise, _, accountDB, app, limbo, path, redis, request, util; Promise = require('bluebird'); _ = require('lodash'); path = require('path'); request = require('supertest'); BaseMailer = require('../server/mailers/base'); BaseMailer.prototype._send = function(email) { return util.checkEmail(email...
CoffeeScript
JavaScript
jianliaoim/talk-os
talk-account/test/util.coffee
MIT
2545c4497865779a55762e03963a39237df9046b
2,703
https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-account/test/util.coffee
1
50
jianliaoim/talk-os:talk-account/test/util.coffee:1:js_to_coffee
js_to_coffee
Convert this JavaScript to CoffeeScript. ```javascript var BaseMailer, Promise, _, accountDB, app, limbo, path, redis, request, util; Promise = require('bluebird'); _ = require('lodash'); path = require('path'); request = require('supertest'); BaseMailer = require('../server/mailers/base'); BaseMailer.prototype._...
Promise = require 'bluebird' _ = require 'lodash' path = require 'path' request = require 'supertest' BaseMailer = require '../server/mailers/base' BaseMailer.prototype._send = (email) -> util.checkEmail email limbo = require 'limbo' accountDB = limbo.use 'account' redis = require '../server/components/redis' app = r...
JavaScript
CoffeeScript
jianliaoim/talk-os
talk-account/test/util.coffee
MIT
2545c4497865779a55762e03963a39237df9046b
2,703
https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-account/test/util.coffee
1
50
jianliaoim/talk-os:talk-account/test/util.coffee:1:completion
completion
Promise = require 'bluebird' _ = require 'lodash' path = require 'path' request = require 'supertest' BaseMailer = require '../server/mailers/base' BaseMailer.prototype._send = (email) -> util.checkEmail email limbo = require 'limbo' accountDB = limbo.use 'account' redis = require '../server/components/redis' app = r...
Promise.all [$cleanDB, $cleanRedis] .then -> done() .catch done request: (options, callback = ->) -> method = options.method?.toLowerCase() or 'get' options.body = JSON.stringify(options.body) if toString.call(options.body) is '[object Object]' options.headers = _.assign "Content-Type": "ap...
CoffeeScript
CoffeeScript
jianliaoim/talk-os
talk-account/test/util.coffee
MIT
2545c4497865779a55762e03963a39237df9046b
2,703
https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-account/test/util.coffee
1
50
gss/engine:spec/units.coffee:1:raw_corpus
raw_corpus
remove = (el) -> el?.parentNode?.removeChild(el) describe 'Units', -> engine = container = null beforeEach -> container = document.createElement 'div' document.getElementById('fixtures').appendChild container window.$engine = engine = new GSS(container) afterEach -> remove(container) desc...
CoffeeScript
gss/engine
spec/units.coffee
MIT
be430ea249f8030e11c8e03a8e170dcc8b8cf5fb
2,854
https://github.com/gss/engine/blob/be430ea249f8030e11c8e03a8e170dcc8b8cf5fb/spec/units.coffee
4
53
gss/engine:spec/units.coffee:1:coffee_to_js
coffee_to_js
Convert this CoffeeScript to JavaScript. ```coffeescript remove = (el) -> el?.parentNode?.removeChild(el) describe 'Units', -> engine = container = null beforeEach -> container = document.createElement 'div' document.getElementById('fixtures').appendChild container window.$engine = engine = new GSS...
var remove; remove = function(el) { var ref; return el != null ? (ref = el.parentNode) != null ? ref.removeChild(el) : void 0 : void 0; }; describe('Units', function() { var container, engine; engine = container = null; beforeEach(function() { container = document.createElement('div'); document.getE...
CoffeeScript
JavaScript
gss/engine
spec/units.coffee
MIT
be430ea249f8030e11c8e03a8e170dcc8b8cf5fb
2,854
https://github.com/gss/engine/blob/be430ea249f8030e11c8e03a8e170dcc8b8cf5fb/spec/units.coffee
4
53
gss/engine:spec/units.coffee:1:js_to_coffee
js_to_coffee
Convert this JavaScript to CoffeeScript. ```javascript var remove; remove = function(el) { var ref; return el != null ? (ref = el.parentNode) != null ? ref.removeChild(el) : void 0 : void 0; }; describe('Units', function() { var container, engine; engine = container = null; beforeEach(function() { conta...
remove = (el) -> el?.parentNode?.removeChild(el) describe 'Units', -> engine = container = null beforeEach -> container = document.createElement 'div' document.getElementById('fixtures').appendChild container window.$engine = engine = new GSS(container) afterEach -> remove(container) desc...
JavaScript
CoffeeScript
gss/engine
spec/units.coffee
MIT
be430ea249f8030e11c8e03a8e170dcc8b8cf5fb
2,854
https://github.com/gss/engine/blob/be430ea249f8030e11c8e03a8e170dcc8b8cf5fb/spec/units.coffee
4
53
gss/engine:spec/units.coffee:1:completion
completion
remove = (el) -> el?.parentNode?.removeChild(el) describe 'Units', -> engine = container = null beforeEach -> container = document.createElement 'div' document.getElementById('fixtures').appendChild container window.$engine = engine = new GSS(container) afterEach -> remove(container) desc...
</style> <button id="button1"></button> """ engine.then (solution)-> expect(solution).to.eql '$button1[width]': 40, '$button1[height]': 120 done() describe 'with unit', -> it 'should resolve constraints separately and ignore conflict', (do...
CoffeeScript
CoffeeScript
gss/engine
spec/units.coffee
MIT
be430ea249f8030e11c8e03a8e170dcc8b8cf5fb
2,854
https://github.com/gss/engine/blob/be430ea249f8030e11c8e03a8e170dcc8b8cf5fb/spec/units.coffee
4
53
gss/engine:spec/units.coffee:2:raw_corpus
raw_corpus
done() describe 'with non-linear expressions', -> describe 'with unit', -> it 'should be able to compute ratios', (done) -> container.innerHTML = """ <style type="text/gss-ast"> ["rule", ["tag", "button"], [ [">=", ["get", "width"], 50, "weak"], ["<...
CoffeeScript
gss/engine
spec/units.coffee
MIT
be430ea249f8030e11c8e03a8e170dcc8b8cf5fb
2,854
https://github.com/gss/engine/blob/be430ea249f8030e11c8e03a8e170dcc8b8cf5fb/spec/units.coffee
54
103
gss/engine:spec/units.coffee:2:completion
completion
done() describe 'with non-linear expressions', -> describe 'with unit', -> it 'should be able to compute ratios', (done) -> container.innerHTML = """ <style type="text/gss-ast"> ["rule", ["tag", "button"], [ [">=", ["get", "width"], 50, "weak"], ["<...
done() describe 'with dynamic units', -> describe 'bound to window', -> it 'should be able to compute width', (done) -> container.innerHTML = """ <style type="text/gss-ast"> ["rule", ["tag", "button"], [ ["==", ["get", "a"], 50], [">=", ["get", "wid...
CoffeeScript
CoffeeScript
gss/engine
spec/units.coffee
MIT
be430ea249f8030e11c8e03a8e170dcc8b8cf5fb
2,854
https://github.com/gss/engine/blob/be430ea249f8030e11c8e03a8e170dcc8b8cf5fb/spec/units.coffee
54
103
gss/engine:spec/units.coffee:3:raw_corpus
raw_corpus
expect(Math.round solution['$button1[width]']).to.eql(Math.round 1000 / 10) if h < 1000 expect(Math.round solution['$button1[c]']).to.eql(Math.round 1000 * 0.3) else expect(Math.round solution['$button1[d]']).to.eql(1000 * 0.33) engine.then (solution) -> ...
CoffeeScript
gss/engine
spec/units.coffee
MIT
be430ea249f8030e11c8e03a8e170dcc8b8cf5fb
2,854
https://github.com/gss/engine/blob/be430ea249f8030e11c8e03a8e170dcc8b8cf5fb/spec/units.coffee
104
153
gss/engine:spec/units.coffee:3:completion
completion
expect(Math.round solution['$button1[width]']).to.eql(Math.round 1000 / 10) if h < 1000 expect(Math.round solution['$button1[c]']).to.eql(Math.round 1000 * 0.3) else expect(Math.round solution['$button1[d]']).to.eql(1000 * 0.33) engine.then (solution) -> ...
engine.data.set('::window', 'width', 1000) describe 'bound to font-size', -> it 'should be able to compute width', (done) -> container.innerHTML = """ <style type="text/gss-ast"> ["rule", ["tag", "span"], [ [">=", ["get", "width"], ["em", 10]], [">=",...
CoffeeScript
CoffeeScript
gss/engine
spec/units.coffee
MIT
be430ea249f8030e11c8e03a8e170dcc8b8cf5fb
2,854
https://github.com/gss/engine/blob/be430ea249f8030e11c8e03a8e170dcc8b8cf5fb/spec/units.coffee
104
153
gss/engine:spec/units.coffee:4:raw_corpus
raw_corpus
engine.then (solution)-> expect(solution['$button1[width]']).to.eql null expect(solution['$button1[height]']).to.eql null expect(solution['$button1[c]']).to.eql null expect(Object.keys(engine.data.watchers)).to.eql [] done() engine.id('wra...
CoffeeScript
gss/engine
spec/units.coffee
MIT
be430ea249f8030e11c8e03a8e170dcc8b8cf5fb
2,854
https://github.com/gss/engine/blob/be430ea249f8030e11c8e03a8e170dcc8b8cf5fb/spec/units.coffee
154
162
gss/engine:spec/units.coffee:4:coffee_to_js
coffee_to_js
Convert this CoffeeScript to JavaScript. ```coffeescript engine.then (solution)-> expect(solution['$button1[width]']).to.eql null expect(solution['$button1[height]']).to.eql null expect(solution['$button1[c]']).to.eql null expect(Object.keys(engine.data.watchers))...
engine.then(function(solution) { expect(solution['$button1[width]']).to.eql(null); expect(solution['$button1[height]']).to.eql(null); expect(solution['$button1[c]']).to.eql(null); expect(Object.keys(engine.data.watchers)).to.eql([]); return done(); }); engine.id('wrapper').style.fontSize = '30px';
CoffeeScript
JavaScript
gss/engine
spec/units.coffee
MIT
be430ea249f8030e11c8e03a8e170dcc8b8cf5fb
2,854
https://github.com/gss/engine/blob/be430ea249f8030e11c8e03a8e170dcc8b8cf5fb/spec/units.coffee
154
162
gss/engine:spec/units.coffee:4:js_to_coffee
js_to_coffee
Convert this JavaScript to CoffeeScript. ```javascript engine.then(function(solution) { expect(solution['$button1[width]']).to.eql(null); expect(solution['$button1[height]']).to.eql(null); expect(solution['$button1[c]']).to.eql(null); expect(Object.keys(engine.data.watchers)).to.eql([]); return done(); }); e...
engine.then (solution)-> expect(solution['$button1[width]']).to.eql null expect(solution['$button1[height]']).to.eql null expect(solution['$button1[c]']).to.eql null expect(Object.keys(engine.data.watchers)).to.eql [] done() engine.id('wra...
JavaScript
CoffeeScript
gss/engine
spec/units.coffee
MIT
be430ea249f8030e11c8e03a8e170dcc8b8cf5fb
2,854
https://github.com/gss/engine/blob/be430ea249f8030e11c8e03a8e170dcc8b8cf5fb/spec/units.coffee
154
162
gss/engine:spec/units.coffee:4:completion
completion
engine.then (solution)-> expect(solution['$button1[width]']).to.eql null expect(solution['$button1[height]']).to.eql null expect(solution['$button1[c]']).to.eql null
expect(Object.keys(engine.data.watchers)).to.eql [] done() engine.id('wrapper').style.fontSize = '30px'
CoffeeScript
CoffeeScript
gss/engine
spec/units.coffee
MIT
be430ea249f8030e11c8e03a8e170dcc8b8cf5fb
2,854
https://github.com/gss/engine/blob/be430ea249f8030e11c8e03a8e170dcc8b8cf5fb/spec/units.coffee
154
162