id
stringlengths
34
124
type
stringclasses
4 values
prompt
stringlengths
0
4.95k
response
stringlengths
21
4.89k
source_lang
stringclasses
3 values
target_lang
stringclasses
2 values
repo
stringclasses
75 values
path
stringlengths
10
88
license
stringclasses
1 value
commit
stringlengths
40
40
stars
int64
431
18.7k
source_url
stringlengths
86
176
line_start
int64
1
214
line_end
int64
3
253
ExpediaGroup/cyclotron:cyclotron-site/app/scripts/dashboards/dataSources/dataSources.influxdb.coffee:3:coffee_to_js
coffee_to_js
Convert this CoffeeScript to JavaScript. ```coffeescript if result.statusCode != 200 return errorCallback result.body.error, result.statusCode data = [] # Translate from InfluxDB JSON format to Cyclotron format if !_.isEmpty result.body?.results if r...
var data, influxResult, proxyUri, ref, req; if (result.statusCode !== 200) { return errorCallback(result.body.error, result.statusCode); } data = []; if (!_.isEmpty((ref = result.body) != null ? ref.results : void 0)) { if (result.body.results.length > 1) { return errorCallback('Multiple InfluxDB queries are...
CoffeeScript
JavaScript
ExpediaGroup/cyclotron
cyclotron-site/app/scripts/dashboards/dataSources/dataSources.influxdb.coffee
MIT
c128079380a86b05d50e9b72359c79f3ee206810
1,544
https://github.com/ExpediaGroup/cyclotron/blob/c128079380a86b05d50e9b72359c79f3ee206810/cyclotron-site/app/scripts/dashboards/dataSources/dataSources.influxdb.coffee
84
122
ExpediaGroup/cyclotron:cyclotron-site/app/scripts/dashboards/dataSources/dataSources.influxdb.coffee:3:js_to_coffee
js_to_coffee
Convert this JavaScript to CoffeeScript. ```javascript var data, influxResult, proxyUri, ref, req; if (result.statusCode !== 200) { return errorCallback(result.body.error, result.statusCode); } data = []; if (!_.isEmpty((ref = result.body) != null ? ref.results : void 0)) { if (result.body.results.length > 1) { ...
if result.statusCode != 200 return errorCallback result.body.error, result.statusCode data = [] # Translate from InfluxDB JSON format to Cyclotron format if !_.isEmpty result.body?.results if result.body.results.length > 1 return ...
JavaScript
CoffeeScript
ExpediaGroup/cyclotron
cyclotron-site/app/scripts/dashboards/dataSources/dataSources.influxdb.coffee
MIT
c128079380a86b05d50e9b72359c79f3ee206810
1,544
https://github.com/ExpediaGroup/cyclotron/blob/c128079380a86b05d50e9b72359c79f3ee206810/cyclotron-site/app/scripts/dashboards/dataSources/dataSources.influxdb.coffee
84
122
ExpediaGroup/cyclotron:cyclotron-site/app/scripts/dashboards/dataSources/dataSources.influxdb.coffee:3:completion
completion
if result.statusCode != 200 return errorCallback result.body.error, result.statusCode data = [] # Translate from InfluxDB JSON format to Cyclotron format if !_.isEmpty result.body?.results if result.body.results.length > 1 return ...
data = data.concat(seriesData) q.resolve '0': data: data columns: null # Generate proxy URLs proxyUri = new URI(_.jsExec(options.proxy) || configService.restServiceUrl) .protocol '' # Remove protocol to work with eithe...
CoffeeScript
CoffeeScript
ExpediaGroup/cyclotron
cyclotron-site/app/scripts/dashboards/dataSources/dataSources.influxdb.coffee
MIT
c128079380a86b05d50e9b72359c79f3ee206810
1,544
https://github.com/ExpediaGroup/cyclotron/blob/c128079380a86b05d50e9b72359c79f3ee206810/cyclotron-site/app/scripts/dashboards/dataSources/dataSources.influxdb.coffee
84
122
Pagedraw/pagedraw:src/pdom.coffee:1:raw_corpus
raw_corpus
exports.pdom_tag_is_component = pdom_tag_is_component = (tag) -> not _l.isString(tag) exports.attrKey = attrKey = 'Attr' exports.constraintAttrs = constraintAttrs = ['horizontalLayoutType', 'verticalLayoutType', 'flexMarginTop', 'flexMarginLeft', 'flexMarginBottom', 'flexMarginRight'] exports.specialVPdomAttrs = speci...
CoffeeScript
Pagedraw/pagedraw
src/pdom.coffee
MIT
aba1bd1b8ef6bb7f58866a9d11ebb7f1e0e18a8e
3,558
https://github.com/Pagedraw/pagedraw/blob/aba1bd1b8ef6bb7f58866a9d11ebb7f1e0e18a8e/src/pdom.coffee
29
49
Pagedraw/pagedraw:src/pdom.coffee:1:coffee_to_js
coffee_to_js
Convert this CoffeeScript to JavaScript. ```coffeescript exports.pdom_tag_is_component = pdom_tag_is_component = (tag) -> not _l.isString(tag) exports.attrKey = attrKey = 'Attr' exports.constraintAttrs = constraintAttrs = ['horizontalLayoutType', 'verticalLayoutType', 'flexMarginTop', 'flexMarginLeft', 'flexMarginBott...
var attrKey, constraintAttrs, externalPositioningAttrs, media_query_attrs, nonDynamicableAttrs, pdom_tag_is_component, specialDivAttrs, specialVPdomAttrs; exports.pdom_tag_is_component = pdom_tag_is_component = function(tag) { return !_l.isString(tag); }; exports.attrKey = attrKey = 'Attr'; exports.constraintAttrs...
CoffeeScript
JavaScript
Pagedraw/pagedraw
src/pdom.coffee
MIT
aba1bd1b8ef6bb7f58866a9d11ebb7f1e0e18a8e
3,558
https://github.com/Pagedraw/pagedraw/blob/aba1bd1b8ef6bb7f58866a9d11ebb7f1e0e18a8e/src/pdom.coffee
29
49
Pagedraw/pagedraw:src/pdom.coffee:1:js_to_coffee
js_to_coffee
Convert this JavaScript to CoffeeScript. ```javascript var attrKey, constraintAttrs, externalPositioningAttrs, media_query_attrs, nonDynamicableAttrs, pdom_tag_is_component, specialDivAttrs, specialVPdomAttrs; exports.pdom_tag_is_component = pdom_tag_is_component = function(tag) { return !_l.isString(tag); }; expor...
exports.pdom_tag_is_component = pdom_tag_is_component = (tag) -> not _l.isString(tag) exports.attrKey = attrKey = 'Attr' exports.constraintAttrs = constraintAttrs = ['horizontalLayoutType', 'verticalLayoutType', 'flexMarginTop', 'flexMarginLeft', 'flexMarginBottom', 'flexMarginRight'] exports.specialVPdomAttrs = speci...
JavaScript
CoffeeScript
Pagedraw/pagedraw
src/pdom.coffee
MIT
aba1bd1b8ef6bb7f58866a9d11ebb7f1e0e18a8e
3,558
https://github.com/Pagedraw/pagedraw/blob/aba1bd1b8ef6bb7f58866a9d11ebb7f1e0e18a8e/src/pdom.coffee
29
49
Pagedraw/pagedraw:src/pdom.coffee:1:completion
completion
exports.pdom_tag_is_component = pdom_tag_is_component = (tag) -> not _l.isString(tag) exports.attrKey = attrKey = 'Attr' exports.constraintAttrs = constraintAttrs = ['horizontalLayoutType', 'verticalLayoutType', 'flexMarginTop', 'flexMarginLeft', 'flexMarginBottom', 'flexMarginRight'] exports.specialVPdomAttrs = speci...
'event_handlers' # [(name :: String, code :: String)]. *Should* only be on native elements 'link', 'openInNewTab', # click handlers and related 'repeat_variable', 'instance_variable', 'show_if', # co...
CoffeeScript
CoffeeScript
Pagedraw/pagedraw
src/pdom.coffee
MIT
aba1bd1b8ef6bb7f58866a9d11ebb7f1e0e18a8e
3,558
https://github.com/Pagedraw/pagedraw/blob/aba1bd1b8ef6bb7f58866a9d11ebb7f1e0e18a8e/src/pdom.coffee
29
49
Pagedraw/pagedraw:src/pdom.coffee:2:raw_corpus
raw_corpus
exports.walkPdom = walkPdom = (pdom, {preorder, postorder, ctx}) -> child_ctx = preorder?(pdom, ctx) accum = pdom.children.map((child) -> walkPdom(child, {preorder, postorder, ctx: child_ctx})) return postorder?(pdom, accum, ctx) # old implementation of foreachPdom
CoffeeScript
Pagedraw/pagedraw
src/pdom.coffee
MIT
aba1bd1b8ef6bb7f58866a9d11ebb7f1e0e18a8e
3,558
https://github.com/Pagedraw/pagedraw/blob/aba1bd1b8ef6bb7f58866a9d11ebb7f1e0e18a8e/src/pdom.coffee
52
57
Pagedraw/pagedraw:src/pdom.coffee:2:coffee_to_js
coffee_to_js
Convert this CoffeeScript to JavaScript. ```coffeescript exports.walkPdom = walkPdom = (pdom, {preorder, postorder, ctx}) -> child_ctx = preorder?(pdom, ctx) accum = pdom.children.map((child) -> walkPdom(child, {preorder, postorder, ctx: child_ctx})) return postorder?(pdom, accum, ctx) # old implementation...
var walkPdom; exports.walkPdom = walkPdom = function(pdom, {preorder, postorder, ctx}) { var accum, child_ctx; child_ctx = typeof preorder === "function" ? preorder(pdom, ctx) : void 0; accum = pdom.children.map(function(child) { return walkPdom(child, { preorder, postorder, ctx: child_ctx ...
CoffeeScript
JavaScript
Pagedraw/pagedraw
src/pdom.coffee
MIT
aba1bd1b8ef6bb7f58866a9d11ebb7f1e0e18a8e
3,558
https://github.com/Pagedraw/pagedraw/blob/aba1bd1b8ef6bb7f58866a9d11ebb7f1e0e18a8e/src/pdom.coffee
52
57
Pagedraw/pagedraw:src/pdom.coffee:2:js_to_coffee
js_to_coffee
Convert this JavaScript to CoffeeScript. ```javascript var walkPdom; exports.walkPdom = walkPdom = function(pdom, {preorder, postorder, ctx}) { var accum, child_ctx; child_ctx = typeof preorder === "function" ? preorder(pdom, ctx) : void 0; accum = pdom.children.map(function(child) { return walkPdom(child, {...
exports.walkPdom = walkPdom = (pdom, {preorder, postorder, ctx}) -> child_ctx = preorder?(pdom, ctx) accum = pdom.children.map((child) -> walkPdom(child, {preorder, postorder, ctx: child_ctx})) return postorder?(pdom, accum, ctx) # old implementation of foreachPdom
JavaScript
CoffeeScript
Pagedraw/pagedraw
src/pdom.coffee
MIT
aba1bd1b8ef6bb7f58866a9d11ebb7f1e0e18a8e
3,558
https://github.com/Pagedraw/pagedraw/blob/aba1bd1b8ef6bb7f58866a9d11ebb7f1e0e18a8e/src/pdom.coffee
52
57
Pagedraw/pagedraw:src/pdom.coffee:2:completion
completion
exports.walkPdom = walkPdom = (pdom, {preorder, postorder, ctx}) -> child_ctx = preorder?(pdom, ctx) accum = pdom.children.map((child) -> walkPdom(child, {preorder, postorder, ctx: child_ctx}))
return postorder?(pdom, accum, ctx) # old implementation of foreachPdom
CoffeeScript
CoffeeScript
Pagedraw/pagedraw
src/pdom.coffee
MIT
aba1bd1b8ef6bb7f58866a9d11ebb7f1e0e18a8e
3,558
https://github.com/Pagedraw/pagedraw/blob/aba1bd1b8ef6bb7f58866a9d11ebb7f1e0e18a8e/src/pdom.coffee
52
57
Pagedraw/pagedraw:src/pdom.coffee:3:raw_corpus
raw_corpus
slow_foreachPdom = (pdom, fn) -> walkPdom pdom, postorder: (pd) -> fn(pd)
CoffeeScript
Pagedraw/pagedraw
src/pdom.coffee
MIT
aba1bd1b8ef6bb7f58866a9d11ebb7f1e0e18a8e
3,558
https://github.com/Pagedraw/pagedraw/blob/aba1bd1b8ef6bb7f58866a9d11ebb7f1e0e18a8e/src/pdom.coffee
58
61
Pagedraw/pagedraw:src/pdom.coffee:3:coffee_to_js
coffee_to_js
Convert this CoffeeScript to JavaScript. ```coffeescript slow_foreachPdom = (pdom, fn) -> walkPdom pdom, postorder: (pd) -> fn(pd) ```
var slow_foreachPdom; slow_foreachPdom = function(pdom, fn) { return walkPdom(pdom, { postorder: function(pd) { return fn(pd); } }); };
CoffeeScript
JavaScript
Pagedraw/pagedraw
src/pdom.coffee
MIT
aba1bd1b8ef6bb7f58866a9d11ebb7f1e0e18a8e
3,558
https://github.com/Pagedraw/pagedraw/blob/aba1bd1b8ef6bb7f58866a9d11ebb7f1e0e18a8e/src/pdom.coffee
58
61
Pagedraw/pagedraw:src/pdom.coffee:3:js_to_coffee
js_to_coffee
Convert this JavaScript to CoffeeScript. ```javascript var slow_foreachPdom; slow_foreachPdom = function(pdom, fn) { return walkPdom(pdom, { postorder: function(pd) { return fn(pd); } }); }; ```
slow_foreachPdom = (pdom, fn) -> walkPdom pdom, postorder: (pd) -> fn(pd)
JavaScript
CoffeeScript
Pagedraw/pagedraw
src/pdom.coffee
MIT
aba1bd1b8ef6bb7f58866a9d11ebb7f1e0e18a8e
3,558
https://github.com/Pagedraw/pagedraw/blob/aba1bd1b8ef6bb7f58866a9d11ebb7f1e0e18a8e/src/pdom.coffee
58
61
Pagedraw/pagedraw:src/pdom.coffee:3:completion
completion
slow_foreachPdom = (pdom, fn) -> walkPdom pdom,
postorder: (pd) -> fn(pd)
CoffeeScript
CoffeeScript
Pagedraw/pagedraw
src/pdom.coffee
MIT
aba1bd1b8ef6bb7f58866a9d11ebb7f1e0e18a8e
3,558
https://github.com/Pagedraw/pagedraw/blob/aba1bd1b8ef6bb7f58866a9d11ebb7f1e0e18a8e/src/pdom.coffee
58
61
Pagedraw/pagedraw:src/pdom.coffee:4:raw_corpus
raw_corpus
exports.foreachPdom = foreachPdom = (pdom, fn) -> foreachPdom(child, fn) for child in pdom.children fn(pdom) # NOTE mapPdom is not pure: it does not make copies of nodes before handing them to fn
CoffeeScript
Pagedraw/pagedraw
src/pdom.coffee
MIT
aba1bd1b8ef6bb7f58866a9d11ebb7f1e0e18a8e
3,558
https://github.com/Pagedraw/pagedraw/blob/aba1bd1b8ef6bb7f58866a9d11ebb7f1e0e18a8e/src/pdom.coffee
63
67
Pagedraw/pagedraw:src/pdom.coffee:4:coffee_to_js
coffee_to_js
Convert this CoffeeScript to JavaScript. ```coffeescript exports.foreachPdom = foreachPdom = (pdom, fn) -> foreachPdom(child, fn) for child in pdom.children fn(pdom) # NOTE mapPdom is not pure: it does not make copies of nodes before handing them to fn ```
var foreachPdom; exports.foreachPdom = foreachPdom = function(pdom, fn) { var child, i, len, ref; ref = pdom.children; for (i = 0, len = ref.length; i < len; i++) { child = ref[i]; foreachPdom(child, fn); } return fn(pdom); }; // NOTE mapPdom is not pure: it does not make copies of nodes before hand...
CoffeeScript
JavaScript
Pagedraw/pagedraw
src/pdom.coffee
MIT
aba1bd1b8ef6bb7f58866a9d11ebb7f1e0e18a8e
3,558
https://github.com/Pagedraw/pagedraw/blob/aba1bd1b8ef6bb7f58866a9d11ebb7f1e0e18a8e/src/pdom.coffee
63
67
Pagedraw/pagedraw:src/pdom.coffee:4:js_to_coffee
js_to_coffee
Convert this JavaScript to CoffeeScript. ```javascript var foreachPdom; exports.foreachPdom = foreachPdom = function(pdom, fn) { var child, i, len, ref; ref = pdom.children; for (i = 0, len = ref.length; i < len; i++) { child = ref[i]; foreachPdom(child, fn); } return fn(pdom); }; // NOTE mapPdom is...
exports.foreachPdom = foreachPdom = (pdom, fn) -> foreachPdom(child, fn) for child in pdom.children fn(pdom) # NOTE mapPdom is not pure: it does not make copies of nodes before handing them to fn
JavaScript
CoffeeScript
Pagedraw/pagedraw
src/pdom.coffee
MIT
aba1bd1b8ef6bb7f58866a9d11ebb7f1e0e18a8e
3,558
https://github.com/Pagedraw/pagedraw/blob/aba1bd1b8ef6bb7f58866a9d11ebb7f1e0e18a8e/src/pdom.coffee
63
67
Pagedraw/pagedraw:src/pdom.coffee:5:raw_corpus
raw_corpus
exports.mapPdom = mapPdom = (pdom, fn) -> walkPdom pdom, postorder: (pd, children) -> # pd = _l.clone(pd) if you want mapPdom to be pure pd.children = children return fn(pd)
CoffeeScript
Pagedraw/pagedraw
src/pdom.coffee
MIT
aba1bd1b8ef6bb7f58866a9d11ebb7f1e0e18a8e
3,558
https://github.com/Pagedraw/pagedraw/blob/aba1bd1b8ef6bb7f58866a9d11ebb7f1e0e18a8e/src/pdom.coffee
68
72
Pagedraw/pagedraw:src/pdom.coffee:5:coffee_to_js
coffee_to_js
Convert this CoffeeScript to JavaScript. ```coffeescript exports.mapPdom = mapPdom = (pdom, fn) -> walkPdom pdom, postorder: (pd, children) -> # pd = _l.clone(pd) if you want mapPdom to be pure pd.children = children return fn(pd) ```
var mapPdom; exports.mapPdom = mapPdom = function(pdom, fn) { return walkPdom(pdom, { postorder: function(pd, children) { // pd = _l.clone(pd) if you want mapPdom to be pure pd.children = children; return fn(pd); } }); };
CoffeeScript
JavaScript
Pagedraw/pagedraw
src/pdom.coffee
MIT
aba1bd1b8ef6bb7f58866a9d11ebb7f1e0e18a8e
3,558
https://github.com/Pagedraw/pagedraw/blob/aba1bd1b8ef6bb7f58866a9d11ebb7f1e0e18a8e/src/pdom.coffee
68
72
Pagedraw/pagedraw:src/pdom.coffee:5:js_to_coffee
js_to_coffee
Convert this JavaScript to CoffeeScript. ```javascript var mapPdom; exports.mapPdom = mapPdom = function(pdom, fn) { return walkPdom(pdom, { postorder: function(pd, children) { // pd = _l.clone(pd) if you want mapPdom to be pure pd.children = children; return fn(pd); } }); }; ```
exports.mapPdom = mapPdom = (pdom, fn) -> walkPdom pdom, postorder: (pd, children) -> # pd = _l.clone(pd) if you want mapPdom to be pure pd.children = children return fn(pd)
JavaScript
CoffeeScript
Pagedraw/pagedraw
src/pdom.coffee
MIT
aba1bd1b8ef6bb7f58866a9d11ebb7f1e0e18a8e
3,558
https://github.com/Pagedraw/pagedraw/blob/aba1bd1b8ef6bb7f58866a9d11ebb7f1e0e18a8e/src/pdom.coffee
68
72
Pagedraw/pagedraw:src/pdom.coffee:5:completion
completion
exports.mapPdom = mapPdom = (pdom, fn) -> walkPdom pdom, postorder: (pd, children) ->
# pd = _l.clone(pd) if you want mapPdom to be pure pd.children = children return fn(pd)
CoffeeScript
CoffeeScript
Pagedraw/pagedraw
src/pdom.coffee
MIT
aba1bd1b8ef6bb7f58866a9d11ebb7f1e0e18a8e
3,558
https://github.com/Pagedraw/pagedraw/blob/aba1bd1b8ef6bb7f58866a9d11ebb7f1e0e18a8e/src/pdom.coffee
68
72
Pagedraw/pagedraw:src/pdom.coffee:7:raw_corpus
raw_corpus
exports.flattenedPdom = flattenedPdom = (pdom) -> nodes = [] foreachPdom pdom, (pd) -> nodes.push(pd) return nodes # find_pdom_where :: Pdom -> (Pdom -> Bool) -> Pdom # find_pdom_where = (pdom, fn) -> _l.head flattenedPdom(pdom).filter(fn)
CoffeeScript
Pagedraw/pagedraw
src/pdom.coffee
MIT
aba1bd1b8ef6bb7f58866a9d11ebb7f1e0e18a8e
3,558
https://github.com/Pagedraw/pagedraw/blob/aba1bd1b8ef6bb7f58866a9d11ebb7f1e0e18a8e/src/pdom.coffee
77
83
Pagedraw/pagedraw:src/pdom.coffee:7:coffee_to_js
coffee_to_js
Convert this CoffeeScript to JavaScript. ```coffeescript exports.flattenedPdom = flattenedPdom = (pdom) -> nodes = [] foreachPdom pdom, (pd) -> nodes.push(pd) return nodes # find_pdom_where :: Pdom -> (Pdom -> Bool) -> Pdom # find_pdom_where = (pdom, fn) -> _l.head flattenedPdom(pdom).filter(fn) ```
var flattenedPdom; exports.flattenedPdom = flattenedPdom = function(pdom) { var nodes; nodes = []; foreachPdom(pdom, function(pd) { return nodes.push(pd); }); return nodes; }; // find_pdom_where :: Pdom -> (Pdom -> Bool) -> Pdom // find_pdom_where = (pdom, fn) -> _l.head flattenedPdom(pdom).filter(fn)
CoffeeScript
JavaScript
Pagedraw/pagedraw
src/pdom.coffee
MIT
aba1bd1b8ef6bb7f58866a9d11ebb7f1e0e18a8e
3,558
https://github.com/Pagedraw/pagedraw/blob/aba1bd1b8ef6bb7f58866a9d11ebb7f1e0e18a8e/src/pdom.coffee
77
83
Pagedraw/pagedraw:src/pdom.coffee:7:js_to_coffee
js_to_coffee
Convert this JavaScript to CoffeeScript. ```javascript var flattenedPdom; exports.flattenedPdom = flattenedPdom = function(pdom) { var nodes; nodes = []; foreachPdom(pdom, function(pd) { return nodes.push(pd); }); return nodes; }; // find_pdom_where :: Pdom -> (Pdom -> Bool) -> Pdom // find_pdom_where =...
exports.flattenedPdom = flattenedPdom = (pdom) -> nodes = [] foreachPdom pdom, (pd) -> nodes.push(pd) return nodes # find_pdom_where :: Pdom -> (Pdom -> Bool) -> Pdom # find_pdom_where = (pdom, fn) -> _l.head flattenedPdom(pdom).filter(fn)
JavaScript
CoffeeScript
Pagedraw/pagedraw
src/pdom.coffee
MIT
aba1bd1b8ef6bb7f58866a9d11ebb7f1e0e18a8e
3,558
https://github.com/Pagedraw/pagedraw/blob/aba1bd1b8ef6bb7f58866a9d11ebb7f1e0e18a8e/src/pdom.coffee
77
83
Pagedraw/pagedraw:src/pdom.coffee:7:completion
completion
exports.flattenedPdom = flattenedPdom = (pdom) -> nodes = [] foreachPdom pdom, (pd) -> nodes.push(pd)
return nodes # find_pdom_where :: Pdom -> (Pdom -> Bool) -> Pdom # find_pdom_where = (pdom, fn) -> _l.head flattenedPdom(pdom).filter(fn)
CoffeeScript
CoffeeScript
Pagedraw/pagedraw
src/pdom.coffee
MIT
aba1bd1b8ef6bb7f58866a9d11ebb7f1e0e18a8e
3,558
https://github.com/Pagedraw/pagedraw/blob/aba1bd1b8ef6bb7f58866a9d11ebb7f1e0e18a8e/src/pdom.coffee
77
83
Pagedraw/pagedraw:src/pdom.coffee:8:raw_corpus
raw_corpus
exports.find_pdom_where = find_pdom_where = (tree, condition) -> found = null foreachPdom tree, (pd) -> if not found and condition(pd) == true found = pd return found
CoffeeScript
Pagedraw/pagedraw
src/pdom.coffee
MIT
aba1bd1b8ef6bb7f58866a9d11ebb7f1e0e18a8e
3,558
https://github.com/Pagedraw/pagedraw/blob/aba1bd1b8ef6bb7f58866a9d11ebb7f1e0e18a8e/src/pdom.coffee
84
89
Pagedraw/pagedraw:src/pdom.coffee:8:coffee_to_js
coffee_to_js
Convert this CoffeeScript to JavaScript. ```coffeescript exports.find_pdom_where = find_pdom_where = (tree, condition) -> found = null foreachPdom tree, (pd) -> if not found and condition(pd) == true found = pd return found ```
var find_pdom_where; exports.find_pdom_where = find_pdom_where = function(tree, condition) { var found; found = null; foreachPdom(tree, function(pd) { if (!found && condition(pd) === true) { return found = pd; } }); return found; };
CoffeeScript
JavaScript
Pagedraw/pagedraw
src/pdom.coffee
MIT
aba1bd1b8ef6bb7f58866a9d11ebb7f1e0e18a8e
3,558
https://github.com/Pagedraw/pagedraw/blob/aba1bd1b8ef6bb7f58866a9d11ebb7f1e0e18a8e/src/pdom.coffee
84
89
Pagedraw/pagedraw:src/pdom.coffee:8:js_to_coffee
js_to_coffee
Convert this JavaScript to CoffeeScript. ```javascript var find_pdom_where; exports.find_pdom_where = find_pdom_where = function(tree, condition) { var found; found = null; foreachPdom(tree, function(pd) { if (!found && condition(pd) === true) { return found = pd; } }); return found; }; ```
exports.find_pdom_where = find_pdom_where = (tree, condition) -> found = null foreachPdom tree, (pd) -> if not found and condition(pd) == true found = pd return found
JavaScript
CoffeeScript
Pagedraw/pagedraw
src/pdom.coffee
MIT
aba1bd1b8ef6bb7f58866a9d11ebb7f1e0e18a8e
3,558
https://github.com/Pagedraw/pagedraw/blob/aba1bd1b8ef6bb7f58866a9d11ebb7f1e0e18a8e/src/pdom.coffee
84
89
Pagedraw/pagedraw:src/pdom.coffee:8:completion
completion
exports.find_pdom_where = find_pdom_where = (tree, condition) -> found = null foreachPdom tree, (pd) ->
if not found and condition(pd) == true found = pd return found
CoffeeScript
CoffeeScript
Pagedraw/pagedraw
src/pdom.coffee
MIT
aba1bd1b8ef6bb7f58866a9d11ebb7f1e0e18a8e
3,558
https://github.com/Pagedraw/pagedraw/blob/aba1bd1b8ef6bb7f58866a9d11ebb7f1e0e18a8e/src/pdom.coffee
84
89
Pagedraw/pagedraw:src/pdom.coffee:9:raw_corpus
raw_corpus
exports.clonePdom = clonePdom = (pdom) -> _l.cloneDeepWith pdom, (value) -> # backingBlocks should be cloned by reference, everything else by value if value instanceof Block return value.getBlock() else if value instanceof Dynamic return new Dynamic(value.code, value.dynamicable) else ...
CoffeeScript
Pagedraw/pagedraw
src/pdom.coffee
MIT
aba1bd1b8ef6bb7f58866a9d11ebb7f1e0e18a8e
3,558
https://github.com/Pagedraw/pagedraw/blob/aba1bd1b8ef6bb7f58866a9d11ebb7f1e0e18a8e/src/pdom.coffee
91
111
Pagedraw/pagedraw:src/pdom.coffee:9:coffee_to_js
coffee_to_js
Convert this CoffeeScript to JavaScript. ```coffeescript exports.clonePdom = clonePdom = (pdom) -> _l.cloneDeepWith pdom, (value) -> # backingBlocks should be cloned by reference, everything else by value if value instanceof Block return value.getBlock() else if value instanceof Dynamic ret...
var clonePdom; exports.clonePdom = clonePdom = function(pdom) { return _l.cloneDeepWith(pdom, function(value) { // backingBlocks should be cloned by reference, everything else by value if (value instanceof Block) { return value.getBlock(); } else if (value instanceof Dynamic) { return new Dyn...
CoffeeScript
JavaScript
Pagedraw/pagedraw
src/pdom.coffee
MIT
aba1bd1b8ef6bb7f58866a9d11ebb7f1e0e18a8e
3,558
https://github.com/Pagedraw/pagedraw/blob/aba1bd1b8ef6bb7f58866a9d11ebb7f1e0e18a8e/src/pdom.coffee
91
111
Pagedraw/pagedraw:src/pdom.coffee:9:js_to_coffee
js_to_coffee
Convert this JavaScript to CoffeeScript. ```javascript var clonePdom; exports.clonePdom = clonePdom = function(pdom) { return _l.cloneDeepWith(pdom, function(value) { // backingBlocks should be cloned by reference, everything else by value if (value instanceof Block) { return value.getBlock(); } el...
exports.clonePdom = clonePdom = (pdom) -> _l.cloneDeepWith pdom, (value) -> # backingBlocks should be cloned by reference, everything else by value if value instanceof Block return value.getBlock() else if value instanceof Dynamic return new Dynamic(value.code, value.dynamicable) else ...
JavaScript
CoffeeScript
Pagedraw/pagedraw
src/pdom.coffee
MIT
aba1bd1b8ef6bb7f58866a9d11ebb7f1e0e18a8e
3,558
https://github.com/Pagedraw/pagedraw/blob/aba1bd1b8ef6bb7f58866a9d11ebb7f1e0e18a8e/src/pdom.coffee
91
111
Pagedraw/pagedraw:src/pdom.coffee:9:completion
completion
exports.clonePdom = clonePdom = (pdom) -> _l.cloneDeepWith pdom, (value) -> # backingBlocks should be cloned by reference, everything else by value if value instanceof Block return value.getBlock() else if value instanceof Dynamic return new Dynamic(value.code, value.dynamicable) else ...
else # returning undefined tells the cloning function to # do it's default thing to clone this value, and recurse return undefined # assert -> forall pdom, (pdom) -> pdom == _l.fromPairs( # styleForDiv(pdom) + htmlAttrsForPdom(pdom).map(([p,v])->["#{p}Attr", v]) + _l.pick(pdom, specialDivAttrs...
CoffeeScript
CoffeeScript
Pagedraw/pagedraw
src/pdom.coffee
MIT
aba1bd1b8ef6bb7f58866a9d11ebb7f1e0e18a8e
3,558
https://github.com/Pagedraw/pagedraw/blob/aba1bd1b8ef6bb7f58866a9d11ebb7f1e0e18a8e/src/pdom.coffee
91
111
Pagedraw/pagedraw:src/pdom.coffee:10:raw_corpus
raw_corpus
exports.attr_members_of_pdom = attr_members_of_pdom = (pdom) -> ( [key, key.slice(0, key.length - attrKey.length)] \ for own key, value of pdom \ when key.endsWith(attrKey) and value? and value != "" ) # htmlAttrsForPdom :: pdom -> {string: string|Dynamicable} # for all ...
CoffeeScript
Pagedraw/pagedraw
src/pdom.coffee
MIT
aba1bd1b8ef6bb7f58866a9d11ebb7f1e0e18a8e
3,558
https://github.com/Pagedraw/pagedraw/blob/aba1bd1b8ef6bb7f58866a9d11ebb7f1e0e18a8e/src/pdom.coffee
112
121
Pagedraw/pagedraw:src/pdom.coffee:10:coffee_to_js
coffee_to_js
Convert this CoffeeScript to JavaScript. ```coffeescript exports.attr_members_of_pdom = attr_members_of_pdom = (pdom) -> ( [key, key.slice(0, key.length - attrKey.length)] \ for own key, value of pdom \ when key.endsWith(attrKey) and value? and value != "" ) # htmlAttrsF...
var attr_members_of_pdom, hasProp = {}.hasOwnProperty; exports.attr_members_of_pdom = attr_members_of_pdom = function(pdom) { var key, results, value; results = []; for (key in pdom) { if (!hasProp.call(pdom, key)) continue; value = pdom[key]; if (key.endsWith(attrKey) && (value != null) && value !...
CoffeeScript
JavaScript
Pagedraw/pagedraw
src/pdom.coffee
MIT
aba1bd1b8ef6bb7f58866a9d11ebb7f1e0e18a8e
3,558
https://github.com/Pagedraw/pagedraw/blob/aba1bd1b8ef6bb7f58866a9d11ebb7f1e0e18a8e/src/pdom.coffee
112
121
Pagedraw/pagedraw:src/pdom.coffee:10:js_to_coffee
js_to_coffee
Convert this JavaScript to CoffeeScript. ```javascript var attr_members_of_pdom, hasProp = {}.hasOwnProperty; exports.attr_members_of_pdom = attr_members_of_pdom = function(pdom) { var key, results, value; results = []; for (key in pdom) { if (!hasProp.call(pdom, key)) continue; value = pdom[key]; ...
exports.attr_members_of_pdom = attr_members_of_pdom = (pdom) -> ( [key, key.slice(0, key.length - attrKey.length)] \ for own key, value of pdom \ when key.endsWith(attrKey) and value? and value != "" ) # htmlAttrsForPdom :: pdom -> {string: string|Dynamicable} # for all ...
JavaScript
CoffeeScript
Pagedraw/pagedraw
src/pdom.coffee
MIT
aba1bd1b8ef6bb7f58866a9d11ebb7f1e0e18a8e
3,558
https://github.com/Pagedraw/pagedraw/blob/aba1bd1b8ef6bb7f58866a9d11ebb7f1e0e18a8e/src/pdom.coffee
112
121
Pagedraw/pagedraw:src/pdom.coffee:11:raw_corpus
raw_corpus
exports.htmlAttrsForPdom = htmlAttrsForPdom = (pdom) -> _l.fromPairs (for own key, value of pdom continue unless key.endsWith(attrKey) continue if not value? continue if value == "" [key.slice(0, key.length - attrKey.length), if _l.isString(value) then value ...
CoffeeScript
Pagedraw/pagedraw
src/pdom.coffee
MIT
aba1bd1b8ef6bb7f58866a9d11ebb7f1e0e18a8e
3,558
https://github.com/Pagedraw/pagedraw/blob/aba1bd1b8ef6bb7f58866a9d11ebb7f1e0e18a8e/src/pdom.coffee
122
135
Pagedraw/pagedraw:src/pdom.coffee:11:coffee_to_js
coffee_to_js
Convert this CoffeeScript to JavaScript. ```coffeescript exports.htmlAttrsForPdom = htmlAttrsForPdom = (pdom) -> _l.fromPairs (for own key, value of pdom continue unless key.endsWith(attrKey) continue if not value? continue if value == "" [key.slice(0, key.length - attrKey.length), ...
var htmlAttrsForPdom, hasProp = {}.hasOwnProperty; exports.htmlAttrsForPdom = htmlAttrsForPdom = function(pdom) { var key, value; return _l.fromPairs((function() { var results; results = []; for (key in pdom) { if (!hasProp.call(pdom, key)) continue; value = pdom[key]; if (!key.ends...
CoffeeScript
JavaScript
Pagedraw/pagedraw
src/pdom.coffee
MIT
aba1bd1b8ef6bb7f58866a9d11ebb7f1e0e18a8e
3,558
https://github.com/Pagedraw/pagedraw/blob/aba1bd1b8ef6bb7f58866a9d11ebb7f1e0e18a8e/src/pdom.coffee
122
135
Pagedraw/pagedraw:src/pdom.coffee:11:js_to_coffee
js_to_coffee
Convert this JavaScript to CoffeeScript. ```javascript var htmlAttrsForPdom, hasProp = {}.hasOwnProperty; exports.htmlAttrsForPdom = htmlAttrsForPdom = function(pdom) { var key, value; return _l.fromPairs((function() { var results; results = []; for (key in pdom) { if (!hasProp.call(pdom, key))...
exports.htmlAttrsForPdom = htmlAttrsForPdom = (pdom) -> _l.fromPairs (for own key, value of pdom continue unless key.endsWith(attrKey) continue if not value? continue if value == "" [key.slice(0, key.length - attrKey.length), if _l.isString(value) then value ...
JavaScript
CoffeeScript
Pagedraw/pagedraw
src/pdom.coffee
MIT
aba1bd1b8ef6bb7f58866a9d11ebb7f1e0e18a8e
3,558
https://github.com/Pagedraw/pagedraw/blob/aba1bd1b8ef6bb7f58866a9d11ebb7f1e0e18a8e/src/pdom.coffee
122
135
Pagedraw/pagedraw:src/pdom.coffee:11:completion
completion
exports.htmlAttrsForPdom = htmlAttrsForPdom = (pdom) -> _l.fromPairs (for own key, value of pdom continue unless key.endsWith(attrKey) continue if not value? continue if value == "" [key.slice(0, key.length - attrKey.length), if _l.isString(value) then value
else if value instanceof Dynamic then value else if _l.isNumber(value) then String(value) else if _l.isBoolean(value) then String(value) else if _l.isFunction(value) then value else throw new Error("#{JSON.stringify value} is not a valid pdom html attr") ] )
CoffeeScript
CoffeeScript
Pagedraw/pagedraw
src/pdom.coffee
MIT
aba1bd1b8ef6bb7f58866a9d11ebb7f1e0e18a8e
3,558
https://github.com/Pagedraw/pagedraw/blob/aba1bd1b8ef6bb7f58866a9d11ebb7f1e0e18a8e/src/pdom.coffee
122
135
Pagedraw/pagedraw:src/pdom.coffee:13:raw_corpus
raw_corpus
exports.styleForDiv = styleForDiv = (div) -> _.object(for prop in styleMembersOfPdom(div) val = div[prop] if val instanceof Font val = val.get_css_string() if val? == false or val == "" continue # don't clutter the css [prop, val] )
CoffeeScript
Pagedraw/pagedraw
src/pdom.coffee
MIT
aba1bd1b8ef6bb7f58866a9d11ebb7f1e0e18a8e
3,558
https://github.com/Pagedraw/pagedraw/blob/aba1bd1b8ef6bb7f58866a9d11ebb7f1e0e18a8e/src/pdom.coffee
140
150
Pagedraw/pagedraw:src/pdom.coffee:13:coffee_to_js
coffee_to_js
Convert this CoffeeScript to JavaScript. ```coffeescript exports.styleForDiv = styleForDiv = (div) -> _.object(for prop in styleMembersOfPdom(div) val = div[prop] if val instanceof Font val = val.get_css_string() if val? == false or val == "" continue # don't clutter...
var styleForDiv; exports.styleForDiv = styleForDiv = function(div) { var prop, val; return _.object((function() { var i, len, ref, results; ref = styleMembersOfPdom(div); results = []; for (i = 0, len = ref.length; i < len; i++) { prop = ref[i]; val = div[prop]; if (val instanceof...
CoffeeScript
JavaScript
Pagedraw/pagedraw
src/pdom.coffee
MIT
aba1bd1b8ef6bb7f58866a9d11ebb7f1e0e18a8e
3,558
https://github.com/Pagedraw/pagedraw/blob/aba1bd1b8ef6bb7f58866a9d11ebb7f1e0e18a8e/src/pdom.coffee
140
150
Pagedraw/pagedraw:src/pdom.coffee:13:js_to_coffee
js_to_coffee
Convert this JavaScript to CoffeeScript. ```javascript var styleForDiv; exports.styleForDiv = styleForDiv = function(div) { var prop, val; return _.object((function() { var i, len, ref, results; ref = styleMembersOfPdom(div); results = []; for (i = 0, len = ref.length; i < len; i++) { prop = ...
exports.styleForDiv = styleForDiv = (div) -> _.object(for prop in styleMembersOfPdom(div) val = div[prop] if val instanceof Font val = val.get_css_string() if val? == false or val == "" continue # don't clutter the css [prop, val] )
JavaScript
CoffeeScript
Pagedraw/pagedraw
src/pdom.coffee
MIT
aba1bd1b8ef6bb7f58866a9d11ebb7f1e0e18a8e
3,558
https://github.com/Pagedraw/pagedraw/blob/aba1bd1b8ef6bb7f58866a9d11ebb7f1e0e18a8e/src/pdom.coffee
140
150
Pagedraw/pagedraw:src/pdom.coffee:13:completion
completion
exports.styleForDiv = styleForDiv = (div) -> _.object(for prop in styleMembersOfPdom(div) val = div[prop] if val instanceof Font val = val.get_css_string()
if val? == false or val == "" continue # don't clutter the css [prop, val] )
CoffeeScript
CoffeeScript
Pagedraw/pagedraw
src/pdom.coffee
MIT
aba1bd1b8ef6bb7f58866a9d11ebb7f1e0e18a8e
3,558
https://github.com/Pagedraw/pagedraw/blob/aba1bd1b8ef6bb7f58866a9d11ebb7f1e0e18a8e/src/pdom.coffee
140
150
Pagedraw/pagedraw:src/pdom.coffee:14:raw_corpus
raw_corpus
exports.serialize_pdom = serialize_pdom = (pdom) -> _l.extend _l.omit(pdom, ['children', 'backingBlock', 'tag', 'props']), { backingBlock: pdom.backingBlock?.serialize(), children: pdom.children.map(serialize_pdom) tag: if pdom.tag.serialize? then _l.extend {}, pdom.tag.serialize(), {isComponent: tr...
CoffeeScript
Pagedraw/pagedraw
src/pdom.coffee
MIT
aba1bd1b8ef6bb7f58866a9d11ebb7f1e0e18a8e
3,558
https://github.com/Pagedraw/pagedraw/blob/aba1bd1b8ef6bb7f58866a9d11ebb7f1e0e18a8e/src/pdom.coffee
152
158
Pagedraw/pagedraw:src/pdom.coffee:14:coffee_to_js
coffee_to_js
Convert this CoffeeScript to JavaScript. ```coffeescript exports.serialize_pdom = serialize_pdom = (pdom) -> _l.extend _l.omit(pdom, ['children', 'backingBlock', 'tag', 'props']), { backingBlock: pdom.backingBlock?.serialize(), children: pdom.children.map(serialize_pdom) tag: if pdom.tag.serialize? ...
var serialize_pdom; exports.serialize_pdom = serialize_pdom = function(pdom) { var ref; return _l.extend(_l.omit(pdom, ['children', 'backingBlock', 'tag', 'props']), { backingBlock: (ref = pdom.backingBlock) != null ? ref.serialize() : void 0, children: pdom.children.map(serialize_pdom), tag: pdom.tag....
CoffeeScript
JavaScript
Pagedraw/pagedraw
src/pdom.coffee
MIT
aba1bd1b8ef6bb7f58866a9d11ebb7f1e0e18a8e
3,558
https://github.com/Pagedraw/pagedraw/blob/aba1bd1b8ef6bb7f58866a9d11ebb7f1e0e18a8e/src/pdom.coffee
152
158
Pagedraw/pagedraw:src/pdom.coffee:14:js_to_coffee
js_to_coffee
Convert this JavaScript to CoffeeScript. ```javascript var serialize_pdom; exports.serialize_pdom = serialize_pdom = function(pdom) { var ref; return _l.extend(_l.omit(pdom, ['children', 'backingBlock', 'tag', 'props']), { backingBlock: (ref = pdom.backingBlock) != null ? ref.serialize() : void 0, children...
exports.serialize_pdom = serialize_pdom = (pdom) -> _l.extend _l.omit(pdom, ['children', 'backingBlock', 'tag', 'props']), { backingBlock: pdom.backingBlock?.serialize(), children: pdom.children.map(serialize_pdom) tag: if pdom.tag.serialize? then _l.extend {}, pdom.tag.serialize(), {isComponent: tr...
JavaScript
CoffeeScript
Pagedraw/pagedraw
src/pdom.coffee
MIT
aba1bd1b8ef6bb7f58866a9d11ebb7f1e0e18a8e
3,558
https://github.com/Pagedraw/pagedraw/blob/aba1bd1b8ef6bb7f58866a9d11ebb7f1e0e18a8e/src/pdom.coffee
152
158
Pagedraw/pagedraw:src/pdom.coffee:14:completion
completion
exports.serialize_pdom = serialize_pdom = (pdom) -> _l.extend _l.omit(pdom, ['children', 'backingBlock', 'tag', 'props']), { backingBlock: pdom.backingBlock?.serialize(), children: pdom.children.map(serialize_pdom)
tag: if pdom.tag.serialize? then _l.extend {}, pdom.tag.serialize(), {isComponent: true} else pdom.tag # Our props might contain a pdom. FIXME: Might not be toplevel props: if isExternalComponent(pdom.tag) then _l.mapValues(pdom.props, (val) -> if val.tag? then serialize_pdom(val) else val) }
CoffeeScript
CoffeeScript
Pagedraw/pagedraw
src/pdom.coffee
MIT
aba1bd1b8ef6bb7f58866a9d11ebb7f1e0e18a8e
3,558
https://github.com/Pagedraw/pagedraw/blob/aba1bd1b8ef6bb7f58866a9d11ebb7f1e0e18a8e/src/pdom.coffee
152
158
gss/engine:spec/styles.coffee:1:raw_corpus
raw_corpus
expect = chai.expect assert = chai.assert describe 'Styles', -> doc = engine = null before -> engine ||= new GSS(document.createElement('div')) engine.compile() doc = {} for property, value of engine.output.properties do (property, value) -> doc[property] = -> value.apply(e...
CoffeeScript
gss/engine
spec/styles.coffee
MIT
be430ea249f8030e11c8e03a8e170dcc8b8cf5fb
2,854
https://github.com/gss/engine/blob/be430ea249f8030e11c8e03a8e170dcc8b8cf5fb/spec/styles.coffee
1
47
gss/engine:spec/styles.coffee:1:coffee_to_js
coffee_to_js
Convert this CoffeeScript to JavaScript. ```coffeescript expect = chai.expect assert = chai.assert describe 'Styles', -> doc = engine = null before -> engine ||= new GSS(document.createElement('div')) engine.compile() doc = {} for property, value of engine.output.properties do (property, val...
var assert, expect; expect = chai.expect; assert = chai.assert; describe('Styles', function() { var doc, engine; doc = engine = null; before(function() { var property, ref, results, value; engine || (engine = new GSS(document.createElement('div'))); engine.compile(); doc = {}; ref = engine....
CoffeeScript
JavaScript
gss/engine
spec/styles.coffee
MIT
be430ea249f8030e11c8e03a8e170dcc8b8cf5fb
2,854
https://github.com/gss/engine/blob/be430ea249f8030e11c8e03a8e170dcc8b8cf5fb/spec/styles.coffee
1
47
gss/engine:spec/styles.coffee:1:js_to_coffee
js_to_coffee
Convert this JavaScript to CoffeeScript. ```javascript var assert, expect; expect = chai.expect; assert = chai.assert; describe('Styles', function() { var doc, engine; doc = engine = null; before(function() { var property, ref, results, value; engine || (engine = new GSS(document.createElement('div')))...
expect = chai.expect assert = chai.assert describe 'Styles', -> doc = engine = null before -> engine ||= new GSS(document.createElement('div')) engine.compile() doc = {} for property, value of engine.output.properties do (property, value) -> doc[property] = -> value.apply(e...
JavaScript
CoffeeScript
gss/engine
spec/styles.coffee
MIT
be430ea249f8030e11c8e03a8e170dcc8b8cf5fb
2,854
https://github.com/gss/engine/blob/be430ea249f8030e11c8e03a8e170dcc8b8cf5fb/spec/styles.coffee
1
47
gss/engine:spec/styles.coffee:1:completion
completion
expect = chai.expect assert = chai.assert describe 'Styles', -> doc = engine = null before -> engine ||= new GSS(document.createElement('div')) engine.compile() doc = {} for property, value of engine.output.properties do (property, value) -> doc[property] = -> value.apply(e...
it 'length & percentage', -> expect(doc['font-size'](10)).to.eql(10) expect(doc['font-size'](['em', 10])).to.eql(['em', 10]) expect(doc['font-size'](['%', 10])).to.eql(['%', 10]) expect(doc['font-size'](['s', 10])).to.eql(undefined) it 'keywords', -> expect(doc['float']('none')).to.eq...
CoffeeScript
CoffeeScript
gss/engine
spec/styles.coffee
MIT
be430ea249f8030e11c8e03a8e170dcc8b8cf5fb
2,854
https://github.com/gss/engine/blob/be430ea249f8030e11c8e03a8e170dcc8b8cf5fb/spec/styles.coffee
1
47
gss/engine:spec/styles.coffee:2:raw_corpus
raw_corpus
expect(doc['background']('top', 'right', 'padding-box', 'border-box',['linear-gradient', ['to', 'top', 'right']])).to.eql new doc['background'].initial 'background-position-y': 'top' 'background-position-x': 'right' 'background-origin': 'padding-box' 'background-clip': 'border-box' ...
CoffeeScript
gss/engine
spec/styles.coffee
MIT
be430ea249f8030e11c8e03a8e170dcc8b8cf5fb
2,854
https://github.com/gss/engine/blob/be430ea249f8030e11c8e03a8e170dcc8b8cf5fb/spec/styles.coffee
49
87
gss/engine:spec/styles.coffee:2:coffee_to_js
coffee_to_js
Convert this CoffeeScript to JavaScript. ```coffeescript expect(doc['background']('top', 'right', 'padding-box', 'border-box',['linear-gradient', ['to', 'top', 'right']])).to.eql new doc['background'].initial 'background-position-y': 'top' 'background-position-x': 'right' 'background-origin': '...
expect(doc['background']('top', 'right', 'padding-box', 'border-box', ['linear-gradient', ['to', 'top', 'right']])).to.eql(new doc['background'].initial({ 'background-position-y': 'top', 'background-position-x': 'right', 'background-origin': 'padding-box', 'background-clip': 'border-box', 'background-image': ...
CoffeeScript
JavaScript
gss/engine
spec/styles.coffee
MIT
be430ea249f8030e11c8e03a8e170dcc8b8cf5fb
2,854
https://github.com/gss/engine/blob/be430ea249f8030e11c8e03a8e170dcc8b8cf5fb/spec/styles.coffee
49
87
gss/engine:spec/styles.coffee:2:js_to_coffee
js_to_coffee
Convert this JavaScript to CoffeeScript. ```javascript expect(doc['background']('top', 'right', 'padding-box', 'border-box', ['linear-gradient', ['to', 'top', 'right']])).to.eql(new doc['background'].initial({ 'background-position-y': 'top', 'background-position-x': 'right', 'background-origin': 'padding-box', ...
expect(doc['background']('top', 'right', 'padding-box', 'border-box',['linear-gradient', ['to', 'top', 'right']])).to.eql new doc['background'].initial 'background-position-y': 'top' 'background-position-x': 'right' 'background-origin': 'padding-box' 'background-clip': 'border-box' ...
JavaScript
CoffeeScript
gss/engine
spec/styles.coffee
MIT
be430ea249f8030e11c8e03a8e170dcc8b8cf5fb
2,854
https://github.com/gss/engine/blob/be430ea249f8030e11c8e03a8e170dcc8b8cf5fb/spec/styles.coffee
49
87
gss/engine:spec/styles.coffee:2:completion
completion
expect(doc['background']('top', 'right', 'padding-box', 'border-box',['linear-gradient', ['to', 'top', 'right']])).to.eql new doc['background'].initial 'background-position-y': 'top' 'background-position-x': 'right' 'background-origin': 'padding-box' 'background-clip': 'border-box' ...
"background-image-2": ['url', 'abc'] )).to.eql 'no-repeat, url(abc) repeat transparent' expect(doc['background'](['no-repeat'], ['repeat'], 'transparent').format( "background-repeat-2": "repeat-y" )).to.eql 'no-repeat, repeat-y transparent' expect(doc['background'](['no-repeat'], ['repea...
CoffeeScript
CoffeeScript
gss/engine
spec/styles.coffee
MIT
be430ea249f8030e11c8e03a8e170dcc8b8cf5fb
2,854
https://github.com/gss/engine/blob/be430ea249f8030e11c8e03a8e170dcc8b8cf5fb/spec/styles.coffee
49
87
gss/engine:spec/styles.coffee:3:raw_corpus
raw_corpus
expect(doc['box-shadow']([1,1,'transparent'], [2,2,['rgba', 1,1,1]]).format()).to. eql '1px 1px transparent, 2px 2px rgba(1,1,1)' expect(doc['box-shadow']([1,1,'transparent'], [2,2,['rgba', 1,1,1]]).format( 'box-shadow-offset-x-1': -1 'box-shadow-offset-y-2': -2 )).to.eql '-1px 1px ...
CoffeeScript
gss/engine
spec/styles.coffee
MIT
be430ea249f8030e11c8e03a8e170dcc8b8cf5fb
2,854
https://github.com/gss/engine/blob/be430ea249f8030e11c8e03a8e170dcc8b8cf5fb/spec/styles.coffee
89
138
gss/engine:spec/styles.coffee:3:completion
completion
expect(doc['box-shadow']([1,1,'transparent'], [2,2,['rgba', 1,1,1]]).format()).to. eql '1px 1px transparent, 2px 2px rgba(1,1,1)' expect(doc['box-shadow']([1,1,'transparent'], [2,2,['rgba', 1,1,1]]).format( 'box-shadow-offset-x-1': -1 'box-shadow-offset-y-2': -2 )).to.eql '-1px 1px ...
describe 'dimensional shorthands', -> it 'should validate, pad and expand values', -> expect(doc['margin'](1)).to.eql new doc['margin'].initial 'margin-top': 1, 'margin-right': 1 'margin-bottom': 1 'margin-left': 1 expect(doc['padding'](1, ['cm', 2])).to.eql new doc['padd...
CoffeeScript
CoffeeScript
gss/engine
spec/styles.coffee
MIT
be430ea249f8030e11c8e03a8e170dcc8b8cf5fb
2,854
https://github.com/gss/engine/blob/be430ea249f8030e11c8e03a8e170dcc8b8cf5fb/spec/styles.coffee
89
138
gss/engine:spec/styles.coffee:5:raw_corpus
raw_corpus
xdescribe 'transformations', -> it 'should generate matrix', -> engine.solve [ ['rotateX', ['deg', 10]] ['scaleZ', 2] ['translateY', -2] ] expect(doc['transform']()).to.eql 123
CoffeeScript
gss/engine
spec/styles.coffee
MIT
be430ea249f8030e11c8e03a8e170dcc8b8cf5fb
2,854
https://github.com/gss/engine/blob/be430ea249f8030e11c8e03a8e170dcc8b8cf5fb/spec/styles.coffee
149
156
gss/engine:spec/styles.coffee:5:coffee_to_js
coffee_to_js
Convert this CoffeeScript to JavaScript. ```coffeescript xdescribe 'transformations', -> it 'should generate matrix', -> engine.solve [ ['rotateX', ['deg', 10]] ['scaleZ', 2] ['translateY', -2] ] expect(doc['transform']()).to.eql 123 ```
xdescribe('transformations', function() { return it('should generate matrix', function() { engine.solve([['rotateX', ['deg', 10]], ['scaleZ', 2], ['translateY', -2]]); return expect(doc['transform']()).to.eql(123); }); });
CoffeeScript
JavaScript
gss/engine
spec/styles.coffee
MIT
be430ea249f8030e11c8e03a8e170dcc8b8cf5fb
2,854
https://github.com/gss/engine/blob/be430ea249f8030e11c8e03a8e170dcc8b8cf5fb/spec/styles.coffee
149
156
gss/engine:spec/styles.coffee:5:js_to_coffee
js_to_coffee
Convert this JavaScript to CoffeeScript. ```javascript xdescribe('transformations', function() { return it('should generate matrix', function() { engine.solve([['rotateX', ['deg', 10]], ['scaleZ', 2], ['translateY', -2]]); return expect(doc['transform']()).to.eql(123); }); }); ```
xdescribe 'transformations', -> it 'should generate matrix', -> engine.solve [ ['rotateX', ['deg', 10]] ['scaleZ', 2] ['translateY', -2] ] expect(doc['transform']()).to.eql 123
JavaScript
CoffeeScript
gss/engine
spec/styles.coffee
MIT
be430ea249f8030e11c8e03a8e170dcc8b8cf5fb
2,854
https://github.com/gss/engine/blob/be430ea249f8030e11c8e03a8e170dcc8b8cf5fb/spec/styles.coffee
149
156
gss/engine:spec/styles.coffee:5:completion
completion
xdescribe 'transformations', -> it 'should generate matrix', -> engine.solve [ ['rotateX', ['deg', 10]]
['scaleZ', 2] ['translateY', -2] ] expect(doc['transform']()).to.eql 123
CoffeeScript
CoffeeScript
gss/engine
spec/styles.coffee
MIT
be430ea249f8030e11c8e03a8e170dcc8b8cf5fb
2,854
https://github.com/gss/engine/blob/be430ea249f8030e11c8e03a8e170dcc8b8cf5fb/spec/styles.coffee
149
156
gss/engine:spec/styles.coffee:1:raw_corpus
raw_corpus
expect = chai.expect assert = chai.assert describe 'Styles', -> doc = engine = null before -> engine ||= new GSS(document.createElement('div')) engine.compile() doc = {} for property, value of engine.data.properties do (property, value) -> doc[property] = -> value.apply(eng...
CoffeeScript
gss/engine
spec/styles.coffee
MIT
daa2a82301cb1696b74d4bda01f1eefdbc0a3151
2,854
https://github.com/gss/engine/blob/daa2a82301cb1696b74d4bda01f1eefdbc0a3151/spec/styles.coffee
1
47
gss/engine:spec/styles.coffee:1:coffee_to_js
coffee_to_js
Convert this CoffeeScript to JavaScript. ```coffeescript expect = chai.expect assert = chai.assert describe 'Styles', -> doc = engine = null before -> engine ||= new GSS(document.createElement('div')) engine.compile() doc = {} for property, value of engine.data.properties do (property, value...
var assert, expect; expect = chai.expect; assert = chai.assert; describe('Styles', function() { var doc, engine; doc = engine = null; before(function() { var property, ref, results, value; engine || (engine = new GSS(document.createElement('div'))); engine.compile(); doc = {}; ref = engine....
CoffeeScript
JavaScript
gss/engine
spec/styles.coffee
MIT
daa2a82301cb1696b74d4bda01f1eefdbc0a3151
2,854
https://github.com/gss/engine/blob/daa2a82301cb1696b74d4bda01f1eefdbc0a3151/spec/styles.coffee
1
47
gss/engine:spec/styles.coffee:1:js_to_coffee
js_to_coffee
Convert this JavaScript to CoffeeScript. ```javascript var assert, expect; expect = chai.expect; assert = chai.assert; describe('Styles', function() { var doc, engine; doc = engine = null; before(function() { var property, ref, results, value; engine || (engine = new GSS(document.createElement('div')))...
expect = chai.expect assert = chai.assert describe 'Styles', -> doc = engine = null before -> engine ||= new GSS(document.createElement('div')) engine.compile() doc = {} for property, value of engine.data.properties do (property, value) -> doc[property] = -> value.apply(eng...
JavaScript
CoffeeScript
gss/engine
spec/styles.coffee
MIT
daa2a82301cb1696b74d4bda01f1eefdbc0a3151
2,854
https://github.com/gss/engine/blob/daa2a82301cb1696b74d4bda01f1eefdbc0a3151/spec/styles.coffee
1
47
gss/engine:spec/styles.coffee:1:completion
completion
expect = chai.expect assert = chai.assert describe 'Styles', -> doc = engine = null before -> engine ||= new GSS(document.createElement('div')) engine.compile() doc = {} for property, value of engine.data.properties do (property, value) -> doc[property] = -> value.apply(eng...
it 'length & percentage', -> expect(doc['font-size'](10)).to.eql(10) expect(doc['font-size'](['em', 10])).to.eql(['em', 10]) expect(doc['font-size'](['%', 10])).to.eql(['%', 10]) expect(doc['font-size'](['s', 10])).to.eql(undefined) it 'keywords', -> expect(doc['float']('none')).to.eq...
CoffeeScript
CoffeeScript
gss/engine
spec/styles.coffee
MIT
daa2a82301cb1696b74d4bda01f1eefdbc0a3151
2,854
https://github.com/gss/engine/blob/daa2a82301cb1696b74d4bda01f1eefdbc0a3151/spec/styles.coffee
1
47
gss/engine:spec/styles.coffee:1:raw_corpus
raw_corpus
expect = chai.expect assert = chai.assert describe 'Styles', -> doc = engine = null before -> engine ||= new GSS(document.createElement('div')) engine.compile() doc = {} for property, value of engine.intrinsic.properties do (property, value) -> doc[property] = -> value.appl...
CoffeeScript
gss/engine
spec/styles.coffee
MIT
b03e234974b4b55f69f3ec92dbb674ff654d7490
2,854
https://github.com/gss/engine/blob/b03e234974b4b55f69f3ec92dbb674ff654d7490/spec/styles.coffee
1
47
gss/engine:spec/styles.coffee:1:coffee_to_js
coffee_to_js
Convert this CoffeeScript to JavaScript. ```coffeescript expect = chai.expect assert = chai.assert describe 'Styles', -> doc = engine = null before -> engine ||= new GSS(document.createElement('div')) engine.compile() doc = {} for property, value of engine.intrinsic.properties do (property, ...
var assert, expect; expect = chai.expect; assert = chai.assert; describe('Styles', function() { var doc, engine; doc = engine = null; before(function() { var property, ref, results, value; engine || (engine = new GSS(document.createElement('div'))); engine.compile(); doc = {}; ref = engine....
CoffeeScript
JavaScript
gss/engine
spec/styles.coffee
MIT
b03e234974b4b55f69f3ec92dbb674ff654d7490
2,854
https://github.com/gss/engine/blob/b03e234974b4b55f69f3ec92dbb674ff654d7490/spec/styles.coffee
1
47
gss/engine:spec/styles.coffee:1:js_to_coffee
js_to_coffee
Convert this JavaScript to CoffeeScript. ```javascript var assert, expect; expect = chai.expect; assert = chai.assert; describe('Styles', function() { var doc, engine; doc = engine = null; before(function() { var property, ref, results, value; engine || (engine = new GSS(document.createElement('div')))...
expect = chai.expect assert = chai.assert describe 'Styles', -> doc = engine = null before -> engine ||= new GSS(document.createElement('div')) engine.compile() doc = {} for property, value of engine.intrinsic.properties do (property, value) -> doc[property] = -> value.appl...
JavaScript
CoffeeScript
gss/engine
spec/styles.coffee
MIT
b03e234974b4b55f69f3ec92dbb674ff654d7490
2,854
https://github.com/gss/engine/blob/b03e234974b4b55f69f3ec92dbb674ff654d7490/spec/styles.coffee
1
47
gss/engine:spec/styles.coffee:1:completion
completion
expect = chai.expect assert = chai.assert describe 'Styles', -> doc = engine = null before -> engine ||= new GSS(document.createElement('div')) engine.compile() doc = {} for property, value of engine.intrinsic.properties do (property, value) -> doc[property] = -> value.appl...
it 'length & percentage', -> expect(doc['font-size'](10)).to.eql(10) expect(doc['font-size'](['em', 10])).to.eql(['em', 10]) expect(doc['font-size'](['%', 10])).to.eql(['%', 10]) expect(doc['font-size'](['s', 10])).to.eql(undefined) it 'keywords', -> expect(doc['float']('none')).to.eq...
CoffeeScript
CoffeeScript
gss/engine
spec/styles.coffee
MIT
b03e234974b4b55f69f3ec92dbb674ff654d7490
2,854
https://github.com/gss/engine/blob/b03e234974b4b55f69f3ec92dbb674ff654d7490/spec/styles.coffee
1
47
gss/engine:spec/styles.coffee:1:raw_corpus
raw_corpus
expect = chai.expect assert = chai.assert describe 'Styles', -> doc = engine = null beforeEach -> engine ||= new GSS(document.createElement('div')) engine.compile() doc = {} for property, value of engine.intrinsic.properties do (property, value) -> doc[property] = -> value....
CoffeeScript
gss/engine
spec/styles.coffee
MIT
52c9369320bcc6e770a56d6de90833bebaed3156
2,854
https://github.com/gss/engine/blob/52c9369320bcc6e770a56d6de90833bebaed3156/spec/styles.coffee
1
47
gss/engine:spec/styles.coffee:1:coffee_to_js
coffee_to_js
Convert this CoffeeScript to JavaScript. ```coffeescript expect = chai.expect assert = chai.assert describe 'Styles', -> doc = engine = null beforeEach -> engine ||= new GSS(document.createElement('div')) engine.compile() doc = {} for property, value of engine.intrinsic.properties do (proper...
var assert, expect; expect = chai.expect; assert = chai.assert; describe('Styles', function() { var doc, engine; doc = engine = null; beforeEach(function() { var property, ref, results, value; engine || (engine = new GSS(document.createElement('div'))); engine.compile(); doc = {}; ref = eng...
CoffeeScript
JavaScript
gss/engine
spec/styles.coffee
MIT
52c9369320bcc6e770a56d6de90833bebaed3156
2,854
https://github.com/gss/engine/blob/52c9369320bcc6e770a56d6de90833bebaed3156/spec/styles.coffee
1
47
gss/engine:spec/styles.coffee:1:js_to_coffee
js_to_coffee
Convert this JavaScript to CoffeeScript. ```javascript var assert, expect; expect = chai.expect; assert = chai.assert; describe('Styles', function() { var doc, engine; doc = engine = null; beforeEach(function() { var property, ref, results, value; engine || (engine = new GSS(document.createElement('div...
expect = chai.expect assert = chai.assert describe 'Styles', -> doc = engine = null beforeEach -> engine ||= new GSS(document.createElement('div')) engine.compile() doc = {} for property, value of engine.intrinsic.properties do (property, value) -> doc[property] = -> value....
JavaScript
CoffeeScript
gss/engine
spec/styles.coffee
MIT
52c9369320bcc6e770a56d6de90833bebaed3156
2,854
https://github.com/gss/engine/blob/52c9369320bcc6e770a56d6de90833bebaed3156/spec/styles.coffee
1
47
gss/engine:spec/styles.coffee:1:completion
completion
expect = chai.expect assert = chai.assert describe 'Styles', -> doc = engine = null beforeEach -> engine ||= new GSS(document.createElement('div')) engine.compile() doc = {} for property, value of engine.intrinsic.properties do (property, value) -> doc[property] = -> value....
it 'length & percentage', -> expect(doc['font-size'](10)).to.eql(10) expect(doc['font-size'](['em', 10])).to.eql(['em', 10]) expect(doc['font-size'](['%', 10])).to.eql(['%', 10]) expect(doc['font-size'](['s', 10])).to.eql(undefined) it 'keywords', -> expect(doc['float']('none')).to.eq...
CoffeeScript
CoffeeScript
gss/engine
spec/styles.coffee
MIT
52c9369320bcc6e770a56d6de90833bebaed3156
2,854
https://github.com/gss/engine/blob/52c9369320bcc6e770a56d6de90833bebaed3156/spec/styles.coffee
1
47
fulmicoton/fattable:example.coffee:1:raw_corpus
raw_corpus
CELL_PAGE_SIZE = 256 - 1 COL_PAGE_SIZE = 1024 - 1 makePage = (@pageName, @I, @J)-> (i,j)-> @pageName + ":" + (i - @I) + "," + (j - @J) class AsyncTableData extends fattable.TableData constructor: -> @pageCache = new LRUCache() @fetchCallbacks = {} cellPageKey: (i,j)-> [ i...
CoffeeScript
fulmicoton/fattable
example.coffee
MIT
2d28964eee1241f4a74acf9958f66550779d9ea3
483
https://github.com/fulmicoton/fattable/blob/2d28964eee1241f4a74acf9958f66550779d9ea3/example.coffee
1
47
fulmicoton/fattable:example.coffee:1:completion
completion
CELL_PAGE_SIZE = 256 - 1 COL_PAGE_SIZE = 1024 - 1 makePage = (@pageName, @I, @J)-> (i,j)-> @pageName + ":" + (i - @I) + "," + (j - @J) class AsyncTableData extends fattable.TableData constructor: -> @pageCache = new LRUCache() @fetchCallbacks = {} cellPageKey: (i,j)-> [ i...
if @pageCache.has pageName cb @pageCache.get(pageName)(i,j) else if @fetchCallbacks[pageName]? @fetchCallbacks[pageName].push [i, j, cb ] else @fetchCallbacks[pageName] = [ [i, j, cb ] ] @fetchCellPage pageName, I, J fetchCellPage: (pageName, I, J)-> ...
CoffeeScript
CoffeeScript
fulmicoton/fattable
example.coffee
MIT
2d28964eee1241f4a74acf9958f66550779d9ea3
483
https://github.com/fulmicoton/fattable/blob/2d28964eee1241f4a74acf9958f66550779d9ea3/example.coffee
1
47
fulmicoton/fattable:example.coffee:1:raw_corpus
raw_corpus
class LRUCache constructor: (@size=100)-> @data = {} @lru_keys = [] has: (k)-> # Returns true if the key k is # already in the cache. @data.hasOwnProperty k get: (k)-> # If key k is in the cache, # calls cb immediatly with as arguments # ...
CoffeeScript
fulmicoton/fattable
example.coffee
MIT
b1f8aeb9fd3d27c196133c65a1d3fe25444e0f34
483
https://github.com/fulmicoton/fattable/blob/b1f8aeb9fd3d27c196133c65a1d3fe25444e0f34/example.coffee
1
50
fulmicoton/fattable:example.coffee:1:completion
completion
class LRUCache constructor: (@size=100)-> @data = {} @lru_keys = [] has: (k)-> # Returns true if the key k is # already in the cache. @data.hasOwnProperty k get: (k)-> # If key k is in the cache, # calls cb immediatly with as arguments # ...
@lru_keys.push k if @lru_keys.length >= @size removeKey = @lru_keys.shift() delete @data[removeKey] @data[k] = v CELL_PAGE_SIZE = 256 - 1 COL_PAGE_SIZE = 1024 - 1 makePage = (@pageName, @I, @J)-> (i,j)-> @pageName + ":" + (i - @I) + "," + (j - @J) class AsyncTable...
CoffeeScript
CoffeeScript
fulmicoton/fattable
example.coffee
MIT
b1f8aeb9fd3d27c196133c65a1d3fe25444e0f34
483
https://github.com/fulmicoton/fattable/blob/b1f8aeb9fd3d27c196133c65a1d3fe25444e0f34/example.coffee
1
50
fulmicoton/fattable:example.coffee:2:raw_corpus
raw_corpus
@pageCache.has pageName getCell: (i,j, cb=(->))-> [I,J] = @cellPageKey i,j pageName = [I,J].join "," if @pageCache.has pageName cb @pageCache.get(pageName)(i,j) else if @fetchCallbacks[pageName]? @fetchCallbacks[pageName].push [i, j, cb ] else ...
CoffeeScript
fulmicoton/fattable
example.coffee
MIT
b1f8aeb9fd3d27c196133c65a1d3fe25444e0f34
483
https://github.com/fulmicoton/fattable/blob/b1f8aeb9fd3d27c196133c65a1d3fe25444e0f34/example.coffee
51
78
fulmicoton/fattable:example.coffee:2:coffee_to_js
coffee_to_js
Convert this CoffeeScript to JavaScript. ```coffeescript @pageCache.has pageName getCell: (i,j, cb=(->))-> [I,J] = @cellPageKey i,j pageName = [I,J].join "," if @pageCache.has pageName cb @pageCache.get(pageName)(i,j) else if @fetchCallbacks[pageName]? @fetc...
this.pageCache.has(pageName({ getCell: function(i, j, cb = (function() {})) { var I, J, pageName; [I, J] = this.cellPageKey(i, j); pageName = [I, J].join(","); if (this.pageCache.has(pageName)) { return cb(this.pageCache.get(pageName)(i, j)); } else if (this.fetchCallbacks[pageName] != null)...
CoffeeScript
JavaScript
fulmicoton/fattable
example.coffee
MIT
b1f8aeb9fd3d27c196133c65a1d3fe25444e0f34
483
https://github.com/fulmicoton/fattable/blob/b1f8aeb9fd3d27c196133c65a1d3fe25444e0f34/example.coffee
51
78
fulmicoton/fattable:example.coffee:2:js_to_coffee
js_to_coffee
Convert this JavaScript to CoffeeScript. ```javascript this.pageCache.has(pageName({ getCell: function(i, j, cb = (function() {})) { var I, J, pageName; [I, J] = this.cellPageKey(i, j); pageName = [I, J].join(","); if (this.pageCache.has(pageName)) { return cb(this.pageCache.get(pageName)(i, j))...
@pageCache.has pageName getCell: (i,j, cb=(->))-> [I,J] = @cellPageKey i,j pageName = [I,J].join "," if @pageCache.has pageName cb @pageCache.get(pageName)(i,j) else if @fetchCallbacks[pageName]? @fetchCallbacks[pageName].push [i, j, cb ] else ...
JavaScript
CoffeeScript
fulmicoton/fattable
example.coffee
MIT
b1f8aeb9fd3d27c196133c65a1d3fe25444e0f34
483
https://github.com/fulmicoton/fattable/blob/b1f8aeb9fd3d27c196133c65a1d3fe25444e0f34/example.coffee
51
78
fulmicoton/fattable:example.coffee:2:completion
completion
@pageCache.has pageName getCell: (i,j, cb=(->))-> [I,J] = @cellPageKey i,j pageName = [I,J].join "," if @pageCache.has pageName cb @pageCache.get(pageName)(i,j) else if @fetchCallbacks[pageName]? @fetchCallbacks[pageName].push [i, j, cb ] else ...
page = makePage pageName, I, J @pageCache.set pageName, page for [i,j,cb] in @fetchCallbacks[pageName] cb page(i,j) delete @fetchCallbacks[pageName] window.setTimeout deferred, 500 hasColumn: (j)-> true getHeader: (j,cb=(->))-> cb("co...
CoffeeScript
CoffeeScript
fulmicoton/fattable
example.coffee
MIT
b1f8aeb9fd3d27c196133c65a1d3fe25444e0f34
483
https://github.com/fulmicoton/fattable/blob/b1f8aeb9fd3d27c196133c65a1d3fe25444e0f34/example.coffee
51
78
fulmicoton/fattable:example.coffee:1:raw_corpus
raw_corpus
class LRUCache constructor: (@size=100)-> @data = {} @lru_keys = [] has: (k)-> # Returns true if the key k is # already in the cache. @data.hasOwnProperty k get: (k)-> # If key k is in the cache, # calls cb immediatly with as arguments # ...
CoffeeScript
fulmicoton/fattable
example.coffee
MIT
c48927353ee3bcfeba9e594531ebcb2fa709f82c
483
https://github.com/fulmicoton/fattable/blob/c48927353ee3bcfeba9e594531ebcb2fa709f82c/example.coffee
1
50
fulmicoton/fattable:example.coffee:1:completion
completion
class LRUCache constructor: (@size=100)-> @data = {} @lru_keys = [] has: (k)-> # Returns true if the key k is # already in the cache. @data.hasOwnProperty k get: (k)-> # If key k is in the cache, # calls cb immediatly with as arguments # ...
@lru_keys.push k if @lru_keys.length >= @size removeKey = @lru_keys.shift() delete @data[removeKey] @data[k] = v CELL_PAGE_SIZE = 256 - 1 COL_PAGE_SIZE = 1024 - 1 makePage = (@pageName, @I, @J)-> (i,j)-> @pageName + ":" + (i - @I) + "," + (j - @J) class AsyncTable...
CoffeeScript
CoffeeScript
fulmicoton/fattable
example.coffee
MIT
c48927353ee3bcfeba9e594531ebcb2fa709f82c
483
https://github.com/fulmicoton/fattable/blob/c48927353ee3bcfeba9e594531ebcb2fa709f82c/example.coffee
1
50
fulmicoton/fattable:example.coffee:1:raw_corpus
raw_corpus
class LRUCache constructor: (@size=100)-> @data = {} @lru_keys = [] has: (k)-> # Returns true if the key k is # already in the cache. @data.hasOwnProperty k get: (k)-> # If key k is in the cache, # calls cb immediatly with as arguments # ...
CoffeeScript
fulmicoton/fattable
example.coffee
MIT
432da32decedb51d35a8be103fb8dc3523edc9a1
483
https://github.com/fulmicoton/fattable/blob/432da32decedb51d35a8be103fb8dc3523edc9a1/example.coffee
1
50
fulmicoton/fattable:example.coffee:1:completion
completion
class LRUCache constructor: (@size=100)-> @data = {} @lru_keys = [] has: (k)-> # Returns true if the key k is # already in the cache. @data.hasOwnProperty k get: (k)-> # If key k is in the cache, # calls cb immediatly with as arguments # ...
@lru_keys.splice idx, 1 @lru_keys.push k if @lru_keys.length >= @size removeKey = @lru_keys.shift() delete @data[removeKey] @data[k] = v CELL_PAGE_SIZE = 100 COL_PAGE_SIZE = 1000 makePage = (@pageName, @I, @J)-> (i,j)-> @pageName + ":" + (i - @I) + "," + (...
CoffeeScript
CoffeeScript
fulmicoton/fattable
example.coffee
MIT
432da32decedb51d35a8be103fb8dc3523edc9a1
483
https://github.com/fulmicoton/fattable/blob/432da32decedb51d35a8be103fb8dc3523edc9a1/example.coffee
1
50
fulmicoton/fattable:example.coffee:2:raw_corpus
raw_corpus
hasCell: (i,j)-> pageName = @cellPageName i,j @pageCache.has pageName getCell: (i,j, cb=(->))-> pageName = @cellPageName i,j if @pageCache.has pageName cb @pageCache.get(pageName)(i,j) else if @fetchCallbacks[pageName]? @fetchCallbacks[pageName].push ...
CoffeeScript
fulmicoton/fattable
example.coffee
MIT
432da32decedb51d35a8be103fb8dc3523edc9a1
483
https://github.com/fulmicoton/fattable/blob/432da32decedb51d35a8be103fb8dc3523edc9a1/example.coffee
51
80
fulmicoton/fattable:example.coffee:2:coffee_to_js
coffee_to_js
Convert this CoffeeScript to JavaScript. ```coffeescript hasCell: (i,j)-> pageName = @cellPageName i,j @pageCache.has pageName getCell: (i,j, cb=(->))-> pageName = @cellPageName i,j if @pageCache.has pageName cb @pageCache.get(pageName)(i,j) else if @fetchCallbac...
({ hasCell: function(i, j) { var pageName; pageName = this.cellPageName(i, j); return this.pageCache.has(pageName); }, getCell: function(i, j, cb = (function() {})) { var pageName; pageName = this.cellPageName(i, j); if (this.pageCache.has(pageName)) { return cb(this.pageCache.get(pa...
CoffeeScript
JavaScript
fulmicoton/fattable
example.coffee
MIT
432da32decedb51d35a8be103fb8dc3523edc9a1
483
https://github.com/fulmicoton/fattable/blob/432da32decedb51d35a8be103fb8dc3523edc9a1/example.coffee
51
80
fulmicoton/fattable:example.coffee:2:js_to_coffee
js_to_coffee
Convert this JavaScript to CoffeeScript. ```javascript ({ hasCell: function(i, j) { var pageName; pageName = this.cellPageName(i, j); return this.pageCache.has(pageName); }, getCell: function(i, j, cb = (function() {})) { var pageName; pageName = this.cellPageName(i, j); if (this.pageCache...
hasCell: (i,j)-> pageName = @cellPageName i,j @pageCache.has pageName getCell: (i,j, cb=(->))-> pageName = @cellPageName i,j if @pageCache.has pageName cb @pageCache.get(pageName)(i,j) else if @fetchCallbacks[pageName]? @fetchCallbacks[pageName].push ...
JavaScript
CoffeeScript
fulmicoton/fattable
example.coffee
MIT
432da32decedb51d35a8be103fb8dc3523edc9a1
483
https://github.com/fulmicoton/fattable/blob/432da32decedb51d35a8be103fb8dc3523edc9a1/example.coffee
51
80
fulmicoton/fattable:example.coffee:2:completion
completion
hasCell: (i,j)-> pageName = @cellPageName i,j @pageCache.has pageName getCell: (i,j, cb=(->))-> pageName = @cellPageName i,j if @pageCache.has pageName cb @pageCache.get(pageName)(i,j) else if @fetchCallbacks[pageName]? @fetchCallbacks[pageName].push ...
deferred = => page = makePage pageName, I, J @pageCache.set pageName, page for [i,j,cb] in @fetchCallbacks[pageName] cb page(i,j) delete @fetchCallbacks[pageName] window.setTimeout deferred, 500 hasColumn: (j)-> true getHeader: (j...
CoffeeScript
CoffeeScript
fulmicoton/fattable
example.coffee
MIT
432da32decedb51d35a8be103fb8dc3523edc9a1
483
https://github.com/fulmicoton/fattable/blob/432da32decedb51d35a8be103fb8dc3523edc9a1/example.coffee
51
80
jianliaoim/talk-os:talk-web/client/util/textarea.coffee:1:raw_corpus
raw_corpus
divideText = (text, trigger) -> buffer = '' pos = 0 for i in [text.length-1..0] pos = i if text[i] is trigger break buffer = text[i] + buffer [text.substring(0, pos), buffer] exports.makeCompleteState = (wholeText, start, special, complete) -> textBefore = wholeText[...start] textBehind =...
CoffeeScript
jianliaoim/talk-os
talk-web/client/util/textarea.coffee
MIT
2545c4497865779a55762e03963a39237df9046b
2,703
https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-web/client/util/textarea.coffee
1
50
jianliaoim/talk-os:talk-web/client/util/textarea.coffee:1:completion
completion
divideText = (text, trigger) -> buffer = '' pos = 0 for i in [text.length-1..0] pos = i if text[i] is trigger break buffer = text[i] + buffer [text.substring(0, pos), buffer] exports.makeCompleteState = (wholeText, start, special, complete) -> textBefore = wholeText[...start] textBehind =...
newText = textBefore + chunk + textAfter newStart = start + chunk.length text: newText start: newStart end: newStart exports.getQuery = (text, trigger) -> buffer = '' for i in [text.length-1..0] if text[i] is trigger break buffer = text[i] + buffer buffer exports.getTrigger = getTrigger =...
CoffeeScript
CoffeeScript
jianliaoim/talk-os
talk-web/client/util/textarea.coffee
MIT
2545c4497865779a55762e03963a39237df9046b
2,703
https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-web/client/util/textarea.coffee
1
50
jianliaoim/talk-os:talk-web/client/app/file-audio.coffee:1:raw_corpus
raw_corpus
React = require 'react' Immutable = require 'immutable' PureRenderMixin = require 'react-addons-pure-render-mixin' lang = require '../locales/lang' div = React.createFactory 'div' audio = React.createFactory 'audio' T = React.PropTypes l = lang.getText module.exports = React.createClass displayName: 'file-audio...
CoffeeScript
jianliaoim/talk-os
talk-web/client/app/file-audio.coffee
MIT
2545c4497865779a55762e03963a39237df9046b
2,703
https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-web/client/app/file-audio.coffee
1
25
jianliaoim/talk-os:talk-web/client/app/file-audio.coffee:1:coffee_to_js
coffee_to_js
Convert this CoffeeScript to JavaScript. ```coffeescript React = require 'react' Immutable = require 'immutable' PureRenderMixin = require 'react-addons-pure-render-mixin' lang = require '../locales/lang' div = React.createFactory 'div' audio = React.createFactory 'audio' T = React.PropTypes l = lang.getText modu...
var Immutable, PureRenderMixin, React, T, audio, div, l, lang; React = require('react'); Immutable = require('immutable'); PureRenderMixin = require('react-addons-pure-render-mixin'); lang = require('../locales/lang'); div = React.createFactory('div'); audio = React.createFactory('audio'); T = React.PropTypes; ...
CoffeeScript
JavaScript
jianliaoim/talk-os
talk-web/client/app/file-audio.coffee
MIT
2545c4497865779a55762e03963a39237df9046b
2,703
https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-web/client/app/file-audio.coffee
1
25
jianliaoim/talk-os:talk-web/client/app/file-audio.coffee:1:js_to_coffee
js_to_coffee
Convert this JavaScript to CoffeeScript. ```javascript var Immutable, PureRenderMixin, React, T, audio, div, l, lang; React = require('react'); Immutable = require('immutable'); PureRenderMixin = require('react-addons-pure-render-mixin'); lang = require('../locales/lang'); div = React.createFactory('div'); audio ...
React = require 'react' Immutable = require 'immutable' PureRenderMixin = require 'react-addons-pure-render-mixin' lang = require '../locales/lang' div = React.createFactory 'div' audio = React.createFactory 'audio' T = React.PropTypes l = lang.getText module.exports = React.createClass displayName: 'file-audio...
JavaScript
CoffeeScript
jianliaoim/talk-os
talk-web/client/app/file-audio.coffee
MIT
2545c4497865779a55762e03963a39237df9046b
2,703
https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-web/client/app/file-audio.coffee
1
25
jianliaoim/talk-os:talk-web/client/app/file-audio.coffee:1:completion
completion
React = require 'react' Immutable = require 'immutable' PureRenderMixin = require 'react-addons-pure-render-mixin' lang = require '../locales/lang' div = React.createFactory 'div' audio = React.createFactory 'audio' T = React.PropTypes l = lang.getText
module.exports = React.createClass displayName: 'file-audio' mixins: [PureRenderMixin] propTypes: file: T.instanceOf(Immutable.Map) render: -> src = @props.file.get('downloadUrl') div className: 'file-audio', audio src: src, controls: true, autoPlay: true, l('html5AudioNotSupport')
CoffeeScript
CoffeeScript
jianliaoim/talk-os
talk-web/client/app/file-audio.coffee
MIT
2545c4497865779a55762e03963a39237df9046b
2,703
https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-web/client/app/file-audio.coffee
1
25
Glavin001/atom-beautify:src/beautifiers/crystal.coffee:1:raw_corpus
raw_corpus
### Requires https://github.com/jaspervdj/stylish-haskell ### "use strict" Beautifier = require('./beautifier') module.exports = class Crystal extends Beautifier name: "Crystal" link: "http://crystal-lang.org" executables: [ { name: "Crystal" cmd: "crystal" homepage: "http://crystal-lang.o...
CoffeeScript
Glavin001/atom-beautify
src/beautifiers/crystal.coffee
MIT
41d5051b399f7fe11efd149504a232df16179d60
1,503
https://github.com/Glavin001/atom-beautify/blob/41d5051b399f7fe11efd149504a232df16179d60/src/beautifiers/crystal.coffee
1
38
Glavin001/atom-beautify:src/beautifiers/crystal.coffee:1:coffee_to_js
coffee_to_js
Convert this CoffeeScript to JavaScript. ```coffeescript ### Requires https://github.com/jaspervdj/stylish-haskell ### "use strict" Beautifier = require('./beautifier') module.exports = class Crystal extends Beautifier name: "Crystal" link: "http://crystal-lang.org" executables: [ { name: "Crystal" ...
/* Requires https://github.com/jaspervdj/stylish-haskell */ "use strict"; var Beautifier, Crystal; Beautifier = require('./beautifier'); module.exports = Crystal = (function() { class Crystal extends Beautifier { beautify(text, language, options) { var tempFile; return this.exe("crystal").run(['tool...
CoffeeScript
JavaScript
Glavin001/atom-beautify
src/beautifiers/crystal.coffee
MIT
41d5051b399f7fe11efd149504a232df16179d60
1,503
https://github.com/Glavin001/atom-beautify/blob/41d5051b399f7fe11efd149504a232df16179d60/src/beautifiers/crystal.coffee
1
38
Glavin001/atom-beautify:src/beautifiers/crystal.coffee:1:js_to_coffee
js_to_coffee
Convert this JavaScript to CoffeeScript. ```javascript /* Requires https://github.com/jaspervdj/stylish-haskell */ "use strict"; var Beautifier, Crystal; Beautifier = require('./beautifier'); module.exports = Crystal = (function() { class Crystal extends Beautifier { beautify(text, language, options) { va...
### Requires https://github.com/jaspervdj/stylish-haskell ### "use strict" Beautifier = require('./beautifier') module.exports = class Crystal extends Beautifier name: "Crystal" link: "http://crystal-lang.org" executables: [ { name: "Crystal" cmd: "crystal" homepage: "http://crystal-lang.o...
JavaScript
CoffeeScript
Glavin001/atom-beautify
src/beautifiers/crystal.coffee
MIT
41d5051b399f7fe11efd149504a232df16179d60
1,503
https://github.com/Glavin001/atom-beautify/blob/41d5051b399f7fe11efd149504a232df16179d60/src/beautifiers/crystal.coffee
1
38