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
twilson63/express-coffee:lib/coffee/lib/coffee-script/documentation/coffee/object_comprehensions.coffee:1:completion
completion
years_old: {max: 10, ida: 9, tim: 11}
ages: for child, age of years_old child + " is " + age
CoffeeScript
CoffeeScript
twilson63/express-coffee
lib/coffee/lib/coffee-script/documentation/coffee/object_comprehensions.coffee
MIT
971837f7d7a5e96cf5a5fdb52e52748060ed2c68
622
https://github.com/twilson63/express-coffee/blob/971837f7d7a5e96cf5a5fdb52e52748060ed2c68/lib/coffee/lib/coffee-script/documentation/coffee/object_comprehensions.coffee
1
4
jianliaoim/talk-os:talk-web/client/updater/inte.coffee:1:raw_corpus
raw_corpus
Immutable = require 'immutable' # dataSchame = # _teamId: {type: 'string'} # resp: {type: 'array'} exports.fetch = (store, actionData) -> _teamId = actionData.get('_teamId') inteList = actionData.get('resp') store.setIn ['intes', _teamId], inteList exports.create = (store, inteData) -> _teamId = inteData...
CoffeeScript
jianliaoim/talk-os
talk-web/client/updater/inte.coffee
MIT
2545c4497865779a55762e03963a39237df9046b
2,703
https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-web/client/updater/inte.coffee
1
44
jianliaoim/talk-os:talk-web/client/updater/inte.coffee:1:coffee_to_js
coffee_to_js
Convert this CoffeeScript to JavaScript. ```coffeescript Immutable = require 'immutable' # dataSchame = # _teamId: {type: 'string'} # resp: {type: 'array'} exports.fetch = (store, actionData) -> _teamId = actionData.get('_teamId') inteList = actionData.get('resp') store.setIn ['intes', _teamId], inteList e...
var Immutable; Immutable = require('immutable'); // dataSchame = // _teamId: {type: 'string'} // resp: {type: 'array'} exports.fetch = function(store, actionData) { var _teamId, inteList; _teamId = actionData.get('_teamId'); inteList = actionData.get('resp'); return store.setIn(['intes', _teamId], inteLis...
CoffeeScript
JavaScript
jianliaoim/talk-os
talk-web/client/updater/inte.coffee
MIT
2545c4497865779a55762e03963a39237df9046b
2,703
https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-web/client/updater/inte.coffee
1
44
jianliaoim/talk-os:talk-web/client/updater/inte.coffee:1:js_to_coffee
js_to_coffee
Convert this JavaScript to CoffeeScript. ```javascript var Immutable; Immutable = require('immutable'); // dataSchame = // _teamId: {type: 'string'} // resp: {type: 'array'} exports.fetch = function(store, actionData) { var _teamId, inteList; _teamId = actionData.get('_teamId'); inteList = actionData.get('r...
Immutable = require 'immutable' # dataSchame = # _teamId: {type: 'string'} # resp: {type: 'array'} exports.fetch = (store, actionData) -> _teamId = actionData.get('_teamId') inteList = actionData.get('resp') store.setIn ['intes', _teamId], inteList exports.create = (store, inteData) -> _teamId = inteData...
JavaScript
CoffeeScript
jianliaoim/talk-os
talk-web/client/updater/inte.coffee
MIT
2545c4497865779a55762e03963a39237df9046b
2,703
https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-web/client/updater/inte.coffee
1
44
jianliaoim/talk-os:talk-web/client/updater/inte.coffee:1:completion
completion
Immutable = require 'immutable' # dataSchame = # _teamId: {type: 'string'} # resp: {type: 'array'} exports.fetch = (store, actionData) -> _teamId = actionData.get('_teamId') inteList = actionData.get('resp') store.setIn ['intes', _teamId], inteList exports.create = (store, inteData) -> _teamId = inteData...
_inteId = inteData.get('_id') if store.getIn('intes', _teamId)? store.updateIn ['intes', _teamId], (intes) -> intes.filterNot (inte) -> inte.get('_id') is _inteId else store exports.update = (store, inteData) -> _teamId = inteData.get('_teamId') _inteId = inteData.get('_id') if store.getI...
CoffeeScript
CoffeeScript
jianliaoim/talk-os
talk-web/client/updater/inte.coffee
MIT
2545c4497865779a55762e03963a39237df9046b
2,703
https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-web/client/updater/inte.coffee
1
44
oozcitak/xmlbuilder-js:test/issues/encoding.coffee:1:raw_corpus
raw_corpus
suite 'Tests specific to issues:', -> test 'Encoding regex', -> eq( xml('root', {encoding: 'UTF-8'}).end() '<?xml version="1.0" encoding="UTF-8"?><root/>' ) err( () -> xml('root', {encoding: 'A------------------------------------!'}) /Invalid encoding: A---------------------------...
CoffeeScript
oozcitak/xmlbuilder-js
test/issues/encoding.coffee
MIT
ce625aeb9f52d1f75d5d94260794d3b5fd74a8b1
926
https://github.com/oozcitak/xmlbuilder-js/blob/ce625aeb9f52d1f75d5d94260794d3b5fd74a8b1/test/issues/encoding.coffee
1
11
oozcitak/xmlbuilder-js:test/issues/encoding.coffee:1:coffee_to_js
coffee_to_js
Convert this CoffeeScript to JavaScript. ```coffeescript suite 'Tests specific to issues:', -> test 'Encoding regex', -> eq( xml('root', {encoding: 'UTF-8'}).end() '<?xml version="1.0" encoding="UTF-8"?><root/>' ) err( () -> xml('root', {encoding: 'A------------------------------------!...
suite('Tests specific to issues:', function() { return test('Encoding regex', function() { eq(xml('root', { encoding: 'UTF-8' }).end(), '<?xml version="1.0" encoding="UTF-8"?><root/>'); return err(function() { return xml('root', { encoding: 'A------------------------------------!' ...
CoffeeScript
JavaScript
oozcitak/xmlbuilder-js
test/issues/encoding.coffee
MIT
ce625aeb9f52d1f75d5d94260794d3b5fd74a8b1
926
https://github.com/oozcitak/xmlbuilder-js/blob/ce625aeb9f52d1f75d5d94260794d3b5fd74a8b1/test/issues/encoding.coffee
1
11
oozcitak/xmlbuilder-js:test/issues/encoding.coffee:1:js_to_coffee
js_to_coffee
Convert this JavaScript to CoffeeScript. ```javascript suite('Tests specific to issues:', function() { return test('Encoding regex', function() { eq(xml('root', { encoding: 'UTF-8' }).end(), '<?xml version="1.0" encoding="UTF-8"?><root/>'); return err(function() { return xml('root', { ...
suite 'Tests specific to issues:', -> test 'Encoding regex', -> eq( xml('root', {encoding: 'UTF-8'}).end() '<?xml version="1.0" encoding="UTF-8"?><root/>' ) err( () -> xml('root', {encoding: 'A------------------------------------!'}) /Invalid encoding: A---------------------------...
JavaScript
CoffeeScript
oozcitak/xmlbuilder-js
test/issues/encoding.coffee
MIT
ce625aeb9f52d1f75d5d94260794d3b5fd74a8b1
926
https://github.com/oozcitak/xmlbuilder-js/blob/ce625aeb9f52d1f75d5d94260794d3b5fd74a8b1/test/issues/encoding.coffee
1
11
oozcitak/xmlbuilder-js:test/issues/encoding.coffee:1:completion
completion
suite 'Tests specific to issues:', -> test 'Encoding regex', -> eq( xml('root', {encoding: 'UTF-8'}).end() '<?xml version="1.0" encoding="UTF-8"?><root/>'
) err( () -> xml('root', {encoding: 'A------------------------------------!'}) /Invalid encoding: A------------------------------------!/ )
CoffeeScript
CoffeeScript
oozcitak/xmlbuilder-js
test/issues/encoding.coffee
MIT
ce625aeb9f52d1f75d5d94260794d3b5fd74a8b1
926
https://github.com/oozcitak/xmlbuilder-js/blob/ce625aeb9f52d1f75d5d94260794d3b5fd74a8b1/test/issues/encoding.coffee
1
11
oozcitak/xmlbuilder-js:test/issues/encoding.coffee:1:raw_corpus
raw_corpus
suite 'Tests specific to issues:', -> test 'ReDos', -> eq( xml('root', {encoding: 'UTF-8'}).end() '<?xml version="1.0" encoding="UTF-8"?><root/>' ) err( () -> xml('root', {encoding: 'A------------------------------------!'}) /Invalid encoding: A------------------------------------...
CoffeeScript
oozcitak/xmlbuilder-js
test/issues/encoding.coffee
MIT
bbf929a8a54f0d012bdc44cbe622fdeda2509230
926
https://github.com/oozcitak/xmlbuilder-js/blob/bbf929a8a54f0d012bdc44cbe622fdeda2509230/test/issues/encoding.coffee
1
11
oozcitak/xmlbuilder-js:test/issues/encoding.coffee:1:coffee_to_js
coffee_to_js
Convert this CoffeeScript to JavaScript. ```coffeescript suite 'Tests specific to issues:', -> test 'ReDos', -> eq( xml('root', {encoding: 'UTF-8'}).end() '<?xml version="1.0" encoding="UTF-8"?><root/>' ) err( () -> xml('root', {encoding: 'A------------------------------------!'}) ...
suite('Tests specific to issues:', function() { return test('ReDos', function() { eq(xml('root', { encoding: 'UTF-8' }).end(), '<?xml version="1.0" encoding="UTF-8"?><root/>'); return err(function() { return xml('root', { encoding: 'A------------------------------------!' }); ...
CoffeeScript
JavaScript
oozcitak/xmlbuilder-js
test/issues/encoding.coffee
MIT
bbf929a8a54f0d012bdc44cbe622fdeda2509230
926
https://github.com/oozcitak/xmlbuilder-js/blob/bbf929a8a54f0d012bdc44cbe622fdeda2509230/test/issues/encoding.coffee
1
11
oozcitak/xmlbuilder-js:test/issues/encoding.coffee:1:js_to_coffee
js_to_coffee
Convert this JavaScript to CoffeeScript. ```javascript suite('Tests specific to issues:', function() { return test('ReDos', function() { eq(xml('root', { encoding: 'UTF-8' }).end(), '<?xml version="1.0" encoding="UTF-8"?><root/>'); return err(function() { return xml('root', { encoding:...
suite 'Tests specific to issues:', -> test 'ReDos', -> eq( xml('root', {encoding: 'UTF-8'}).end() '<?xml version="1.0" encoding="UTF-8"?><root/>' ) err( () -> xml('root', {encoding: 'A------------------------------------!'}) /Invalid encoding: A------------------------------------...
JavaScript
CoffeeScript
oozcitak/xmlbuilder-js
test/issues/encoding.coffee
MIT
bbf929a8a54f0d012bdc44cbe622fdeda2509230
926
https://github.com/oozcitak/xmlbuilder-js/blob/bbf929a8a54f0d012bdc44cbe622fdeda2509230/test/issues/encoding.coffee
1
11
oozcitak/xmlbuilder-js:test/issues/encoding.coffee:1:completion
completion
suite 'Tests specific to issues:', -> test 'ReDos', -> eq( xml('root', {encoding: 'UTF-8'}).end() '<?xml version="1.0" encoding="UTF-8"?><root/>'
) err( () -> xml('root', {encoding: 'A------------------------------------!'}) /Invalid encoding: A------------------------------------!/ )
CoffeeScript
CoffeeScript
oozcitak/xmlbuilder-js
test/issues/encoding.coffee
MIT
bbf929a8a54f0d012bdc44cbe622fdeda2509230
926
https://github.com/oozcitak/xmlbuilder-js/blob/bbf929a8a54f0d012bdc44cbe622fdeda2509230/test/issues/encoding.coffee
1
11
Glavin001/atom-beautify:src/beautifiers/marko-beautifier.coffee:1:raw_corpus
raw_corpus
"use strict" Beautifier = require('./beautifier') module.exports = class MarkoBeautifier extends Beautifier name: 'Marko Beautifier' link: "https://github.com/marko-js/marko-prettyprint" options: Marko: true beautify: (text, language, options, context) -> return new @Promise((resolve, reject) -> ...
CoffeeScript
Glavin001/atom-beautify
src/beautifiers/marko-beautifier.coffee
MIT
41d5051b399f7fe11efd149504a232df16179d60
1,503
https://github.com/Glavin001/atom-beautify/blob/41d5051b399f7fe11efd149504a232df16179d60/src/beautifiers/marko-beautifier.coffee
1
35
Glavin001/atom-beautify:src/beautifiers/marko-beautifier.coffee:1:coffee_to_js
coffee_to_js
Convert this CoffeeScript to JavaScript. ```coffeescript "use strict" Beautifier = require('./beautifier') module.exports = class MarkoBeautifier extends Beautifier name: 'Marko Beautifier' link: "https://github.com/marko-js/marko-prettyprint" options: Marko: true beautify: (text, language, options, con...
"use strict"; var Beautifier, MarkoBeautifier; Beautifier = require('./beautifier'); module.exports = MarkoBeautifier = (function() { class MarkoBeautifier extends Beautifier { beautify(text, language, options, context) { return new this.Promise(function(resolve, reject) { var error, i, indent, in...
CoffeeScript
JavaScript
Glavin001/atom-beautify
src/beautifiers/marko-beautifier.coffee
MIT
41d5051b399f7fe11efd149504a232df16179d60
1,503
https://github.com/Glavin001/atom-beautify/blob/41d5051b399f7fe11efd149504a232df16179d60/src/beautifiers/marko-beautifier.coffee
1
35
Glavin001/atom-beautify:src/beautifiers/marko-beautifier.coffee:1:js_to_coffee
js_to_coffee
Convert this JavaScript to CoffeeScript. ```javascript "use strict"; var Beautifier, MarkoBeautifier; Beautifier = require('./beautifier'); module.exports = MarkoBeautifier = (function() { class MarkoBeautifier extends Beautifier { beautify(text, language, options, context) { return new this.Promise(funct...
"use strict" Beautifier = require('./beautifier') module.exports = class MarkoBeautifier extends Beautifier name: 'Marko Beautifier' link: "https://github.com/marko-js/marko-prettyprint" options: Marko: true beautify: (text, language, options, context) -> return new @Promise((resolve, reject) -> ...
JavaScript
CoffeeScript
Glavin001/atom-beautify
src/beautifiers/marko-beautifier.coffee
MIT
41d5051b399f7fe11efd149504a232df16179d60
1,503
https://github.com/Glavin001/atom-beautify/blob/41d5051b399f7fe11efd149504a232df16179d60/src/beautifiers/marko-beautifier.coffee
1
35
Glavin001/atom-beautify:src/beautifiers/marko-beautifier.coffee:1:completion
completion
"use strict" Beautifier = require('./beautifier') module.exports = class MarkoBeautifier extends Beautifier name: 'Marko Beautifier' link: "https://github.com/marko-js/marko-prettyprint" options: Marko: true beautify: (text, language, options, context) -> return new @Promise((resolve, reject) -> ...
indent_size = options.indent_size || 4 indent = '' for i in [0..indent_size - 1] indent += indent_char prettyprintOptions = syntax : options.syntax filename: if context? and context.filePath? then context.filePath else require.resolve('marko-prettyprint') indent: ind...
CoffeeScript
CoffeeScript
Glavin001/atom-beautify
src/beautifiers/marko-beautifier.coffee
MIT
41d5051b399f7fe11efd149504a232df16179d60
1,503
https://github.com/Glavin001/atom-beautify/blob/41d5051b399f7fe11efd149504a232df16179d60/src/beautifiers/marko-beautifier.coffee
1
35
abe33/atom-pigments:lib/color-results-element.coffee:2:raw_corpus
raw_corpus
class ColorResultsElement extends HTMLElement SpacePenDSL.includeInto(this) EventsDelegation.includeInto(this) @content: -> @tag 'atom-panel', outlet: 'pane', class: 'preview-pane pane-item', => @div class: 'panel-heading', => @span outlet: 'previewCount', class: 'preview-count inline-block' ...
CoffeeScript
abe33/atom-pigments
lib/color-results-element.coffee
MIT
4bdef2e1ebeaa492a6c353c2fd9e7adecdebadf4
518
https://github.com/abe33/atom-pigments/blob/4bdef2e1ebeaa492a6c353c2fd9e7adecdebadf4/lib/color-results-element.coffee
10
59
abe33/atom-pigments:lib/color-results-element.coffee:2:coffee_to_js
coffee_to_js
Convert this CoffeeScript to JavaScript. ```coffeescript class ColorResultsElement extends HTMLElement SpacePenDSL.includeInto(this) EventsDelegation.includeInto(this) @content: -> @tag 'atom-panel', outlet: 'pane', class: 'preview-pane pane-item', => @div class: 'panel-heading', => @span outle...
var ColorResultsElement; ColorResultsElement = (function() { class ColorResultsElement extends HTMLElement { static content() { return this.tag('atom-panel', { outlet: 'pane', class: 'preview-pane pane-item' }, () => { this.div({ class: 'panel-heading' }, () ...
CoffeeScript
JavaScript
abe33/atom-pigments
lib/color-results-element.coffee
MIT
4bdef2e1ebeaa492a6c353c2fd9e7adecdebadf4
518
https://github.com/abe33/atom-pigments/blob/4bdef2e1ebeaa492a6c353c2fd9e7adecdebadf4/lib/color-results-element.coffee
10
59
abe33/atom-pigments:lib/color-results-element.coffee:2:js_to_coffee
js_to_coffee
Convert this JavaScript to CoffeeScript. ```javascript var ColorResultsElement; ColorResultsElement = (function() { class ColorResultsElement extends HTMLElement { static content() { return this.tag('atom-panel', { outlet: 'pane', class: 'preview-pane pane-item' }, () => { thi...
class ColorResultsElement extends HTMLElement SpacePenDSL.includeInto(this) EventsDelegation.includeInto(this) @content: -> @tag 'atom-panel', outlet: 'pane', class: 'preview-pane pane-item', => @div class: 'panel-heading', => @span outlet: 'previewCount', class: 'preview-count inline-block' ...
JavaScript
CoffeeScript
abe33/atom-pigments
lib/color-results-element.coffee
MIT
4bdef2e1ebeaa492a6c353c2fd9e7adecdebadf4
518
https://github.com/abe33/atom-pigments/blob/4bdef2e1ebeaa492a6c353c2fd9e7adecdebadf4/lib/color-results-element.coffee
10
59
abe33/atom-pigments:lib/color-results-element.coffee:2:completion
completion
class ColorResultsElement extends HTMLElement SpacePenDSL.includeInto(this) EventsDelegation.includeInto(this) @content: -> @tag 'atom-panel', outlet: 'pane', class: 'preview-pane pane-item', => @div class: 'panel-heading', => @span outlet: 'previewCount', class: 'preview-count inline-block' ...
@loadingMessage.style.display = 'none' @subscriptions.add @subscribeTo this, '.list-nested-item > .list-item', click: (e) -> e.stopPropagation() fileItem = AncestorsMethods.parents(e.target,'.list-nested-item')[0] fileItem.classList.toggle('collapsed') @subscriptions.add @subscri...
CoffeeScript
CoffeeScript
abe33/atom-pigments
lib/color-results-element.coffee
MIT
4bdef2e1ebeaa492a6c353c2fd9e7adecdebadf4
518
https://github.com/abe33/atom-pigments/blob/4bdef2e1ebeaa492a6c353c2fd9e7adecdebadf4/lib/color-results-element.coffee
10
59
abe33/atom-pigments:lib/color-results-element.coffee:3:raw_corpus
raw_corpus
setModel: (@colorSearch) -> @subscriptions.add @colorSearch.onDidFindMatches (result) => @addFileResult(result) @subscriptions.add @colorSearch.onDidCompleteSearch => @searchComplete() @colorSearch.search() addFileResult: (result) -> @files += 1 @colors += result.matches.length ...
CoffeeScript
abe33/atom-pigments
lib/color-results-element.coffee
MIT
4bdef2e1ebeaa492a6c353c2fd9e7adecdebadf4
518
https://github.com/abe33/atom-pigments/blob/4bdef2e1ebeaa492a6c353c2fd9e7adecdebadf4/lib/color-results-element.coffee
60
109
abe33/atom-pigments:lib/color-results-element.coffee:3:completion
completion
setModel: (@colorSearch) -> @subscriptions.add @colorSearch.onDidFindMatches (result) => @addFileResult(result) @subscriptions.add @colorSearch.onDidCompleteSearch => @searchComplete() @colorSearch.search() addFileResult: (result) -> @files += 1 @colors += result.matches.length ...
</ul> """ updateMessage: -> filesString = if @files is 1 then 'file' else 'files' @previewCount.innerHTML = if @colors > 0 """ <span class='text-info'> #{@colors} colors </span> found in <span class='text-info'> #{@files} #{filesString} </span> ...
CoffeeScript
CoffeeScript
abe33/atom-pigments
lib/color-results-element.coffee
MIT
4bdef2e1ebeaa492a6c353c2fd9e7adecdebadf4
518
https://github.com/abe33/atom-pigments/blob/4bdef2e1ebeaa492a6c353c2fd9e7adecdebadf4/lib/color-results-element.coffee
60
109
abe33/atom-pigments:lib/color-results-element.coffee:4:raw_corpus
raw_corpus
pathAttribute = _.escapeAttribute(filePath) @pathMapping[pathAttribute] = filePath pathName = atom.project.relativize(filePath) """ <li class="path list-nested-item" data-path="#{pathAttribute}"> <div class="path-details list-item"> <span class="disclosure-arrow"></span> <span cla...
CoffeeScript
abe33/atom-pigments
lib/color-results-element.coffee
MIT
4bdef2e1ebeaa492a6c353c2fd9e7adecdebadf4
518
https://github.com/abe33/atom-pigments/blob/4bdef2e1ebeaa492a6c353c2fd9e7adecdebadf4/lib/color-results-element.coffee
110
156
abe33/atom-pigments:lib/color-results-element.coffee:4:completion
completion
pathAttribute = _.escapeAttribute(filePath) @pathMapping[pathAttribute] = filePath pathName = atom.project.relativize(filePath) """ <li class="path list-nested-item" data-path="#{pathAttribute}"> <div class="path-details list-item"> <span class="disclosure-arrow"></span> <span cla...
'white' {filePath, range} = match range = Range.fromObject(range) matchStart = range.start.column - match.lineTextOffset matchEnd = range.end.column - match.lineTextOffset prefix = removeLeadingWhitespace(match.lineText[0...matchStart]) suffix = match.lineText[matchEnd..] lineNumber = rang...
CoffeeScript
CoffeeScript
abe33/atom-pigments
lib/color-results-element.coffee
MIT
4bdef2e1ebeaa492a6c353c2fd9e7adecdebadf4
518
https://github.com/abe33/atom-pigments/blob/4bdef2e1ebeaa492a6c353c2fd9e7adecdebadf4/lib/color-results-element.coffee
110
156
abe33/atom-pigments:lib/color-results-element.coffee:2:raw_corpus
raw_corpus
class ColorResultsElement extends HTMLElement SpacePenDSL.includeInto(this) EventsDelegation.includeInto(this) @content: -> @tag 'atom-panel', outlet: 'pane', class: 'preview-pane pane-item', => @div class: 'panel-heading', => @span outlet: 'previewCount', class: 'preview-count inline-block' ...
CoffeeScript
abe33/atom-pigments
lib/color-results-element.coffee
MIT
a039f07c4cd39f1bdc650dbe335675f08c001852
518
https://github.com/abe33/atom-pigments/blob/a039f07c4cd39f1bdc650dbe335675f08c001852/lib/color-results-element.coffee
9
58
abe33/atom-pigments:lib/color-results-element.coffee:2:coffee_to_js
coffee_to_js
Convert this CoffeeScript to JavaScript. ```coffeescript class ColorResultsElement extends HTMLElement SpacePenDSL.includeInto(this) EventsDelegation.includeInto(this) @content: -> @tag 'atom-panel', outlet: 'pane', class: 'preview-pane pane-item', => @div class: 'panel-heading', => @span outle...
var ColorResultsElement; ColorResultsElement = (function() { class ColorResultsElement extends HTMLElement { static content() { return this.tag('atom-panel', { outlet: 'pane', class: 'preview-pane pane-item' }, () => { this.div({ class: 'panel-heading' }, () ...
CoffeeScript
JavaScript
abe33/atom-pigments
lib/color-results-element.coffee
MIT
a039f07c4cd39f1bdc650dbe335675f08c001852
518
https://github.com/abe33/atom-pigments/blob/a039f07c4cd39f1bdc650dbe335675f08c001852/lib/color-results-element.coffee
9
58
abe33/atom-pigments:lib/color-results-element.coffee:2:js_to_coffee
js_to_coffee
Convert this JavaScript to CoffeeScript. ```javascript var ColorResultsElement; ColorResultsElement = (function() { class ColorResultsElement extends HTMLElement { static content() { return this.tag('atom-panel', { outlet: 'pane', class: 'preview-pane pane-item' }, () => { thi...
class ColorResultsElement extends HTMLElement SpacePenDSL.includeInto(this) EventsDelegation.includeInto(this) @content: -> @tag 'atom-panel', outlet: 'pane', class: 'preview-pane pane-item', => @div class: 'panel-heading', => @span outlet: 'previewCount', class: 'preview-count inline-block' ...
JavaScript
CoffeeScript
abe33/atom-pigments
lib/color-results-element.coffee
MIT
a039f07c4cd39f1bdc650dbe335675f08c001852
518
https://github.com/abe33/atom-pigments/blob/a039f07c4cd39f1bdc650dbe335675f08c001852/lib/color-results-element.coffee
9
58
abe33/atom-pigments:lib/color-results-element.coffee:2:completion
completion
class ColorResultsElement extends HTMLElement SpacePenDSL.includeInto(this) EventsDelegation.includeInto(this) @content: -> @tag 'atom-panel', outlet: 'pane', class: 'preview-pane pane-item', => @div class: 'panel-heading', => @span outlet: 'previewCount', class: 'preview-count inline-block' ...
@subscriptions.add @subscribeTo this, '.list-nested-item > .list-item', click: (e) -> e.stopPropagation() fileItem = AncestorsMethods.parents(e.target,'.list-nested-item')[0] fileItem.classList.toggle('collapsed') @subscriptions.add @subscribeTo this, '.search-result', click: (e...
CoffeeScript
CoffeeScript
abe33/atom-pigments
lib/color-results-element.coffee
MIT
a039f07c4cd39f1bdc650dbe335675f08c001852
518
https://github.com/abe33/atom-pigments/blob/a039f07c4cd39f1bdc650dbe335675f08c001852/lib/color-results-element.coffee
9
58
abe33/atom-pigments:lib/color-results-element.coffee:3:raw_corpus
raw_corpus
@addFileResult(result) @subscriptions.add @colorSearch.onDidCompleteSearch => @searchComplete() @colorSearch.search() addFileResult: (result) -> @files += 1 @colors += result.matches.length @resultsList.innerHTML += @createFileResult(result) @updateMessage() searchComplete: -> ...
CoffeeScript
abe33/atom-pigments
lib/color-results-element.coffee
MIT
a039f07c4cd39f1bdc650dbe335675f08c001852
518
https://github.com/abe33/atom-pigments/blob/a039f07c4cd39f1bdc650dbe335675f08c001852/lib/color-results-element.coffee
59
108
abe33/atom-pigments:lib/color-results-element.coffee:3:completion
completion
@addFileResult(result) @subscriptions.add @colorSearch.onDidCompleteSearch => @searchComplete() @colorSearch.search() addFileResult: (result) -> @files += 1 @colors += result.matches.length @resultsList.innerHTML += @createFileResult(result) @updateMessage() searchComplete: -> ...
updateMessage: -> filesString = if @files is 1 then 'file' else 'files' @previewCount.innerHTML = if @colors > 0 """ <span class='text-info'> #{@colors} colors </span> found in <span class='text-info'> #{@files} #{filesString} </span> """ else ...
CoffeeScript
CoffeeScript
abe33/atom-pigments
lib/color-results-element.coffee
MIT
a039f07c4cd39f1bdc650dbe335675f08c001852
518
https://github.com/abe33/atom-pigments/blob/a039f07c4cd39f1bdc650dbe335675f08c001852/lib/color-results-element.coffee
59
108
abe33/atom-pigments:lib/color-results-element.coffee:4:raw_corpus
raw_corpus
<li class="path list-nested-item" data-path="#{pathAttribute}"> <div class="path-details list-item"> <span class="disclosure-arrow"></span> <span class="icon icon-file-text" data-name="#{fileBasename}"></span> <span class="path-name bright">#{pathName}</span> <span class="path-matc...
CoffeeScript
abe33/atom-pigments
lib/color-results-element.coffee
MIT
a039f07c4cd39f1bdc650dbe335675f08c001852
518
https://github.com/abe33/atom-pigments/blob/a039f07c4cd39f1bdc650dbe335675f08c001852/lib/color-results-element.coffee
109
148
abe33/atom-pigments:lib/color-results-element.coffee:4:completion
completion
<li class="path list-nested-item" data-path="#{pathAttribute}"> <div class="path-details list-item"> <span class="disclosure-arrow"></span> <span class="icon icon-file-text" data-name="#{fileBasename}"></span> <span class="path-name bright">#{pathName}</span> <span class="path-matc...
range = Range.fromObject(range) matchStart = range.start.column - match.lineTextOffset matchEnd = range.end.column - match.lineTextOffset prefix = removeLeadingWhitespace(match.lineText[0...matchStart]) suffix = match.lineText[matchEnd..] lineNumber = range.start.row + 1 style = '' style += ...
CoffeeScript
CoffeeScript
abe33/atom-pigments
lib/color-results-element.coffee
MIT
a039f07c4cd39f1bdc650dbe335675f08c001852
518
https://github.com/abe33/atom-pigments/blob/a039f07c4cd39f1bdc650dbe335675f08c001852/lib/color-results-element.coffee
109
148
abe33/atom-pigments:lib/color-results-element.coffee:6:raw_corpus
raw_corpus
ColorResultsElement.registerViewProvider = (modelClass) -> atom.views.addViewProvider modelClass, (model) -> element = new ColorResultsElement element.setModel(model) element
CoffeeScript
abe33/atom-pigments
lib/color-results-element.coffee
MIT
0d39d82c192a24bbc3558fc10b9e3f04f79122c5
518
https://github.com/abe33/atom-pigments/blob/0d39d82c192a24bbc3558fc10b9e3f04f79122c5/lib/color-results-element.coffee
156
160
abe33/atom-pigments:lib/color-results-element.coffee:6:coffee_to_js
coffee_to_js
Convert this CoffeeScript to JavaScript. ```coffeescript ColorResultsElement.registerViewProvider = (modelClass) -> atom.views.addViewProvider modelClass, (model) -> element = new ColorResultsElement element.setModel(model) element ```
ColorResultsElement.registerViewProvider = function(modelClass) { return atom.views.addViewProvider(modelClass, function(model) { var element; element = new ColorResultsElement(); element.setModel(model); return element; }); };
CoffeeScript
JavaScript
abe33/atom-pigments
lib/color-results-element.coffee
MIT
0d39d82c192a24bbc3558fc10b9e3f04f79122c5
518
https://github.com/abe33/atom-pigments/blob/0d39d82c192a24bbc3558fc10b9e3f04f79122c5/lib/color-results-element.coffee
156
160
abe33/atom-pigments:lib/color-results-element.coffee:6:js_to_coffee
js_to_coffee
Convert this JavaScript to CoffeeScript. ```javascript ColorResultsElement.registerViewProvider = function(modelClass) { return atom.views.addViewProvider(modelClass, function(model) { var element; element = new ColorResultsElement(); element.setModel(model); return element; }); }; ```
ColorResultsElement.registerViewProvider = (modelClass) -> atom.views.addViewProvider modelClass, (model) -> element = new ColorResultsElement element.setModel(model) element
JavaScript
CoffeeScript
abe33/atom-pigments
lib/color-results-element.coffee
MIT
0d39d82c192a24bbc3558fc10b9e3f04f79122c5
518
https://github.com/abe33/atom-pigments/blob/0d39d82c192a24bbc3558fc10b9e3f04f79122c5/lib/color-results-element.coffee
156
160
abe33/atom-pigments:lib/color-results-element.coffee:6:completion
completion
ColorResultsElement.registerViewProvider = (modelClass) -> atom.views.addViewProvider modelClass, (model) ->
element = new ColorResultsElement element.setModel(model) element
CoffeeScript
CoffeeScript
abe33/atom-pigments
lib/color-results-element.coffee
MIT
0d39d82c192a24bbc3558fc10b9e3f04f79122c5
518
https://github.com/abe33/atom-pigments/blob/0d39d82c192a24bbc3558fc10b9e3f04f79122c5/lib/color-results-element.coffee
156
160
abe33/atom-pigments:lib/color-results-element.coffee:3:raw_corpus
raw_corpus
@addFileResult(result) @subscriptions.add @colorSearch.onDidCompleteSearch => @searchComplete() @colorSearch.search() getTitle: -> 'Pigments Find Results' getURI: -> 'pigments://search' getIconName: -> "pigments" addFileResult: (result) -> @files += 1 @colors += result.matches.length...
CoffeeScript
abe33/atom-pigments
lib/color-results-element.coffee
MIT
447fe35b45cc9bcf249df46f93bfea68aded4d68
518
https://github.com/abe33/atom-pigments/blob/447fe35b45cc9bcf249df46f93bfea68aded4d68/lib/color-results-element.coffee
59
108
abe33/atom-pigments:lib/color-results-element.coffee:3:completion
completion
@addFileResult(result) @subscriptions.add @colorSearch.onDidCompleteSearch => @searchComplete() @colorSearch.search() getTitle: -> 'Pigments Find Results' getURI: -> 'pigments://search' getIconName: -> "pigments" addFileResult: (result) -> @files += 1 @colors += result.matches.length...
@pane.appendChild """ <ul class='centered background-message no-results-overlay'> <li>No Results</li> </ul> """ updateMessage: -> filesString = if @files is 1 then 'file' else 'files' @previewCount.innerHTML = if @colors > 0 """ <span class='text-info'> #{@color...
CoffeeScript
CoffeeScript
abe33/atom-pigments
lib/color-results-element.coffee
MIT
447fe35b45cc9bcf249df46f93bfea68aded4d68
518
https://github.com/abe33/atom-pigments/blob/447fe35b45cc9bcf249df46f93bfea68aded4d68/lib/color-results-element.coffee
59
108
abe33/atom-pigments:lib/color-results-element.coffee:4:raw_corpus
raw_corpus
pathAttribute = _.escapeAttribute(filePath) @pathMapping[pathAttribute] = filePath pathName = atom.project.relativize(filePath) """ <li class="path list-nested-item" data-path="#{pathAttribute}"> <div class="path-details list-item"> <span class="disclosure-arrow"></span> <span cla...
CoffeeScript
abe33/atom-pigments
lib/color-results-element.coffee
MIT
447fe35b45cc9bcf249df46f93bfea68aded4d68
518
https://github.com/abe33/atom-pigments/blob/447fe35b45cc9bcf249df46f93bfea68aded4d68/lib/color-results-element.coffee
109
154
abe33/atom-pigments:lib/color-results-element.coffee:4:completion
completion
pathAttribute = _.escapeAttribute(filePath) @pathMapping[pathAttribute] = filePath pathName = atom.project.relativize(filePath) """ <li class="path list-nested-item" data-path="#{pathAttribute}"> <div class="path-details list-item"> <span class="disclosure-arrow"></span> <span cla...
{filePath, range} = match range = Range.fromObject(range) matchStart = range.start.column - match.lineTextOffset matchEnd = range.end.column - match.lineTextOffset prefix = removeLeadingWhitespace(match.lineText[0...matchStart]) suffix = match.lineText[matchEnd..] lineNumber = range.start.row +...
CoffeeScript
CoffeeScript
abe33/atom-pigments
lib/color-results-element.coffee
MIT
447fe35b45cc9bcf249df46f93bfea68aded4d68
518
https://github.com/abe33/atom-pigments/blob/447fe35b45cc9bcf249df46f93bfea68aded4d68/lib/color-results-element.coffee
109
154
abe33/atom-pigments:lib/color-results-element.coffee:2:raw_corpus
raw_corpus
class ColorResultsElement extends HTMLElement SpacePenDSL.includeInto(this) EventsDelegation.includeInto(this) @content: -> @tag 'atom-panel', outlet: 'pane', class: 'preview-pane pane-item', => @div class: 'panel-heading', => @span outlet: 'previewCount', class: 'preview-count inline-block' ...
CoffeeScript
abe33/atom-pigments
lib/color-results-element.coffee
MIT
0874de30e26297aa5ee58221c4de19c0f18c1cf7
518
https://github.com/abe33/atom-pigments/blob/0874de30e26297aa5ee58221c4de19c0f18c1cf7/lib/color-results-element.coffee
9
58
abe33/atom-pigments:lib/color-results-element.coffee:2:coffee_to_js
coffee_to_js
Convert this CoffeeScript to JavaScript. ```coffeescript class ColorResultsElement extends HTMLElement SpacePenDSL.includeInto(this) EventsDelegation.includeInto(this) @content: -> @tag 'atom-panel', outlet: 'pane', class: 'preview-pane pane-item', => @div class: 'panel-heading', => @span outle...
var ColorResultsElement; ColorResultsElement = (function() { class ColorResultsElement extends HTMLElement { static content() { return this.tag('atom-panel', { outlet: 'pane', class: 'preview-pane pane-item' }, () => { this.div({ class: 'panel-heading' }, () ...
CoffeeScript
JavaScript
abe33/atom-pigments
lib/color-results-element.coffee
MIT
0874de30e26297aa5ee58221c4de19c0f18c1cf7
518
https://github.com/abe33/atom-pigments/blob/0874de30e26297aa5ee58221c4de19c0f18c1cf7/lib/color-results-element.coffee
9
58
abe33/atom-pigments:lib/color-results-element.coffee:2:js_to_coffee
js_to_coffee
Convert this JavaScript to CoffeeScript. ```javascript var ColorResultsElement; ColorResultsElement = (function() { class ColorResultsElement extends HTMLElement { static content() { return this.tag('atom-panel', { outlet: 'pane', class: 'preview-pane pane-item' }, () => { thi...
class ColorResultsElement extends HTMLElement SpacePenDSL.includeInto(this) EventsDelegation.includeInto(this) @content: -> @tag 'atom-panel', outlet: 'pane', class: 'preview-pane pane-item', => @div class: 'panel-heading', => @span outlet: 'previewCount', class: 'preview-count inline-block' ...
JavaScript
CoffeeScript
abe33/atom-pigments
lib/color-results-element.coffee
MIT
0874de30e26297aa5ee58221c4de19c0f18c1cf7
518
https://github.com/abe33/atom-pigments/blob/0874de30e26297aa5ee58221c4de19c0f18c1cf7/lib/color-results-element.coffee
9
58
abe33/atom-pigments:lib/color-results-element.coffee:2:completion
completion
class ColorResultsElement extends HTMLElement SpacePenDSL.includeInto(this) EventsDelegation.includeInto(this) @content: -> @tag 'atom-panel', outlet: 'pane', class: 'preview-pane pane-item', => @div class: 'panel-heading', => @span outlet: 'previewCount', class: 'preview-count inline-block' ...
@subscriptions.add @subscribeTo this, '.list-nested-item > .list-item', click: (e) -> e.stopPropagation() fileItem = AncestorsMethods.parents(e.target,'.list-nested-item')[0] fileItem.classList.toggle('collapsed') @subscriptions.add @subscribeTo this, '.search-result', click: (e...
CoffeeScript
CoffeeScript
abe33/atom-pigments
lib/color-results-element.coffee
MIT
0874de30e26297aa5ee58221c4de19c0f18c1cf7
518
https://github.com/abe33/atom-pigments/blob/0874de30e26297aa5ee58221c4de19c0f18c1cf7/lib/color-results-element.coffee
9
58
abe33/atom-pigments:lib/color-results-element.coffee:2:raw_corpus
raw_corpus
class ColorResultsElement extends HTMLElement SpacePenDSL.includeInto(this) EventsDelegation.includeInto(this) @content: -> @tag 'atom-panel', outlet: 'pane', class: 'preview-pane pane-item', => @div class: 'panel-heading', => @span outlet: 'previewCount', class: 'preview-count inline-block' ...
CoffeeScript
abe33/atom-pigments
lib/color-results-element.coffee
MIT
6b9b5368e8a617bbb73ccdb1da96350aba9fd444
518
https://github.com/abe33/atom-pigments/blob/6b9b5368e8a617bbb73ccdb1da96350aba9fd444/lib/color-results-element.coffee
9
58
abe33/atom-pigments:lib/color-results-element.coffee:2:coffee_to_js
coffee_to_js
Convert this CoffeeScript to JavaScript. ```coffeescript class ColorResultsElement extends HTMLElement SpacePenDSL.includeInto(this) EventsDelegation.includeInto(this) @content: -> @tag 'atom-panel', outlet: 'pane', class: 'preview-pane pane-item', => @div class: 'panel-heading', => @span outle...
var ColorResultsElement; ColorResultsElement = (function() { class ColorResultsElement extends HTMLElement { static content() { return this.tag('atom-panel', { outlet: 'pane', class: 'preview-pane pane-item' }, () => { this.div({ class: 'panel-heading' }, () ...
CoffeeScript
JavaScript
abe33/atom-pigments
lib/color-results-element.coffee
MIT
6b9b5368e8a617bbb73ccdb1da96350aba9fd444
518
https://github.com/abe33/atom-pigments/blob/6b9b5368e8a617bbb73ccdb1da96350aba9fd444/lib/color-results-element.coffee
9
58
abe33/atom-pigments:lib/color-results-element.coffee:2:js_to_coffee
js_to_coffee
Convert this JavaScript to CoffeeScript. ```javascript var ColorResultsElement; ColorResultsElement = (function() { class ColorResultsElement extends HTMLElement { static content() { return this.tag('atom-panel', { outlet: 'pane', class: 'preview-pane pane-item' }, () => { thi...
class ColorResultsElement extends HTMLElement SpacePenDSL.includeInto(this) EventsDelegation.includeInto(this) @content: -> @tag 'atom-panel', outlet: 'pane', class: 'preview-pane pane-item', => @div class: 'panel-heading', => @span outlet: 'previewCount', class: 'preview-count inline-block' ...
JavaScript
CoffeeScript
abe33/atom-pigments
lib/color-results-element.coffee
MIT
6b9b5368e8a617bbb73ccdb1da96350aba9fd444
518
https://github.com/abe33/atom-pigments/blob/6b9b5368e8a617bbb73ccdb1da96350aba9fd444/lib/color-results-element.coffee
9
58
abe33/atom-pigments:lib/color-results-element.coffee:2:completion
completion
class ColorResultsElement extends HTMLElement SpacePenDSL.includeInto(this) EventsDelegation.includeInto(this) @content: -> @tag 'atom-panel', outlet: 'pane', class: 'preview-pane pane-item', => @div class: 'panel-heading', => @span outlet: 'previewCount', class: 'preview-count inline-block' ...
@subscriptions.add @subscribeTo this, '.list-nested-item > .list-item', click: (e) -> e.stopPropagation() fileItem = AncestorsMethods.parents(e.target,'.list-nested-item')[0] fileItem.classList.toggle('collapsed') @subscriptions.add @subscribeTo this, '.search-result', click: (e...
CoffeeScript
CoffeeScript
abe33/atom-pigments
lib/color-results-element.coffee
MIT
6b9b5368e8a617bbb73ccdb1da96350aba9fd444
518
https://github.com/abe33/atom-pigments/blob/6b9b5368e8a617bbb73ccdb1da96350aba9fd444/lib/color-results-element.coffee
9
58
abe33/atom-pigments:lib/color-results-element.coffee:3:raw_corpus
raw_corpus
@subscriptions.add @colorSearch.onDidCompleteSearch => @searchComplete() @colorSearch.search() getTitle: -> 'Pigments Find Results' getURI: -> 'pigments://search' getIconName: -> "pigments" addFileResult: (result) -> @files += 1 @colors += result.matches.length @resultsList.innerHTML...
CoffeeScript
abe33/atom-pigments
lib/color-results-element.coffee
MIT
6b9b5368e8a617bbb73ccdb1da96350aba9fd444
518
https://github.com/abe33/atom-pigments/blob/6b9b5368e8a617bbb73ccdb1da96350aba9fd444/lib/color-results-element.coffee
59
108
abe33/atom-pigments:lib/color-results-element.coffee:3:coffee_to_js
coffee_to_js
Convert this CoffeeScript to JavaScript. ```coffeescript @subscriptions.add @colorSearch.onDidCompleteSearch => @searchComplete() @colorSearch.search() getTitle: -> 'Pigments Find Results' getURI: -> 'pigments://search' getIconName: -> "pigments" addFileResult: (result) -> @files += 1 @co...
this.subscriptions.add(this.colorSearch.onDidCompleteSearch(() => { return this.searchComplete(); })); this.colorSearch.search(); ({ getTitle: function() { return 'Pigments Find Results'; }, getURI: function() { return 'pigments://search'; }, getIconName: function() { return "pigments"; }, ...
CoffeeScript
JavaScript
abe33/atom-pigments
lib/color-results-element.coffee
MIT
6b9b5368e8a617bbb73ccdb1da96350aba9fd444
518
https://github.com/abe33/atom-pigments/blob/6b9b5368e8a617bbb73ccdb1da96350aba9fd444/lib/color-results-element.coffee
59
108
abe33/atom-pigments:lib/color-results-element.coffee:3:js_to_coffee
js_to_coffee
Convert this JavaScript to CoffeeScript. ```javascript this.subscriptions.add(this.colorSearch.onDidCompleteSearch(() => { return this.searchComplete(); })); this.colorSearch.search(); ({ getTitle: function() { return 'Pigments Find Results'; }, getURI: function() { return 'pigments://search'; }, ...
@subscriptions.add @colorSearch.onDidCompleteSearch => @searchComplete() @colorSearch.search() getTitle: -> 'Pigments Find Results' getURI: -> 'pigments://search' getIconName: -> "pigments" addFileResult: (result) -> @files += 1 @colors += result.matches.length @resultsList.innerHTML...
JavaScript
CoffeeScript
abe33/atom-pigments
lib/color-results-element.coffee
MIT
6b9b5368e8a617bbb73ccdb1da96350aba9fd444
518
https://github.com/abe33/atom-pigments/blob/6b9b5368e8a617bbb73ccdb1da96350aba9fd444/lib/color-results-element.coffee
59
108
abe33/atom-pigments:lib/color-results-element.coffee:3:completion
completion
@subscriptions.add @colorSearch.onDidCompleteSearch => @searchComplete() @colorSearch.search() getTitle: -> 'Pigments Find Results' getURI: -> 'pigments://search' getIconName: -> "pigments" addFileResult: (result) -> @files += 1 @colors += result.matches.length @resultsList.innerHTML...
<li>No Results</li> </ul> """ updateMessage: -> filesString = if @files is 1 then 'file' else 'files' @previewCount.innerHTML = if @colors > 0 """ <span class='text-info'> #{@colors} colors </span> found in <span class='text-info'> #{@files} #{filesS...
CoffeeScript
CoffeeScript
abe33/atom-pigments
lib/color-results-element.coffee
MIT
6b9b5368e8a617bbb73ccdb1da96350aba9fd444
518
https://github.com/abe33/atom-pigments/blob/6b9b5368e8a617bbb73ccdb1da96350aba9fd444/lib/color-results-element.coffee
59
108
abe33/atom-pigments:lib/color-results-element.coffee:4:raw_corpus
raw_corpus
pathName = atom.project.relativize(filePath) """ <li class="path list-nested-item" data-path="#{pathAttribute}"> <div class="path-details list-item"> <span class="disclosure-arrow"></span> <span class="icon icon-file-text" data-name="#{fileBasename}"></span> <span class="path-name...
CoffeeScript
abe33/atom-pigments
lib/color-results-element.coffee
MIT
6b9b5368e8a617bbb73ccdb1da96350aba9fd444
518
https://github.com/abe33/atom-pigments/blob/6b9b5368e8a617bbb73ccdb1da96350aba9fd444/lib/color-results-element.coffee
109
154
abe33/atom-pigments:lib/color-results-element.coffee:4:completion
completion
pathName = atom.project.relativize(filePath) """ <li class="path list-nested-item" data-path="#{pathAttribute}"> <div class="path-details list-item"> <span class="disclosure-arrow"></span> <span class="icon icon-file-text" data-name="#{fileBasename}"></span> <span class="path-name...
range = Range.fromObject(range) matchStart = range.start.column - match.lineTextOffset matchEnd = range.end.column - match.lineTextOffset prefix = removeLeadingWhitespace(match.lineText[0...matchStart]) suffix = match.lineText[matchEnd..] lineNumber = range.start.row + 1 style = '' style += ...
CoffeeScript
CoffeeScript
abe33/atom-pigments
lib/color-results-element.coffee
MIT
6b9b5368e8a617bbb73ccdb1da96350aba9fd444
518
https://github.com/abe33/atom-pigments/blob/6b9b5368e8a617bbb73ccdb1da96350aba9fd444/lib/color-results-element.coffee
109
154
meltingice/psd.js:lib/psd/layer_info/solid_color.coffee:1:raw_corpus
raw_corpus
LayerInfo = require '../layer_info.coffee' Descriptor = require '../descriptor.coffee' module.exports = class SolidColor extends LayerInfo @shouldParse: (key) -> key is 'SoCo' constructor: (layer, length) -> super(layer, length) @r = @g = @b = 0 parse: -> @file.seek 4, true @data = new Descrip...
CoffeeScript
meltingice/psd.js
lib/psd/layer_info/solid_color.coffee
MIT
7e8392d20fd5d66ad70ddda7309661b9a0ca67c8
2,846
https://github.com/meltingice/psd.js/blob/7e8392d20fd5d66ad70ddda7309661b9a0ca67c8/lib/psd/layer_info/solid_color.coffee
1
21
meltingice/psd.js:lib/psd/layer_info/solid_color.coffee:1:coffee_to_js
coffee_to_js
Convert this CoffeeScript to JavaScript. ```coffeescript LayerInfo = require '../layer_info.coffee' Descriptor = require '../descriptor.coffee' module.exports = class SolidColor extends LayerInfo @shouldParse: (key) -> key is 'SoCo' constructor: (layer, length) -> super(layer, length) @r = @g = @b = 0 ...
var Descriptor, LayerInfo, SolidColor; LayerInfo = require('../layer_info.coffee'); Descriptor = require('../descriptor.coffee'); module.exports = SolidColor = class SolidColor extends LayerInfo { static shouldParse(key) { return key === 'SoCo'; } constructor(layer, length) { super(layer, length); ...
CoffeeScript
JavaScript
meltingice/psd.js
lib/psd/layer_info/solid_color.coffee
MIT
7e8392d20fd5d66ad70ddda7309661b9a0ca67c8
2,846
https://github.com/meltingice/psd.js/blob/7e8392d20fd5d66ad70ddda7309661b9a0ca67c8/lib/psd/layer_info/solid_color.coffee
1
21
meltingice/psd.js:lib/psd/layer_info/solid_color.coffee:1:js_to_coffee
js_to_coffee
Convert this JavaScript to CoffeeScript. ```javascript var Descriptor, LayerInfo, SolidColor; LayerInfo = require('../layer_info.coffee'); Descriptor = require('../descriptor.coffee'); module.exports = SolidColor = class SolidColor extends LayerInfo { static shouldParse(key) { return key === 'SoCo'; } con...
LayerInfo = require '../layer_info.coffee' Descriptor = require '../descriptor.coffee' module.exports = class SolidColor extends LayerInfo @shouldParse: (key) -> key is 'SoCo' constructor: (layer, length) -> super(layer, length) @r = @g = @b = 0 parse: -> @file.seek 4, true @data = new Descrip...
JavaScript
CoffeeScript
meltingice/psd.js
lib/psd/layer_info/solid_color.coffee
MIT
7e8392d20fd5d66ad70ddda7309661b9a0ca67c8
2,846
https://github.com/meltingice/psd.js/blob/7e8392d20fd5d66ad70ddda7309661b9a0ca67c8/lib/psd/layer_info/solid_color.coffee
1
21
meltingice/psd.js:lib/psd/layer_info/solid_color.coffee:1:completion
completion
LayerInfo = require '../layer_info.coffee' Descriptor = require '../descriptor.coffee' module.exports = class SolidColor extends LayerInfo @shouldParse: (key) -> key is 'SoCo' constructor: (layer, length) -> super(layer, length) @r = @g = @b = 0
parse: -> @file.seek 4, true @data = new Descriptor(@file).parse() @r = Math.round @colorData()['Rd '] @g = Math.round @colorData()['Grn '] @b = Math.round @colorData()['Bl '] colorData: -> @data['Clr '] color: -> [@r, @g, @b]
CoffeeScript
CoffeeScript
meltingice/psd.js
lib/psd/layer_info/solid_color.coffee
MIT
7e8392d20fd5d66ad70ddda7309661b9a0ca67c8
2,846
https://github.com/meltingice/psd.js/blob/7e8392d20fd5d66ad70ddda7309661b9a0ca67c8/lib/psd/layer_info/solid_color.coffee
1
21
meltingice/psd.js:lib/psd/layer_info/solid_color.coffee:1:raw_corpus
raw_corpus
LayerInfo = require '../layer_info.coffee' Descriptor = require '../descriptor.coffee' module.exports = class SolidColor extends LayerInfo @shouldParse: (key) -> key is 'SoCo' constructor: (layer, length) -> super(layer, length) @r = @g = @b = 0 parse: -> @file.seek 4, true @data = new Descrip...
CoffeeScript
meltingice/psd.js
lib/psd/layer_info/solid_color.coffee
MIT
4ce0325116dc84818b820d2723fb45e7fd5fafa1
2,846
https://github.com/meltingice/psd.js/blob/4ce0325116dc84818b820d2723fb45e7fd5fafa1/lib/psd/layer_info/solid_color.coffee
1
20
meltingice/psd.js:lib/psd/layer_info/solid_color.coffee:1:coffee_to_js
coffee_to_js
Convert this CoffeeScript to JavaScript. ```coffeescript LayerInfo = require '../layer_info.coffee' Descriptor = require '../descriptor.coffee' module.exports = class SolidColor extends LayerInfo @shouldParse: (key) -> key is 'SoCo' constructor: (layer, length) -> super(layer, length) @r = @g = @b = 0 ...
var Descriptor, LayerInfo, SolidColor; LayerInfo = require('../layer_info.coffee'); Descriptor = require('../descriptor.coffee'); module.exports = SolidColor = class SolidColor extends LayerInfo { static shouldParse(key) { return key === 'SoCo'; } constructor(layer, length) { super(layer, length); ...
CoffeeScript
JavaScript
meltingice/psd.js
lib/psd/layer_info/solid_color.coffee
MIT
4ce0325116dc84818b820d2723fb45e7fd5fafa1
2,846
https://github.com/meltingice/psd.js/blob/4ce0325116dc84818b820d2723fb45e7fd5fafa1/lib/psd/layer_info/solid_color.coffee
1
20
meltingice/psd.js:lib/psd/layer_info/solid_color.coffee:1:js_to_coffee
js_to_coffee
Convert this JavaScript to CoffeeScript. ```javascript var Descriptor, LayerInfo, SolidColor; LayerInfo = require('../layer_info.coffee'); Descriptor = require('../descriptor.coffee'); module.exports = SolidColor = class SolidColor extends LayerInfo { static shouldParse(key) { return key === 'SoCo'; } con...
LayerInfo = require '../layer_info.coffee' Descriptor = require '../descriptor.coffee' module.exports = class SolidColor extends LayerInfo @shouldParse: (key) -> key is 'SoCo' constructor: (layer, length) -> super(layer, length) @r = @g = @b = 0 parse: -> @file.seek 4, true @data = new Descrip...
JavaScript
CoffeeScript
meltingice/psd.js
lib/psd/layer_info/solid_color.coffee
MIT
4ce0325116dc84818b820d2723fb45e7fd5fafa1
2,846
https://github.com/meltingice/psd.js/blob/4ce0325116dc84818b820d2723fb45e7fd5fafa1/lib/psd/layer_info/solid_color.coffee
1
20
meltingice/psd.js:lib/psd/layer_info/solid_color.coffee:1:completion
completion
LayerInfo = require '../layer_info.coffee' Descriptor = require '../descriptor.coffee' module.exports = class SolidColor extends LayerInfo @shouldParse: (key) -> key is 'SoCo' constructor: (layer, length) -> super(layer, length) @r = @g = @b = 0
parse: -> @file.seek 4, true @data = new Descriptor(@file).parse() @r = Math.round @colorData()['Rd '] @g = Math.round @colorData()['Grn '] @b = Math.round @colorData()['Bl '] colorData: -> @data['Clr ']
CoffeeScript
CoffeeScript
meltingice/psd.js
lib/psd/layer_info/solid_color.coffee
MIT
4ce0325116dc84818b820d2723fb45e7fd5fafa1
2,846
https://github.com/meltingice/psd.js/blob/4ce0325116dc84818b820d2723fb45e7fd5fafa1/lib/psd/layer_info/solid_color.coffee
1
20
twilson63/express-coffee:lib/coffee/lib/coffee-script/test/test_operations.coffee:1:raw_corpus
raw_corpus
# CoffeeScript's operations should be chainable, like Python's. ok 500 > 50 > 5 > -5 ok true is not false is true is not false ok 0 is 0 isnt 50 is 50 ok 10 < 20 > 10 ok 50 > 10 > 5 is parseInt('5', 10) # Make sure that each argument is only evaluated once, even if used # more than once. i: 0 func: -> i++ ok 1 >...
CoffeeScript
twilson63/express-coffee
lib/coffee/lib/coffee-script/test/test_operations.coffee
MIT
971837f7d7a5e96cf5a5fdb52e52748060ed2c68
622
https://github.com/twilson63/express-coffee/blob/971837f7d7a5e96cf5a5fdb52e52748060ed2c68/lib/coffee/lib/coffee-script/test/test_operations.coffee
1
36
twilson63/express-coffee:lib/coffee/lib/coffee-script/test/test_operations.coffee:1:coffee_to_js
coffee_to_js
Convert this CoffeeScript to JavaScript. ```coffeescript # CoffeeScript's operations should be chainable, like Python's. ok 500 > 50 > 5 > -5 ok true is not false is true is not false ok 0 is 0 isnt 50 is 50 ok 10 < 20 > 10 ok 50 > 10 > 5 is parseInt('5', 10) # Make sure that each argument is only evaluated once,...
// CoffeeScript's operations should be chainable, like Python's. var ref, ref1, ref2; ok(((500 > 50 && 50 > 5) && 5 > -5)); ok(((true === (ref = !false) && ref === true) && true === !false)); ok(((0 === 0 && 0 !== 50) && 50 === 50)); ok((10 < 20 && 20 > 10)); ok(((50 > 10 && 10 > 5) && 5 === parseInt('5', 10))); ...
CoffeeScript
JavaScript
twilson63/express-coffee
lib/coffee/lib/coffee-script/test/test_operations.coffee
MIT
971837f7d7a5e96cf5a5fdb52e52748060ed2c68
622
https://github.com/twilson63/express-coffee/blob/971837f7d7a5e96cf5a5fdb52e52748060ed2c68/lib/coffee/lib/coffee-script/test/test_operations.coffee
1
36
twilson63/express-coffee:lib/coffee/lib/coffee-script/test/test_operations.coffee:1:js_to_coffee
js_to_coffee
Convert this JavaScript to CoffeeScript. ```javascript // CoffeeScript's operations should be chainable, like Python's. var ref, ref1, ref2; ok(((500 > 50 && 50 > 5) && 5 > -5)); ok(((true === (ref = !false) && ref === true) && true === !false)); ok(((0 === 0 && 0 !== 50) && 50 === 50)); ok((10 < 20 && 20 > 10)); ...
# CoffeeScript's operations should be chainable, like Python's. ok 500 > 50 > 5 > -5 ok true is not false is true is not false ok 0 is 0 isnt 50 is 50 ok 10 < 20 > 10 ok 50 > 10 > 5 is parseInt('5', 10) # Make sure that each argument is only evaluated once, even if used # more than once. i: 0 func: -> i++ ok 1 >...
JavaScript
CoffeeScript
twilson63/express-coffee
lib/coffee/lib/coffee-script/test/test_operations.coffee
MIT
971837f7d7a5e96cf5a5fdb52e52748060ed2c68
622
https://github.com/twilson63/express-coffee/blob/971837f7d7a5e96cf5a5fdb52e52748060ed2c68/lib/coffee/lib/coffee-script/test/test_operations.coffee
1
36
twilson63/express-coffee:lib/coffee/lib/coffee-script/test/test_operations.coffee:1:completion
completion
# CoffeeScript's operations should be chainable, like Python's. ok 500 > 50 > 5 > -5 ok true is not false is true is not false ok 0 is 0 isnt 50 is 50 ok 10 < 20 > 10 ok 50 > 10 > 5 is parseInt('5', 10) # Make sure that each argument is only evaluated once, even if used # more than once. i: 0 func: -> i++ ok 1 >...
# `:` and `=` should be interchangeable, as should be `==` and `is`. a: 1 b: 1 ok a is 1 and b is 1 ok a == b ok a is b # Ensure that chained operations don't cause functions to be evaluated more # than once. val: 0 func: -> val: + 1 ok 2 > (func null) < 2 ok val is 1
CoffeeScript
CoffeeScript
twilson63/express-coffee
lib/coffee/lib/coffee-script/test/test_operations.coffee
MIT
971837f7d7a5e96cf5a5fdb52e52748060ed2c68
622
https://github.com/twilson63/express-coffee/blob/971837f7d7a5e96cf5a5fdb52e52748060ed2c68/lib/coffee/lib/coffee-script/test/test_operations.coffee
1
36
meltingice/psd.js:lib/psd/layer_info/legacy_typetool.coffee:1:raw_corpus
raw_corpus
_ = require 'lodash' TypeTool = require './typetool.coffee' module.exports = class LegacyTypeTool extends TypeTool @shouldParse: (key) -> key is 'tySh' constructor: (layer, length) -> super(layer, length) @transform = {} @faces = [] @styles = [] @lines = [] @type = 0 @scalingFactor = ...
CoffeeScript
meltingice/psd.js
lib/psd/layer_info/legacy_typetool.coffee
MIT
7e8392d20fd5d66ad70ddda7309661b9a0ca67c8
2,846
https://github.com/meltingice/psd.js/blob/7e8392d20fd5d66ad70ddda7309661b9a0ca67c8/lib/psd/layer_info/legacy_typetool.coffee
1
50
meltingice/psd.js:lib/psd/layer_info/legacy_typetool.coffee:1:coffee_to_js
coffee_to_js
Convert this CoffeeScript to JavaScript. ```coffeescript _ = require 'lodash' TypeTool = require './typetool.coffee' module.exports = class LegacyTypeTool extends TypeTool @shouldParse: (key) -> key is 'tySh' constructor: (layer, length) -> super(layer, length) @transform = {} @faces = [] @styles...
var LegacyTypeTool, TypeTool, _; _ = require('lodash'); TypeTool = require('./typetool.coffee'); module.exports = LegacyTypeTool = class LegacyTypeTool extends TypeTool { static shouldParse(key) { return key === 'tySh'; } constructor(layer, length) { super(layer, length); this.transform = {}; ...
CoffeeScript
JavaScript
meltingice/psd.js
lib/psd/layer_info/legacy_typetool.coffee
MIT
7e8392d20fd5d66ad70ddda7309661b9a0ca67c8
2,846
https://github.com/meltingice/psd.js/blob/7e8392d20fd5d66ad70ddda7309661b9a0ca67c8/lib/psd/layer_info/legacy_typetool.coffee
1
50
meltingice/psd.js:lib/psd/layer_info/legacy_typetool.coffee:1:js_to_coffee
js_to_coffee
Convert this JavaScript to CoffeeScript. ```javascript var LegacyTypeTool, TypeTool, _; _ = require('lodash'); TypeTool = require('./typetool.coffee'); module.exports = LegacyTypeTool = class LegacyTypeTool extends TypeTool { static shouldParse(key) { return key === 'tySh'; } constructor(layer, length) { ...
_ = require 'lodash' TypeTool = require './typetool.coffee' module.exports = class LegacyTypeTool extends TypeTool @shouldParse: (key) -> key is 'tySh' constructor: (layer, length) -> super(layer, length) @transform = {} @faces = [] @styles = [] @lines = [] @type = 0 @scalingFactor = ...
JavaScript
CoffeeScript
meltingice/psd.js
lib/psd/layer_info/legacy_typetool.coffee
MIT
7e8392d20fd5d66ad70ddda7309661b9a0ca67c8
2,846
https://github.com/meltingice/psd.js/blob/7e8392d20fd5d66ad70ddda7309661b9a0ca67c8/lib/psd/layer_info/legacy_typetool.coffee
1
50
meltingice/psd.js:lib/psd/layer_info/legacy_typetool.coffee:1:completion
completion
_ = require 'lodash' TypeTool = require './typetool.coffee' module.exports = class LegacyTypeTool extends TypeTool @shouldParse: (key) -> key is 'tySh' constructor: (layer, length) -> super(layer, length) @transform = {} @faces = [] @styles = [] @lines = [] @type = 0 @scalingFactor = ...
@parseTransformInfo() # Font information @file.seek 2, true facesCount = @file.readShort() for i in [0...facesCount] @faces.push _({}).tap (face) => face.mark = @file.readShort() face.fontType = @file.readInt() face.fontName = @file.readString() face.fontFamilyNam...
CoffeeScript
CoffeeScript
meltingice/psd.js
lib/psd/layer_info/legacy_typetool.coffee
MIT
7e8392d20fd5d66ad70ddda7309661b9a0ca67c8
2,846
https://github.com/meltingice/psd.js/blob/7e8392d20fd5d66ad70ddda7309661b9a0ca67c8/lib/psd/layer_info/legacy_typetool.coffee
1
50
meltingice/psd.js:lib/psd/layer_info/legacy_typetool.coffee:2:raw_corpus
raw_corpus
style.size = @file.readInt() style.tracking = @file.readInt() style.kerning = @file.readInt() style.leading = @file.readInt() style.baseShift = @file.readInt() style.autoKern = @file.readBoolean() @file.seek 1, true style.rotate = @file.readBoolean() @type ...
CoffeeScript
meltingice/psd.js
lib/psd/layer_info/legacy_typetool.coffee
MIT
7e8392d20fd5d66ad70ddda7309661b9a0ca67c8
2,846
https://github.com/meltingice/psd.js/blob/7e8392d20fd5d66ad70ddda7309661b9a0ca67c8/lib/psd/layer_info/legacy_typetool.coffee
51
80
meltingice/psd.js:lib/psd/layer_info/legacy_typetool.coffee:2:completion
completion
style.size = @file.readInt() style.tracking = @file.readInt() style.kerning = @file.readInt() style.leading = @file.readInt() style.baseShift = @file.readInt() style.autoKern = @file.readBoolean() @file.seek 1, true style.rotate = @file.readBoolean() @type ...
@vertPlace = @file.readInt() @selectStart = @file.readInt() @selectEnd = @file.readInt() linesCount = @file.readShort() for i in [0...linesCount] @lines.push _({}).tap (line) -> line.charCount = @file.readInt() line.orientation = @file.readShort() line.alignment = @file.re...
CoffeeScript
CoffeeScript
meltingice/psd.js
lib/psd/layer_info/legacy_typetool.coffee
MIT
7e8392d20fd5d66ad70ddda7309661b9a0ca67c8
2,846
https://github.com/meltingice/psd.js/blob/7e8392d20fd5d66ad70ddda7309661b9a0ca67c8/lib/psd/layer_info/legacy_typetool.coffee
51
80
jianliaoim/talk-os:talk-web/client/app/favorites-header.coffee:1:raw_corpus
raw_corpus
React = require 'react' debounce = require 'debounce' PureRenderMixin = require 'react-addons-pure-render-mixin' div = React.createFactory 'div' span = React.createFactory 'span' input = React.createFactory 'input' lang = require '../locales/lang' detect = require '../util/detect' Icon = React.createFactory requi...
CoffeeScript
jianliaoim/talk-os
talk-web/client/app/favorites-header.coffee
MIT
2545c4497865779a55762e03963a39237df9046b
2,703
https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-web/client/app/favorites-header.coffee
1
39
jianliaoim/talk-os:talk-web/client/app/favorites-header.coffee:1:coffee_to_js
coffee_to_js
Convert this CoffeeScript to JavaScript. ```coffeescript React = require 'react' debounce = require 'debounce' PureRenderMixin = require 'react-addons-pure-render-mixin' div = React.createFactory 'div' span = React.createFactory 'span' input = React.createFactory 'input' lang = require '../locales/lang' detect = ...
var Icon, PureRenderMixin, React, T, debounce, detect, div, input, lang, span; React = require('react'); debounce = require('debounce'); PureRenderMixin = require('react-addons-pure-render-mixin'); div = React.createFactory('div'); span = React.createFactory('span'); input = React.createFactory('input'); lang = ...
CoffeeScript
JavaScript
jianliaoim/talk-os
talk-web/client/app/favorites-header.coffee
MIT
2545c4497865779a55762e03963a39237df9046b
2,703
https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-web/client/app/favorites-header.coffee
1
39
jianliaoim/talk-os:talk-web/client/app/favorites-header.coffee:1:js_to_coffee
js_to_coffee
Convert this JavaScript to CoffeeScript. ```javascript var Icon, PureRenderMixin, React, T, debounce, detect, div, input, lang, span; React = require('react'); debounce = require('debounce'); PureRenderMixin = require('react-addons-pure-render-mixin'); div = React.createFactory('div'); span = React.createFactory('...
React = require 'react' debounce = require 'debounce' PureRenderMixin = require 'react-addons-pure-render-mixin' div = React.createFactory 'div' span = React.createFactory 'span' input = React.createFactory 'input' lang = require '../locales/lang' detect = require '../util/detect' Icon = React.createFactory requi...
JavaScript
CoffeeScript
jianliaoim/talk-os
talk-web/client/app/favorites-header.coffee
MIT
2545c4497865779a55762e03963a39237df9046b
2,703
https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-web/client/app/favorites-header.coffee
1
39
jianliaoim/talk-os:talk-web/client/app/favorites-header.coffee:1:completion
completion
React = require 'react' debounce = require 'debounce' PureRenderMixin = require 'react-addons-pure-render-mixin' div = React.createFactory 'div' span = React.createFactory 'span' input = React.createFactory 'input' lang = require '../locales/lang' detect = require '../util/detect' Icon = React.createFactory requi...
propTypes: onChange: T.func componentWillMount: -> @debouncedChange = debounce @onChange, 600 onChange: -> value = @refs.input.value @props.onChange value render: -> div className: 'search-header favorites-header', div className: 'form-control flex-horiz flex-vcenter', input ...
CoffeeScript
CoffeeScript
jianliaoim/talk-os
talk-web/client/app/favorites-header.coffee
MIT
2545c4497865779a55762e03963a39237df9046b
2,703
https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-web/client/app/favorites-header.coffee
1
39
rs/pushd:pushd.coffee:1:raw_corpus
raw_corpus
createSubscriber = (fields, cb) -> logger.verbose "creating subscriber proto = #{fields.proto}, token = #{fields.token}" throw new Error("Invalid value for `proto'") unless service = pushServices.getService(fields.proto) throw new Error("Invalid value for `token'") unless fields.token = service.validateToke...
CoffeeScript
rs/pushd
pushd.coffee
MIT
9dc56de9da2a64903cad510d22d4d0e078a8ba0a
1,157
https://github.com/rs/pushd/blob/9dc56de9da2a64903cad510d22d4d0e078a8ba0a/pushd.coffee
36
40
rs/pushd:pushd.coffee:1:coffee_to_js
coffee_to_js
Convert this CoffeeScript to JavaScript. ```coffeescript createSubscriber = (fields, cb) -> logger.verbose "creating subscriber proto = #{fields.proto}, token = #{fields.token}" throw new Error("Invalid value for `proto'") unless service = pushServices.getService(fields.proto) throw new Error("Invalid value...
var createSubscriber; createSubscriber = function(fields, cb) { var service; logger.verbose(`creating subscriber proto = ${fields.proto}, token = ${fields.token}`); if (!(service = pushServices.getService(fields.proto))) { throw new Error("Invalid value for `proto'"); } if (!(fields.token = service.valid...
CoffeeScript
JavaScript
rs/pushd
pushd.coffee
MIT
9dc56de9da2a64903cad510d22d4d0e078a8ba0a
1,157
https://github.com/rs/pushd/blob/9dc56de9da2a64903cad510d22d4d0e078a8ba0a/pushd.coffee
36
40
rs/pushd:pushd.coffee:1:js_to_coffee
js_to_coffee
Convert this JavaScript to CoffeeScript. ```javascript var createSubscriber; createSubscriber = function(fields, cb) { var service; logger.verbose(`creating subscriber proto = ${fields.proto}, token = ${fields.token}`); if (!(service = pushServices.getService(fields.proto))) { throw new Error("Invalid value ...
createSubscriber = (fields, cb) -> logger.verbose "creating subscriber proto = #{fields.proto}, token = #{fields.token}" throw new Error("Invalid value for `proto'") unless service = pushServices.getService(fields.proto) throw new Error("Invalid value for `token'") unless fields.token = service.validateToke...
JavaScript
CoffeeScript
rs/pushd
pushd.coffee
MIT
9dc56de9da2a64903cad510d22d4d0e078a8ba0a
1,157
https://github.com/rs/pushd/blob/9dc56de9da2a64903cad510d22d4d0e078a8ba0a/pushd.coffee
36
40
rs/pushd:pushd.coffee:1:completion
completion
createSubscriber = (fields, cb) -> logger.verbose "creating subscriber proto = #{fields.proto}, token = #{fields.token}"
throw new Error("Invalid value for `proto'") unless service = pushServices.getService(fields.proto) throw new Error("Invalid value for `token'") unless fields.token = service.validateToken(fields.token) Subscriber::create(redis, fields, cb)
CoffeeScript
CoffeeScript
rs/pushd
pushd.coffee
MIT
9dc56de9da2a64903cad510d22d4d0e078a8ba0a
1,157
https://github.com/rs/pushd/blob/9dc56de9da2a64903cad510d22d4d0e078a8ba0a/pushd.coffee
36
40
rs/pushd:pushd.coffee:2:raw_corpus
raw_corpus
tokenResolver = (proto, token, cb) -> Subscriber::getInstanceFromToken redis, proto, token, cb eventSourceEnabled = no pushServices = new PushServices() for name, conf of settings when conf.enabled logger.info "Registering push service: #{name}" if name is 'event-source' # special case for EventSou...
CoffeeScript
rs/pushd
pushd.coffee
MIT
9dc56de9da2a64903cad510d22d4d0e078a8ba0a
1,157
https://github.com/rs/pushd/blob/9dc56de9da2a64903cad510d22d4d0e078a8ba0a/pushd.coffee
42
54
rs/pushd:pushd.coffee:2:coffee_to_js
coffee_to_js
Convert this CoffeeScript to JavaScript. ```coffeescript tokenResolver = (proto, token, cb) -> Subscriber::getInstanceFromToken redis, proto, token, cb eventSourceEnabled = no pushServices = new PushServices() for name, conf of settings when conf.enabled logger.info "Registering push service: #{name}" if n...
var conf, eventPublisher, eventSourceEnabled, name, pushServices, tokenResolver; tokenResolver = function(proto, token, cb) { return Subscriber.prototype.getInstanceFromToken(redis, proto, token, cb); }; eventSourceEnabled = false; pushServices = new PushServices(); for (name in settings) { conf = settings[name...
CoffeeScript
JavaScript
rs/pushd
pushd.coffee
MIT
9dc56de9da2a64903cad510d22d4d0e078a8ba0a
1,157
https://github.com/rs/pushd/blob/9dc56de9da2a64903cad510d22d4d0e078a8ba0a/pushd.coffee
42
54
rs/pushd:pushd.coffee:2:js_to_coffee
js_to_coffee
Convert this JavaScript to CoffeeScript. ```javascript var conf, eventPublisher, eventSourceEnabled, name, pushServices, tokenResolver; tokenResolver = function(proto, token, cb) { return Subscriber.prototype.getInstanceFromToken(redis, proto, token, cb); }; eventSourceEnabled = false; pushServices = new PushServi...
tokenResolver = (proto, token, cb) -> Subscriber::getInstanceFromToken redis, proto, token, cb eventSourceEnabled = no pushServices = new PushServices() for name, conf of settings when conf.enabled logger.info "Registering push service: #{name}" if name is 'event-source' # special case for EventSou...
JavaScript
CoffeeScript
rs/pushd
pushd.coffee
MIT
9dc56de9da2a64903cad510d22d4d0e078a8ba0a
1,157
https://github.com/rs/pushd/blob/9dc56de9da2a64903cad510d22d4d0e078a8ba0a/pushd.coffee
42
54
rs/pushd:pushd.coffee:2:completion
completion
tokenResolver = (proto, token, cb) -> Subscriber::getInstanceFromToken redis, proto, token, cb eventSourceEnabled = no pushServices = new PushServices() for name, conf of settings when conf.enabled
logger.info "Registering push service: #{name}" if name is 'event-source' # special case for EventSource which isn't a pluggable push protocol eventSourceEnabled = yes else pushServices.addService(name, new conf.class(conf, logger, tokenResolver)) eventPublisher = new EventPublisher(push...
CoffeeScript
CoffeeScript
rs/pushd
pushd.coffee
MIT
9dc56de9da2a64903cad510d22d4d0e078a8ba0a
1,157
https://github.com/rs/pushd/blob/9dc56de9da2a64903cad510d22d4d0e078a8ba0a/pushd.coffee
42
54
rs/pushd:pushd.coffee:3:raw_corpus
raw_corpus
checkUserAndPassword = (username, password) => if settings.server?.auth? if not settings.server.auth[username]? logger.error "Unknown user #{username}" return false passwordOK = password? and password is settings.server.auth[username].password if not passwordOK ...
CoffeeScript
rs/pushd
pushd.coffee
MIT
9dc56de9da2a64903cad510d22d4d0e078a8ba0a
1,157
https://github.com/rs/pushd/blob/9dc56de9da2a64903cad510d22d4d0e078a8ba0a/pushd.coffee
56
83
rs/pushd:pushd.coffee:3:coffee_to_js
coffee_to_js
Convert this CoffeeScript to JavaScript. ```coffeescript checkUserAndPassword = (username, password) => if settings.server?.auth? if not settings.server.auth[username]? logger.error "Unknown user #{username}" return false passwordOK = password? and password is settings.server...
var app, checkUserAndPassword, ref, ref1, ref2; checkUserAndPassword = (username, password) => { var passwordOK, ref; if (((ref = settings.server) != null ? ref.auth : void 0) != null) { if (settings.server.auth[username] == null) { logger.error(`Unknown user ${username}`); return false; } ...
CoffeeScript
JavaScript
rs/pushd
pushd.coffee
MIT
9dc56de9da2a64903cad510d22d4d0e078a8ba0a
1,157
https://github.com/rs/pushd/blob/9dc56de9da2a64903cad510d22d4d0e078a8ba0a/pushd.coffee
56
83
rs/pushd:pushd.coffee:3:js_to_coffee
js_to_coffee
Convert this JavaScript to CoffeeScript. ```javascript var app, checkUserAndPassword, ref, ref1, ref2; checkUserAndPassword = (username, password) => { var passwordOK, ref; if (((ref = settings.server) != null ? ref.auth : void 0) != null) { if (settings.server.auth[username] == null) { logger.error(`Unk...
checkUserAndPassword = (username, password) => if settings.server?.auth? if not settings.server.auth[username]? logger.error "Unknown user #{username}" return false passwordOK = password? and password is settings.server.auth[username].password if not passwordOK ...
JavaScript
CoffeeScript
rs/pushd
pushd.coffee
MIT
9dc56de9da2a64903cad510d22d4d0e078a8ba0a
1,157
https://github.com/rs/pushd/blob/9dc56de9da2a64903cad510d22d4d0e078a8ba0a/pushd.coffee
56
83
rs/pushd:pushd.coffee:3:completion
completion
checkUserAndPassword = (username, password) => if settings.server?.auth? if not settings.server.auth[username]? logger.error "Unknown user #{username}" return false passwordOK = password? and password is settings.server.auth[username].password if not passwordOK ...
if settings.server?.auth? and not settings.server?.acl? app.use(express.basicAuth checkUserAndPassword) app.use(bodyParser.urlencoded({ limit: '1mb', extended: true })) app.use(bodyParser.json({ limit: '1mb' })) app.use(app.router) app.disable('x-powered-by'); app.param 'subscriber_id', (req, res, next, id) -> ...
CoffeeScript
CoffeeScript
rs/pushd
pushd.coffee
MIT
9dc56de9da2a64903cad510d22d4d0e078a8ba0a
1,157
https://github.com/rs/pushd/blob/9dc56de9da2a64903cad510d22d4d0e078a8ba0a/pushd.coffee
56
83
rs/pushd:pushd.coffee:6:raw_corpus
raw_corpus
checkStatus = () -> return redis.connected app.param 'event_id', (req, res, next, id) -> try req.event = getEventFromId(req.params.event_id) delete req.params.event_id next() catch error res.json error: error.message, 400
CoffeeScript
rs/pushd
pushd.coffee
MIT
9dc56de9da2a64903cad510d22d4d0e078a8ba0a
1,157
https://github.com/rs/pushd/blob/9dc56de9da2a64903cad510d22d4d0e078a8ba0a/pushd.coffee
91
100
rs/pushd:pushd.coffee:6:coffee_to_js
coffee_to_js
Convert this CoffeeScript to JavaScript. ```coffeescript checkStatus = () -> return redis.connected app.param 'event_id', (req, res, next, id) -> try req.event = getEventFromId(req.params.event_id) delete req.params.event_id next() catch error res.json error: error.message, ...
var checkStatus; checkStatus = function() { return redis.connected; }; app.param('event_id', function(req, res, next, id) { var error; try { req.event = getEventFromId(req.params.event_id); delete req.params.event_id; return next(); } catch (error1) { error = error1; return res.json({ ...
CoffeeScript
JavaScript
rs/pushd
pushd.coffee
MIT
9dc56de9da2a64903cad510d22d4d0e078a8ba0a
1,157
https://github.com/rs/pushd/blob/9dc56de9da2a64903cad510d22d4d0e078a8ba0a/pushd.coffee
91
100
rs/pushd:pushd.coffee:6:js_to_coffee
js_to_coffee
Convert this JavaScript to CoffeeScript. ```javascript var checkStatus; checkStatus = function() { return redis.connected; }; app.param('event_id', function(req, res, next, id) { var error; try { req.event = getEventFromId(req.params.event_id); delete req.params.event_id; return next(); } catch (e...
checkStatus = () -> return redis.connected app.param 'event_id', (req, res, next, id) -> try req.event = getEventFromId(req.params.event_id) delete req.params.event_id next() catch error res.json error: error.message, 400
JavaScript
CoffeeScript
rs/pushd
pushd.coffee
MIT
9dc56de9da2a64903cad510d22d4d0e078a8ba0a
1,157
https://github.com/rs/pushd/blob/9dc56de9da2a64903cad510d22d4d0e078a8ba0a/pushd.coffee
91
100
rs/pushd:pushd.coffee:6:completion
completion
checkStatus = () -> return redis.connected app.param 'event_id', (req, res, next, id) -> try
req.event = getEventFromId(req.params.event_id) delete req.params.event_id next() catch error res.json error: error.message, 400
CoffeeScript
CoffeeScript
rs/pushd
pushd.coffee
MIT
9dc56de9da2a64903cad510d22d4d0e078a8ba0a
1,157
https://github.com/rs/pushd/blob/9dc56de9da2a64903cad510d22d4d0e078a8ba0a/pushd.coffee
91
100
rs/pushd:pushd.coffee:7:raw_corpus
raw_corpus
authorize = (realm) -> if settings.server?.auth? return (req, res, next) -> # req.user has been set by express.basicAuth logger.verbose "Authenticating #{req.user} for #{realm}" if not req.user? logger.error "User not authenticated" res.jso...
CoffeeScript
rs/pushd
pushd.coffee
MIT
9dc56de9da2a64903cad510d22d4d0e078a8ba0a
1,157
https://github.com/rs/pushd/blob/9dc56de9da2a64903cad510d22d4d0e078a8ba0a/pushd.coffee
102
151
rs/pushd:pushd.coffee:7:coffee_to_js
coffee_to_js
Convert this CoffeeScript to JavaScript. ```coffeescript authorize = (realm) -> if settings.server?.auth? return (req, res, next) -> # req.user has been set by express.basicAuth logger.verbose "Authenticating #{req.user} for #{realm}" if not req.user? logg...
var authorize, event_route, listen_ip, port, ref, ref1, ref2, udpApi, indexOf = [].indexOf; authorize = function(realm) { var allow_from, i, len, network, networks, ref, ref1, ref2; if (((ref = settings.server) != null ? ref.auth : void 0) != null) { return function(req, res, next) { var allowedRealms,...
CoffeeScript
JavaScript
rs/pushd
pushd.coffee
MIT
9dc56de9da2a64903cad510d22d4d0e078a8ba0a
1,157
https://github.com/rs/pushd/blob/9dc56de9da2a64903cad510d22d4d0e078a8ba0a/pushd.coffee
102
151
rs/pushd:pushd.coffee:7:js_to_coffee
js_to_coffee
Convert this JavaScript to CoffeeScript. ```javascript var authorize, event_route, listen_ip, port, ref, ref1, ref2, udpApi, indexOf = [].indexOf; authorize = function(realm) { var allow_from, i, len, network, networks, ref, ref1, ref2; if (((ref = settings.server) != null ? ref.auth : void 0) != null) { ret...
authorize = (realm) -> if settings.server?.auth? return (req, res, next) -> # req.user has been set by express.basicAuth logger.verbose "Authenticating #{req.user} for #{realm}" if not req.user? logger.error "User not authenticated" res.jso...
JavaScript
CoffeeScript
rs/pushd
pushd.coffee
MIT
9dc56de9da2a64903cad510d22d4d0e078a8ba0a
1,157
https://github.com/rs/pushd/blob/9dc56de9da2a64903cad510d22d4d0e078a8ba0a/pushd.coffee
102
151
rs/pushd:pushd.coffee:7:completion
completion
authorize = (realm) -> if settings.server?.auth? return (req, res, next) -> # req.user has been set by express.basicAuth logger.verbose "Authenticating #{req.user} for #{realm}" if not req.user? logger.error "User not authenticated" res.jso...
next() return res.json error: 'Unauthorized', 403 else return (req, res, next) -> next() require('./lib/api').setupRestApi(app, createSubscriber, getEventFromId, authorize, testSubscriber, eventPublisher, checkStatus) if eventSourceEnabled require('./lib/eventsource'...
CoffeeScript
CoffeeScript
rs/pushd
pushd.coffee
MIT
9dc56de9da2a64903cad510d22d4d0e078a8ba0a
1,157
https://github.com/rs/pushd/blob/9dc56de9da2a64903cad510d22d4d0e078a8ba0a/pushd.coffee
102
151
rs/pushd:pushd.coffee:8:raw_corpus
raw_corpus
zlib.unzip msg, (err, msg) => if err or not msg.toString() logger.error("UDP Cannot decode message: #{err}") return [method, msg] = msg.toString().split(/\s+/, 2) if not msg then [msg, method] = [method, 'POST'] req = url.parse(msg ? '', true) method = met...
CoffeeScript
rs/pushd
pushd.coffee
MIT
9dc56de9da2a64903cad510d22d4d0e078a8ba0a
1,157
https://github.com/rs/pushd/blob/9dc56de9da2a64903cad510d22d4d0e078a8ba0a/pushd.coffee
152
179
rs/pushd:pushd.coffee:8:coffee_to_js
coffee_to_js
Convert this CoffeeScript to JavaScript. ```coffeescript zlib.unzip msg, (err, msg) => if err or not msg.toString() logger.error("UDP Cannot decode message: #{err}") return [method, msg] = msg.toString().split(/\s+/, 2) if not msg then [msg, method] = [method, 'POST'] ...
var port, ref; zlib.unzip(msg, (err, msg) => { var method, req; if (err || !msg.toString()) { logger.error(`UDP Cannot decode message: ${err}`); return; } [method, msg] = msg.toString().split(/\s+/, 2); if (!msg) { [msg, method] = [method, 'POST']; } req = url.parse(msg != null ? msg : '', tr...
CoffeeScript
JavaScript
rs/pushd
pushd.coffee
MIT
9dc56de9da2a64903cad510d22d4d0e078a8ba0a
1,157
https://github.com/rs/pushd/blob/9dc56de9da2a64903cad510d22d4d0e078a8ba0a/pushd.coffee
152
179
rs/pushd:pushd.coffee:8:js_to_coffee
js_to_coffee
Convert this JavaScript to CoffeeScript. ```javascript var port, ref; zlib.unzip(msg, (err, msg) => { var method, req; if (err || !msg.toString()) { logger.error(`UDP Cannot decode message: ${err}`); return; } [method, msg] = msg.toString().split(/\s+/, 2); if (!msg) { [msg, method] = [method, 'P...
zlib.unzip msg, (err, msg) => if err or not msg.toString() logger.error("UDP Cannot decode message: #{err}") return [method, msg] = msg.toString().split(/\s+/, 2) if not msg then [msg, method] = [method, 'POST'] req = url.parse(msg ? '', true) method = met...
JavaScript
CoffeeScript
rs/pushd
pushd.coffee
MIT
9dc56de9da2a64903cad510d22d4d0e078a8ba0a
1,157
https://github.com/rs/pushd/blob/9dc56de9da2a64903cad510d22d4d0e078a8ba0a/pushd.coffee
152
179