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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Pagedraw/pagedraw:sketch-tests/uploads-succeed-test.coffee:1:raw_corpus | raw_corpus | #!/usr/bin/env coffee
require('../coffeescript-register-web')
_l = require 'lodash'
fs = require 'fs'
path = require 'path'
{h32} = require 'xxhashjs'
mkdirp = require 'mkdirp'
EventEmitter = require('events').EventEmitter
{stub} = require '../src/test-stubber'
{importFromSketch} = require '../sketch-importer/impor... | CoffeeScript | Pagedraw/pagedraw | sketch-tests/uploads-succeed-test.coffee | MIT | aba1bd1b8ef6bb7f58866a9d11ebb7f1e0e18a8e | 3,558 | https://github.com/Pagedraw/pagedraw/blob/aba1bd1b8ef6bb7f58866a9d11ebb7f1e0e18a8e/sketch-tests/uploads-succeed-test.coffee | 1 | 50 | ||
Pagedraw/pagedraw:sketch-tests/uploads-succeed-test.coffee:1:completion | completion | #!/usr/bin/env coffee
require('../coffeescript-register-web')
_l = require 'lodash'
fs = require 'fs'
path = require 'path'
{h32} = require 'xxhashjs'
mkdirp = require 'mkdirp'
EventEmitter = require('events').EventEmitter
{stub} = require '../src/test-stubber'
{importFromSketch} = require '../sketch-importer/impor... | reject('Imported sketch file not found in test setup')
stub "sketch-import-image-export", (export_dir, chunk) ->
new Promise (resolve, reject) ->
fs.stat export_dir, (err, stats) =>
if err?.code == "ENOENT"
mkdirp export_dir, (err2) ->
return reject(err2) if... | CoffeeScript | CoffeeScript | Pagedraw/pagedraw | sketch-tests/uploads-succeed-test.coffee | MIT | aba1bd1b8ef6bb7f58866a9d11ebb7f1e0e18a8e | 3,558 | https://github.com/Pagedraw/pagedraw/blob/aba1bd1b8ef6bb7f58866a9d11ebb7f1e0e18a8e/sketch-tests/uploads-succeed-test.coffee | 1 | 50 |
Pagedraw/pagedraw:sketch-tests/uploads-succeed-test.coffee:2:raw_corpus | raw_corpus | return new Promise((resolve, reject) =>
fs.stat temp_dir, (err, stat) ->
if err?.code == "ENOENT"
mkdirp temp_dir, (err) ->
return reject(err) if err
resolve()
else if err
reject("Could not make temp_dir: #{err}") if... | CoffeeScript | Pagedraw/pagedraw | sketch-tests/uploads-succeed-test.coffee | MIT | aba1bd1b8ef6bb7f58866a9d11ebb7f1e0e18a8e | 3,558 | https://github.com/Pagedraw/pagedraw/blob/aba1bd1b8ef6bb7f58866a9d11ebb7f1e0e18a8e/sketch-tests/uploads-succeed-test.coffee | 51 | 79 | ||
Pagedraw/pagedraw:sketch-tests/uploads-succeed-test.coffee:2:completion | completion | return new Promise((resolve, reject) =>
fs.stat temp_dir, (err, stat) ->
if err?.code == "ENOENT"
mkdirp temp_dir, (err) ->
return reject(err) if err
resolve()
else if err
reject("Could not make temp_dir: #{err}") if... | .then (docjson) ->
throw new Error "Blocks are not an object" if not _l.isObject docjson.blocks
throw new Error "Replace-me font name has leaked" if _l.some docjson.fonts, (font) => font.name == 'replace-me'
.catch (e) ->
throw new Error("Error on #{file}: #{e}")
).then(=>
process.exit... | CoffeeScript | CoffeeScript | Pagedraw/pagedraw | sketch-tests/uploads-succeed-test.coffee | MIT | aba1bd1b8ef6bb7f58866a9d11ebb7f1e0e18a8e | 3,558 | https://github.com/Pagedraw/pagedraw/blob/aba1bd1b8ef6bb7f58866a9d11ebb7f1e0e18a8e/sketch-tests/uploads-succeed-test.coffee | 51 | 79 |
jianliaoim/talk-os:talk-web/client/app/file-queue-favorite.coffee:1:raw_corpus | raw_corpus | React = require 'react'
assign = require 'object-assign'
Immutable = require 'immutable'
PureRenderMixin = require 'react-addons-pure-render-mixin'
div = React.createFactory 'div'
favoriteActions = require '../actions/favorite'
mixinFileQueue = require '../mixin/file-queue'
mixinSubscribe = require '../mixin/subscri... | CoffeeScript | jianliaoim/talk-os | talk-web/client/app/file-queue-favorite.coffee | MIT | 2545c4497865779a55762e03963a39237df9046b | 2,703 | https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-web/client/app/file-queue-favorite.coffee | 1 | 46 | ||
jianliaoim/talk-os:talk-web/client/app/file-queue-favorite.coffee:1:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
React = require 'react'
assign = require 'object-assign'
Immutable = require 'immutable'
PureRenderMixin = require 'react-addons-pure-render-mixin'
div = React.createFactory 'div'
favoriteActions = require '../actions/favorite'
mixinFileQueue = require '../mix... | var Immutable, PureRenderMixin, React, T, assign, div, favoriteActions, mixinFileQueue, mixinSubscribe;
React = require('react');
assign = require('object-assign');
Immutable = require('immutable');
PureRenderMixin = require('react-addons-pure-render-mixin');
div = React.createFactory('div');
favoriteActions = re... | CoffeeScript | JavaScript | jianliaoim/talk-os | talk-web/client/app/file-queue-favorite.coffee | MIT | 2545c4497865779a55762e03963a39237df9046b | 2,703 | https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-web/client/app/file-queue-favorite.coffee | 1 | 46 |
jianliaoim/talk-os:talk-web/client/app/file-queue-favorite.coffee:1:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
var Immutable, PureRenderMixin, React, T, assign, div, favoriteActions, mixinFileQueue, mixinSubscribe;
React = require('react');
assign = require('object-assign');
Immutable = require('immutable');
PureRenderMixin = require('react-addons-pure-render-mixin');
... | React = require 'react'
assign = require 'object-assign'
Immutable = require 'immutable'
PureRenderMixin = require 'react-addons-pure-render-mixin'
div = React.createFactory 'div'
favoriteActions = require '../actions/favorite'
mixinFileQueue = require '../mixin/file-queue'
mixinSubscribe = require '../mixin/subscri... | JavaScript | CoffeeScript | jianliaoim/talk-os | talk-web/client/app/file-queue-favorite.coffee | MIT | 2545c4497865779a55762e03963a39237df9046b | 2,703 | https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-web/client/app/file-queue-favorite.coffee | 1 | 46 |
jianliaoim/talk-os:talk-web/client/app/file-queue-favorite.coffee:1:completion | completion | React = require 'react'
assign = require 'object-assign'
Immutable = require 'immutable'
PureRenderMixin = require 'react-addons-pure-render-mixin'
div = React.createFactory 'div'
favoriteActions = require '../actions/favorite'
mixinFileQueue = require '../mixin/file-queue'
mixinSubscribe = require '../mixin/subscri... | # used in component
_teamId: T.string.isRequired
_roomId: T.string
_toId: T.string
query: T.object
getInitialState: ->
page: @props.query.page - 1
requestBefore: (success) ->
success Immutable.List()
requestAfter: (success) ->
data = assign {}, @props.query,
page: @state.page ... | CoffeeScript | CoffeeScript | jianliaoim/talk-os | talk-web/client/app/file-queue-favorite.coffee | MIT | 2545c4497865779a55762e03963a39237df9046b | 2,703 | https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-web/client/app/file-queue-favorite.coffee | 1 | 46 |
jianliaoim/talk-os:talk-web/test/spec/module/permission-member.spec.coffee:1:raw_corpus | raw_corpus | describe 'module: permission member', ->
beforeEach ->
@permission = require 'module/permission-member'
describe 'function: hasPermission', ->
describe 'member', ->
it 'can not control member', ->
expect(@permission.hasPermission('member', 'member')).toBe false
it 'can not control adm... | CoffeeScript | jianliaoim/talk-os | talk-web/test/spec/module/permission-member.spec.coffee | MIT | 2545c4497865779a55762e03963a39237df9046b | 2,703 | https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-web/test/spec/module/permission-member.spec.coffee | 1 | 35 | ||
jianliaoim/talk-os:talk-web/test/spec/module/permission-member.spec.coffee:1:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
describe 'module: permission member', ->
beforeEach ->
@permission = require 'module/permission-member'
describe 'function: hasPermission', ->
describe 'member', ->
it 'can not control member', ->
expect(@permission.hasPermission('memb... | describe('module: permission member', function() {
beforeEach(function() {
return this.permission = require('module/permission-member');
});
return describe('function: hasPermission', function() {
describe('member', function() {
it('can not control member', function() {
return expect(this.pe... | CoffeeScript | JavaScript | jianliaoim/talk-os | talk-web/test/spec/module/permission-member.spec.coffee | MIT | 2545c4497865779a55762e03963a39237df9046b | 2,703 | https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-web/test/spec/module/permission-member.spec.coffee | 1 | 35 |
jianliaoim/talk-os:talk-web/test/spec/module/permission-member.spec.coffee:1:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
describe('module: permission member', function() {
beforeEach(function() {
return this.permission = require('module/permission-member');
});
return describe('function: hasPermission', function() {
describe('member', function() {
it('can not cont... | describe 'module: permission member', ->
beforeEach ->
@permission = require 'module/permission-member'
describe 'function: hasPermission', ->
describe 'member', ->
it 'can not control member', ->
expect(@permission.hasPermission('member', 'member')).toBe false
it 'can not control adm... | JavaScript | CoffeeScript | jianliaoim/talk-os | talk-web/test/spec/module/permission-member.spec.coffee | MIT | 2545c4497865779a55762e03963a39237df9046b | 2,703 | https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-web/test/spec/module/permission-member.spec.coffee | 1 | 35 |
jianliaoim/talk-os:talk-web/test/spec/module/permission-member.spec.coffee:1:completion | completion | describe 'module: permission member', ->
beforeEach ->
@permission = require 'module/permission-member'
describe 'function: hasPermission', ->
describe 'member', ->
it 'can not control member', ->
expect(@permission.hasPermission('member', 'member')).toBe false
it 'can not control adm... | it 'can control member', ->
expect(@permission.hasPermission('admin', 'member')).toBe true
it 'can not control admin', ->
expect(@permission.hasPermission('admin', 'admin')).toBe false
it 'can not control owner', ->
expect(@permission.hasPermission('admin', 'owner')).toBe false
... | CoffeeScript | CoffeeScript | jianliaoim/talk-os | talk-web/test/spec/module/permission-member.spec.coffee | MIT | 2545c4497865779a55762e03963a39237df9046b | 2,703 | https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-web/test/spec/module/permission-member.spec.coffee | 1 | 35 |
oozcitak/xmlbuilder-js:test/issues/176.coffee:1:raw_corpus | raw_corpus | suite 'Tests specific to issues:', ->
test 'Issue #176 (valueOf fails for Object.Create(null)', ->
obj = Object.create(null)
obj.root = 'node'
eq(
xml(obj).end()
'<?xml version="1.0"?>' +
'<root>node</root>'
) | CoffeeScript | oozcitak/xmlbuilder-js | test/issues/176.coffee | MIT | ce625aeb9f52d1f75d5d94260794d3b5fd74a8b1 | 926 | https://github.com/oozcitak/xmlbuilder-js/blob/ce625aeb9f52d1f75d5d94260794d3b5fd74a8b1/test/issues/176.coffee | 1 | 10 | ||
oozcitak/xmlbuilder-js:test/issues/176.coffee:1:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
suite 'Tests specific to issues:', ->
test 'Issue #176 (valueOf fails for Object.Create(null)', ->
obj = Object.create(null)
obj.root = 'node'
eq(
xml(obj).end()
'<?xml version="1.0"?>' +
'<root>node</root>'
)
``` | suite('Tests specific to issues:', function() {
return test('Issue #176 (valueOf fails for Object.Create(null)', function() {
var obj;
obj = Object.create(null);
obj.root = 'node';
return eq(xml(obj).end(), '<?xml version="1.0"?>' + '<root>node</root>');
});
}); | CoffeeScript | JavaScript | oozcitak/xmlbuilder-js | test/issues/176.coffee | MIT | ce625aeb9f52d1f75d5d94260794d3b5fd74a8b1 | 926 | https://github.com/oozcitak/xmlbuilder-js/blob/ce625aeb9f52d1f75d5d94260794d3b5fd74a8b1/test/issues/176.coffee | 1 | 10 |
oozcitak/xmlbuilder-js:test/issues/176.coffee:1:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
suite('Tests specific to issues:', function() {
return test('Issue #176 (valueOf fails for Object.Create(null)', function() {
var obj;
obj = Object.create(null);
obj.root = 'node';
return eq(xml(obj).end(), '<?xml version="1.0"?>' + '<root>node</r... | suite 'Tests specific to issues:', ->
test 'Issue #176 (valueOf fails for Object.Create(null)', ->
obj = Object.create(null)
obj.root = 'node'
eq(
xml(obj).end()
'<?xml version="1.0"?>' +
'<root>node</root>'
) | JavaScript | CoffeeScript | oozcitak/xmlbuilder-js | test/issues/176.coffee | MIT | ce625aeb9f52d1f75d5d94260794d3b5fd74a8b1 | 926 | https://github.com/oozcitak/xmlbuilder-js/blob/ce625aeb9f52d1f75d5d94260794d3b5fd74a8b1/test/issues/176.coffee | 1 | 10 |
oozcitak/xmlbuilder-js:test/issues/176.coffee:1:completion | completion | suite 'Tests specific to issues:', ->
test 'Issue #176 (valueOf fails for Object.Create(null)', ->
obj = Object.create(null)
obj.root = 'node' | eq(
xml(obj).end()
'<?xml version="1.0"?>' +
'<root>node</root>'
) | CoffeeScript | CoffeeScript | oozcitak/xmlbuilder-js | test/issues/176.coffee | MIT | ce625aeb9f52d1f75d5d94260794d3b5fd74a8b1 | 926 | https://github.com/oozcitak/xmlbuilder-js/blob/ce625aeb9f52d1f75d5d94260794d3b5fd74a8b1/test/issues/176.coffee | 1 | 10 |
buttercoin/buttercoin:lib/ews/ws_listener.coffee:1:raw_corpus | raw_corpus | Q = require('q')
WebSocketServer = require('ws').Server
stump = require('stump')
Connection = require('./ws_connection')
module.exports = class WebsocketListener
constructor: (@options) ->
stump.stumpify(@, @constructor.name)
@options.protocol_factory = @options.protocol_factory or @do_not_know_how_to_make_... | CoffeeScript | buttercoin/buttercoin | lib/ews/ws_listener.coffee | MIT | a825a9ea31d695f8abb600f3f27ff635a839c0c2 | 663 | https://github.com/buttercoin/buttercoin/blob/a825a9ea31d695f8abb600f3f27ff635a839c0c2/lib/ews/ws_listener.coffee | 1 | 38 | ||
buttercoin/buttercoin:lib/ews/ws_listener.coffee:1:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
Q = require('q')
WebSocketServer = require('ws').Server
stump = require('stump')
Connection = require('./ws_connection')
module.exports = class WebsocketListener
constructor: (@options) ->
stump.stumpify(@, @constructor.name)
@options.protocol_factory... | var Connection, Q, WebSocketServer, WebsocketListener, listener, stump;
Q = require('q');
WebSocketServer = require('ws').Server;
stump = require('stump');
Connection = require('./ws_connection');
module.exports = WebsocketListener = class WebsocketListener {
constructor(options) {
this.listen = this.listen.... | CoffeeScript | JavaScript | buttercoin/buttercoin | lib/ews/ws_listener.coffee | MIT | a825a9ea31d695f8abb600f3f27ff635a839c0c2 | 663 | https://github.com/buttercoin/buttercoin/blob/a825a9ea31d695f8abb600f3f27ff635a839c0c2/lib/ews/ws_listener.coffee | 1 | 38 |
buttercoin/buttercoin:lib/ews/ws_listener.coffee:1:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
var Connection, Q, WebSocketServer, WebsocketListener, listener, stump;
Q = require('q');
WebSocketServer = require('ws').Server;
stump = require('stump');
Connection = require('./ws_connection');
module.exports = WebsocketListener = class WebsocketListener {
... | Q = require('q')
WebSocketServer = require('ws').Server
stump = require('stump')
Connection = require('./ws_connection')
module.exports = class WebsocketListener
constructor: (@options) ->
stump.stumpify(@, @constructor.name)
@options.protocol_factory = @options.protocol_factory or @do_not_know_how_to_make_... | JavaScript | CoffeeScript | buttercoin/buttercoin | lib/ews/ws_listener.coffee | MIT | a825a9ea31d695f8abb600f3f27ff635a839c0c2 | 663 | https://github.com/buttercoin/buttercoin/blob/a825a9ea31d695f8abb600f3f27ff635a839c0c2/lib/ews/ws_listener.coffee | 1 | 38 |
buttercoin/buttercoin:lib/ews/ws_listener.coffee:1:completion | completion | Q = require('q')
WebSocketServer = require('ws').Server
stump = require('stump')
Connection = require('./ws_connection')
module.exports = class WebsocketListener
constructor: (@options) ->
stump.stumpify(@, @constructor.name)
@options.protocol_factory = @options.protocol_factory or @do_not_know_how_to_make_... | @wss.close()
return Q.when(true)
connection_made: (ws) =>
conn = new Connection(@)
conn.once 'open', (connection) =>
@options.protocol_factory(connection)
conn.socket_accepted(ws)
connect_error: (err) =>
@error('connect error', err)
do_not_know_how_to_make_protocol: (connection) =>
... | CoffeeScript | CoffeeScript | buttercoin/buttercoin | lib/ews/ws_listener.coffee | MIT | a825a9ea31d695f8abb600f3f27ff635a839c0c2 | 663 | https://github.com/buttercoin/buttercoin/blob/a825a9ea31d695f8abb600f3f27ff635a839c0c2/lib/ews/ws_listener.coffee | 1 | 38 |
buttercoin/buttercoin:lib/ews/ws_listener.coffee:1:raw_corpus | raw_corpus | Q = require('q')
WebSocketServer = require('ws').Server
stump = require('stump')
Connection = require('./ws_connection')
module.exports = class WebsocketListener
constructor: (@options) ->
stump.stumpify(@, @constructor.name)
@options.protocol_factory = @options.protocol_factory or @do_not_know_how_to_make_... | CoffeeScript | buttercoin/buttercoin | lib/ews/ws_listener.coffee | MIT | a029c1a623369cb4df0af6e982a2420b6c0d1a62 | 663 | https://github.com/buttercoin/buttercoin/blob/a029c1a623369cb4df0af6e982a2420b6c0d1a62/lib/ews/ws_listener.coffee | 1 | 38 | ||
buttercoin/buttercoin:lib/ews/ws_listener.coffee:1:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
Q = require('q')
WebSocketServer = require('ws').Server
stump = require('stump')
Connection = require('./ws_connection')
module.exports = class WebsocketListener
constructor: (@options) ->
stump.stumpify(@, @constructor.name)
@options.protocol_factory... | var Connection, Q, WebSocketServer, WebsocketListener, listener, stump;
Q = require('q');
WebSocketServer = require('ws').Server;
stump = require('stump');
Connection = require('./ws_connection');
module.exports = WebsocketListener = class WebsocketListener {
constructor(options) {
this.listen = this.listen.... | CoffeeScript | JavaScript | buttercoin/buttercoin | lib/ews/ws_listener.coffee | MIT | a029c1a623369cb4df0af6e982a2420b6c0d1a62 | 663 | https://github.com/buttercoin/buttercoin/blob/a029c1a623369cb4df0af6e982a2420b6c0d1a62/lib/ews/ws_listener.coffee | 1 | 38 |
buttercoin/buttercoin:lib/ews/ws_listener.coffee:1:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
var Connection, Q, WebSocketServer, WebsocketListener, listener, stump;
Q = require('q');
WebSocketServer = require('ws').Server;
stump = require('stump');
Connection = require('./ws_connection');
module.exports = WebsocketListener = class WebsocketListener {
... | Q = require('q')
WebSocketServer = require('ws').Server
stump = require('stump')
Connection = require('./ws_connection')
module.exports = class WebsocketListener
constructor: (@options) ->
stump.stumpify(@, @constructor.name)
@options.protocol_factory = @options.protocol_factory or @do_not_know_how_to_make_... | JavaScript | CoffeeScript | buttercoin/buttercoin | lib/ews/ws_listener.coffee | MIT | a029c1a623369cb4df0af6e982a2420b6c0d1a62 | 663 | https://github.com/buttercoin/buttercoin/blob/a029c1a623369cb4df0af6e982a2420b6c0d1a62/lib/ews/ws_listener.coffee | 1 | 38 |
buttercoin/buttercoin:lib/ews/ws_listener.coffee:1:completion | completion | Q = require('q')
WebSocketServer = require('ws').Server
stump = require('stump')
Connection = require('./ws_connection')
module.exports = class WebsocketListener
constructor: (@options) ->
stump.stumpify(@, @constructor.name)
@options.protocol_factory = @options.protocol_factory or @do_not_know_how_to_make_... | Q.fcall =>
@wss.close()
connection_made: (ws) =>
conn = new Connection(@)
conn.once 'open', (connection) =>
@options.protocol_factory(connection)
conn.socket_accepted(ws)
connect_error: (err) =>
@error('connect error', err)
do_not_know_how_to_make_protocol: (connection) =>
@erro... | CoffeeScript | CoffeeScript | buttercoin/buttercoin | lib/ews/ws_listener.coffee | MIT | a029c1a623369cb4df0af6e982a2420b6c0d1a62 | 663 | https://github.com/buttercoin/buttercoin/blob/a029c1a623369cb4df0af6e982a2420b6c0d1a62/lib/ews/ws_listener.coffee | 1 | 38 |
lmaccherone/node-localstorage:test/ErrorTest.coffee:1:raw_corpus | raw_corpus | {LocalStorage} = require('../')
fs = require('fs')
exports.LocalStorageTest =
testFileExists: (test) ->
fs.writeFileSync('./scratchFile', 'hello', 'utf8')
f = () ->
ls2 = new LocalStorage('./scratchFile')
test.throws(f, Error)
fs.unlinkSync('./scratchFile')
test.done() | CoffeeScript | lmaccherone/node-localstorage | test/ErrorTest.coffee | MIT | 19496596646f366c2d200a60905d2e4fc87d50d3 | 460 | https://github.com/lmaccherone/node-localstorage/blob/19496596646f366c2d200a60905d2e4fc87d50d3/test/ErrorTest.coffee | 1 | 12 | ||
lmaccherone/node-localstorage:test/ErrorTest.coffee:1:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
{LocalStorage} = require('../')
fs = require('fs')
exports.LocalStorageTest =
testFileExists: (test) ->
fs.writeFileSync('./scratchFile', 'hello', 'utf8')
f = () ->
ls2 = new LocalStorage('./scratchFile')
test.throws(f, Error)
fs.unlinkS... | var LocalStorage, fs;
({LocalStorage} = require('../'));
fs = require('fs');
exports.LocalStorageTest = {
testFileExists: function(test) {
var f;
fs.writeFileSync('./scratchFile', 'hello', 'utf8');
f = function() {
var ls2;
return ls2 = new LocalStorage('./scratchFile');
};
test.thr... | CoffeeScript | JavaScript | lmaccherone/node-localstorage | test/ErrorTest.coffee | MIT | 19496596646f366c2d200a60905d2e4fc87d50d3 | 460 | https://github.com/lmaccherone/node-localstorage/blob/19496596646f366c2d200a60905d2e4fc87d50d3/test/ErrorTest.coffee | 1 | 12 |
lmaccherone/node-localstorage:test/ErrorTest.coffee:1:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
var LocalStorage, fs;
({LocalStorage} = require('../'));
fs = require('fs');
exports.LocalStorageTest = {
testFileExists: function(test) {
var f;
fs.writeFileSync('./scratchFile', 'hello', 'utf8');
f = function() {
var ls2;
return ls2 =... | {LocalStorage} = require('../')
fs = require('fs')
exports.LocalStorageTest =
testFileExists: (test) ->
fs.writeFileSync('./scratchFile', 'hello', 'utf8')
f = () ->
ls2 = new LocalStorage('./scratchFile')
test.throws(f, Error)
fs.unlinkSync('./scratchFile')
test.done() | JavaScript | CoffeeScript | lmaccherone/node-localstorage | test/ErrorTest.coffee | MIT | 19496596646f366c2d200a60905d2e4fc87d50d3 | 460 | https://github.com/lmaccherone/node-localstorage/blob/19496596646f366c2d200a60905d2e4fc87d50d3/test/ErrorTest.coffee | 1 | 12 |
lmaccherone/node-localstorage:test/ErrorTest.coffee:1:completion | completion | {LocalStorage} = require('../')
fs = require('fs')
exports.LocalStorageTest =
testFileExists: (test) -> | fs.writeFileSync('./scratchFile', 'hello', 'utf8')
f = () ->
ls2 = new LocalStorage('./scratchFile')
test.throws(f, Error)
fs.unlinkSync('./scratchFile')
test.done() | CoffeeScript | CoffeeScript | lmaccherone/node-localstorage | test/ErrorTest.coffee | MIT | 19496596646f366c2d200a60905d2e4fc87d50d3 | 460 | https://github.com/lmaccherone/node-localstorage/blob/19496596646f366c2d200a60905d2e4fc87d50d3/test/ErrorTest.coffee | 1 | 12 |
nicolaskruchten/pivottable:locales/pivot.sq.coffee:1:raw_corpus | raw_corpus | callWithJQuery = (pivotModule) ->
if typeof exports is "object" and typeof module is "object" # CommonJS
pivotModule require("jquery")
else if typeof define is "function" and define.amd # AMD
define ["jquery"], pivotModule
# Plain browser env
else
pivotModule jQuery
callWithJQue... | CoffeeScript | nicolaskruchten/pivottable | locales/pivot.sq.coffee | MIT | 838ec2fc38747749c28d2fd1cb6c4ace9e9cc520 | 4,440 | https://github.com/nicolaskruchten/pivottable/blob/838ec2fc38747749c28d2fd1cb6c4ace9e9cc520/locales/pivot.sq.coffee | 1 | 50 | ||
nicolaskruchten/pivottable:locales/pivot.sq.coffee:1:completion | completion | callWithJQuery = (pivotModule) ->
if typeof exports is "object" and typeof module is "object" # CommonJS
pivotModule require("jquery")
else if typeof define is "function" and define.amd # AMD
define ["jquery"], pivotModule
# Plain browser env
else
pivotModule jQuery
callWithJQue... | filterResults: "Filtro vlerat"
totals: "Totalet"
vs: "kundër"
by: "për"
aggregators:
"Numëro": tpl.count(frFmtInt)
"Numëro vlerat unike": tpl.countUnique(frFmtInt)
"Listo vlerat unike": tpl.listUnique(", ")
... | CoffeeScript | CoffeeScript | nicolaskruchten/pivottable | locales/pivot.sq.coffee | MIT | 838ec2fc38747749c28d2fd1cb6c4ace9e9cc520 | 4,440 | https://github.com/nicolaskruchten/pivottable/blob/838ec2fc38747749c28d2fd1cb6c4ace9e9cc520/locales/pivot.sq.coffee | 1 | 50 |
jeremyramin/terminal-plus:lib/tab-view.coffee:2:raw_corpus | raw_corpus | class TabView extends TerminalView
opened: false
lastActiveItem: null
windowHeight: $(window).height()
@getFocusedTerminal: ->
return TerminalView.getFocusedTerminal()
initialize: (options) ->
super(options)
@emitter = new Emitter
@fullscreenBtn = @addButton 'right', @toggleFullscreen, 'scr... | CoffeeScript | jeremyramin/terminal-plus | lib/tab-view.coffee | MIT | 1e555ee3a49902b203134072ff079ae580fdff10 | 478 | https://github.com/jeremyramin/terminal-plus/blob/1e555ee3a49902b203134072ff079ae580fdff10/lib/tab-view.coffee | 7 | 56 | ||
jeremyramin/terminal-plus:lib/tab-view.coffee:2:completion | completion | class TabView extends TerminalView
opened: false
lastActiveItem: null
windowHeight: $(window).height()
@getFocusedTerminal: ->
return TerminalView.getFocusedTerminal()
initialize: (options) ->
super(options)
@emitter = new Emitter
@fullscreenBtn = @addButton 'right', @toggleFullscreen, 'scr... | @emitter.dispose()
super(keepTerminal)
###
Section: Setup
###
attach: (pane, index) ->
pane ?= atom.workspace.getActivePane()
index ?= pane.getItems().length
pane.addItem this, index
detach: ->
atom.workspace.paneForItem(this)?.removeItem(this, true)
###
Section: External Method... | CoffeeScript | CoffeeScript | jeremyramin/terminal-plus | lib/tab-view.coffee | MIT | 1e555ee3a49902b203134072ff079ae580fdff10 | 478 | https://github.com/jeremyramin/terminal-plus/blob/1e555ee3a49902b203134072ff079ae580fdff10/lib/tab-view.coffee | 7 | 56 |
jeremyramin/terminal-plus:lib/tab-view.coffee:3:raw_corpus | raw_corpus | pane.activateItem this
@focus()
hide: ({refocus}={}) =>
refocus ?= true
@blur()
super(refocus)
getIconName: ->
"terminal"
getTitle: ->
@terminal.getName() or "Terminal-Plus"
getPath: ->
return @terminal.getTitle()
onDidChangeTitle: (callback) ->
@emitter.on 'did-change-ti... | CoffeeScript | jeremyramin/terminal-plus | lib/tab-view.coffee | MIT | 1e555ee3a49902b203134072ff079ae580fdff10 | 478 | https://github.com/jeremyramin/terminal-plus/blob/1e555ee3a49902b203134072ff079ae580fdff10/lib/tab-view.coffee | 57 | 91 | ||
jeremyramin/terminal-plus:lib/tab-view.coffee:3:completion | completion | pane.activateItem this
@focus()
hide: ({refocus}={}) =>
refocus ?= true
@blur()
super(refocus)
getIconName: ->
"terminal"
getTitle: ->
@terminal.getName() or "Terminal-Plus"
getPath: ->
return @terminal.getTitle() | onDidChangeTitle: (callback) ->
@emitter.on 'did-change-title', callback
updateName: (name) ->
@emitter.emit 'did-change-title', name
toggleFullscreen: =>
@destroy keepTerminal: true
@terminal.enableAnimation()
panel = new (require './panel-view') {@terminal}
panel.toggle() if @isVisible()... | CoffeeScript | CoffeeScript | jeremyramin/terminal-plus | lib/tab-view.coffee | MIT | 1e555ee3a49902b203134072ff079ae580fdff10 | 478 | https://github.com/jeremyramin/terminal-plus/blob/1e555ee3a49902b203134072ff079ae580fdff10/lib/tab-view.coffee | 57 | 91 |
jeremyramin/terminal-plus:lib/tab-view.coffee:2:raw_corpus | raw_corpus | class TabView extends TerminalView
opened: false
lastActiveItem: null
windowHeight: $(window).height()
@getFocusedTerminal: ->
return TerminalView.getFocusedTerminal()
initialize: (options) ->
super(options)
@emitter = new Emitter
@fullscreenBtn = @addButton 'right', @toggleFullscreen, 'scr... | CoffeeScript | jeremyramin/terminal-plus | lib/tab-view.coffee | MIT | 9e03a6b0faa3609f6b8c6523d9e7dbd9419a1895 | 478 | https://github.com/jeremyramin/terminal-plus/blob/9e03a6b0faa3609f6b8c6523d9e7dbd9419a1895/lib/tab-view.coffee | 7 | 56 | ||
jeremyramin/terminal-plus:lib/tab-view.coffee:2:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
class TabView extends TerminalView
opened: false
lastActiveItem: null
windowHeight: $(window).height()
@getFocusedTerminal: ->
return TerminalView.getFocusedTerminal()
initialize: (options) ->
super(options)
@emitter = new Emitter
@fu... | var TabView,
boundMethodCheck = function(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new Error('Bound instance method accessed before binding'); } };
TabView = (function() {
class TabView extends TerminalView {
constructor() {
super(...arguments);
this.destroy = this.de... | CoffeeScript | JavaScript | jeremyramin/terminal-plus | lib/tab-view.coffee | MIT | 9e03a6b0faa3609f6b8c6523d9e7dbd9419a1895 | 478 | https://github.com/jeremyramin/terminal-plus/blob/9e03a6b0faa3609f6b8c6523d9e7dbd9419a1895/lib/tab-view.coffee | 7 | 56 |
jeremyramin/terminal-plus:lib/tab-view.coffee:2:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
var TabView,
boundMethodCheck = function(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new Error('Bound instance method accessed before binding'); } };
TabView = (function() {
class TabView extends TerminalView {
constructor() {
... | class TabView extends TerminalView
opened: false
lastActiveItem: null
windowHeight: $(window).height()
@getFocusedTerminal: ->
return TerminalView.getFocusedTerminal()
initialize: (options) ->
super(options)
@emitter = new Emitter
@fullscreenBtn = @addButton 'right', @toggleFullscreen, 'scr... | JavaScript | CoffeeScript | jeremyramin/terminal-plus | lib/tab-view.coffee | MIT | 9e03a6b0faa3609f6b8c6523d9e7dbd9419a1895 | 478 | https://github.com/jeremyramin/terminal-plus/blob/9e03a6b0faa3609f6b8c6523d9e7dbd9419a1895/lib/tab-view.coffee | 7 | 56 |
jeremyramin/terminal-plus:lib/tab-view.coffee:2:completion | completion | class TabView extends TerminalView
opened: false
lastActiveItem: null
windowHeight: $(window).height()
@getFocusedTerminal: ->
return TerminalView.getFocusedTerminal()
initialize: (options) ->
super(options)
@emitter = new Emitter
@fullscreenBtn = @addButton 'right', @toggleFullscreen, 'scr... | super(keepTerminal)
###
Section: Setup
###
attach: (pane, index) ->
pane ?= atom.workspace.getActivePane()
index ?= pane.getItems().length
pane.addItem this, index
detach: ->
atom.workspace.paneForItem(this)?.removeItem(this, true)
###
Section: External Methods
###
open: =>
... | CoffeeScript | CoffeeScript | jeremyramin/terminal-plus | lib/tab-view.coffee | MIT | 9e03a6b0faa3609f6b8c6523d9e7dbd9419a1895 | 478 | https://github.com/jeremyramin/terminal-plus/blob/9e03a6b0faa3609f6b8c6523d9e7dbd9419a1895/lib/tab-view.coffee | 7 | 56 |
jeremyramin/terminal-plus:lib/tab-view.coffee:3:raw_corpus | raw_corpus | @focus()
hide: ({refocus}={}) =>
refocus ?= true
@blur()
super(refocus)
getIconName: ->
"terminal"
getTitle: ->
@terminal.getName() or "Terminal-Plus"
getPath: ->
return @terminal.getTitle()
onDidChangeTitle: (callback) ->
@emitter.on 'did-change-title', callback
updateNam... | CoffeeScript | jeremyramin/terminal-plus | lib/tab-view.coffee | MIT | 9e03a6b0faa3609f6b8c6523d9e7dbd9419a1895 | 478 | https://github.com/jeremyramin/terminal-plus/blob/9e03a6b0faa3609f6b8c6523d9e7dbd9419a1895/lib/tab-view.coffee | 57 | 90 | ||
jeremyramin/terminal-plus:lib/tab-view.coffee:3:completion | completion | @focus()
hide: ({refocus}={}) =>
refocus ?= true
@blur()
super(refocus)
getIconName: ->
"terminal"
getTitle: ->
@terminal.getName() or "Terminal-Plus"
getPath: ->
return @terminal.getTitle() | onDidChangeTitle: (callback) ->
@emitter.on 'did-change-title', callback
updateName: (name) ->
@emitter.emit 'did-change-title', name
toggleFullscreen: =>
@destroy keepTerminal: true
@terminal.enableAnimation()
panel = new (require './panel-view') {@terminal}
panel.toggle() if @isVisible()... | CoffeeScript | CoffeeScript | jeremyramin/terminal-plus | lib/tab-view.coffee | MIT | 9e03a6b0faa3609f6b8c6523d9e7dbd9419a1895 | 478 | https://github.com/jeremyramin/terminal-plus/blob/9e03a6b0faa3609f6b8c6523d9e7dbd9419a1895/lib/tab-view.coffee | 57 | 90 |
jeremyramin/terminal-plus:lib/tab-view.coffee:2:raw_corpus | raw_corpus | class TabView extends TerminalView
opened: false
lastActiveItem: null
windowHeight: $(window).height()
@getFocusedTerminal: ->
return TerminalView.getFocusedTerminal()
initialize: ({id, statusBar, path, pwd, terminal}) ->
super {id, statusBar, path, pwd, terminal}
@emitter = new Emitter
@fu... | CoffeeScript | jeremyramin/terminal-plus | lib/tab-view.coffee | MIT | aa374df03168977ec5fce2ef3476d6f8b26b6ade | 478 | https://github.com/jeremyramin/terminal-plus/blob/aa374df03168977ec5fce2ef3476d6f8b26b6ade/lib/tab-view.coffee | 7 | 56 | ||
jeremyramin/terminal-plus:lib/tab-view.coffee:2:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
class TabView extends TerminalView
opened: false
lastActiveItem: null
windowHeight: $(window).height()
@getFocusedTerminal: ->
return TerminalView.getFocusedTerminal()
initialize: ({id, statusBar, path, pwd, terminal}) ->
super {id, statusBar,... | var TabView,
boundMethodCheck = function(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new Error('Bound instance method accessed before binding'); } };
TabView = (function() {
class TabView extends TerminalView {
constructor() {
super(...arguments);
this.destroy = this.de... | CoffeeScript | JavaScript | jeremyramin/terminal-plus | lib/tab-view.coffee | MIT | aa374df03168977ec5fce2ef3476d6f8b26b6ade | 478 | https://github.com/jeremyramin/terminal-plus/blob/aa374df03168977ec5fce2ef3476d6f8b26b6ade/lib/tab-view.coffee | 7 | 56 |
jeremyramin/terminal-plus:lib/tab-view.coffee:2:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
var TabView,
boundMethodCheck = function(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new Error('Bound instance method accessed before binding'); } };
TabView = (function() {
class TabView extends TerminalView {
constructor() {
... | class TabView extends TerminalView
opened: false
lastActiveItem: null
windowHeight: $(window).height()
@getFocusedTerminal: ->
return TerminalView.getFocusedTerminal()
initialize: ({id, statusBar, path, pwd, terminal}) ->
super {id, statusBar, path, pwd, terminal}
@emitter = new Emitter
@fu... | JavaScript | CoffeeScript | jeremyramin/terminal-plus | lib/tab-view.coffee | MIT | aa374df03168977ec5fce2ef3476d6f8b26b6ade | 478 | https://github.com/jeremyramin/terminal-plus/blob/aa374df03168977ec5fce2ef3476d6f8b26b6ade/lib/tab-view.coffee | 7 | 56 |
jeremyramin/terminal-plus:lib/tab-view.coffee:2:completion | completion | class TabView extends TerminalView
opened: false
lastActiveItem: null
windowHeight: $(window).height()
@getFocusedTerminal: ->
return TerminalView.getFocusedTerminal()
initialize: ({id, statusBar, path, pwd, terminal}) ->
super {id, statusBar, path, pwd, terminal}
@emitter = new Emitter
@fu... | ###
Section: Setup
###
attach: (pane, index) ->
pane ?= atom.workspace.getActivePane()
index ?= pane.getItems().length
pane.addItem this, index
pane.activateItem this
detach: ->
atom.workspace.paneForItem(this)?.removeItem(this, true)
###
Section: External Methods
###
open: =>
... | CoffeeScript | CoffeeScript | jeremyramin/terminal-plus | lib/tab-view.coffee | MIT | aa374df03168977ec5fce2ef3476d6f8b26b6ade | 478 | https://github.com/jeremyramin/terminal-plus/blob/aa374df03168977ec5fce2ef3476d6f8b26b6ade/lib/tab-view.coffee | 7 | 56 |
jeremyramin/terminal-plus:lib/tab-view.coffee:3:raw_corpus | raw_corpus | @focus()
hide: =>
@blur()
super(true)
toggle: ->
if @isFocused()
@hide()
else
@open()
getIconName: ->
"terminal"
getTitle: ->
@terminal.getName() or "Terminal-Plus"
getPath: ->
return @terminal.getTitle()
onDidChangeTitle: (callback) ->
@emitter.on 'did-chan... | CoffeeScript | jeremyramin/terminal-plus | lib/tab-view.coffee | MIT | aa374df03168977ec5fce2ef3476d6f8b26b6ade | 478 | https://github.com/jeremyramin/terminal-plus/blob/aa374df03168977ec5fce2ef3476d6f8b26b6ade/lib/tab-view.coffee | 57 | 96 | ||
jeremyramin/terminal-plus:lib/tab-view.coffee:3:completion | completion | @focus()
hide: =>
@blur()
super(true)
toggle: ->
if @isFocused()
@hide()
else
@open()
getIconName: ->
"terminal"
getTitle: ->
@terminal.getName() or "Terminal-Plus"
getPath: ->
return @terminal.getTitle() | onDidChangeTitle: (callback) ->
@emitter.on 'did-change-title', callback
updateName: (name) ->
@emitter.emit 'did-change-title', name
toggleFullscreen: =>
@destroy keepTerminal: true
@terminal.enableAnimation()
panel = new (require './panel-view') {@terminal}
panel.toggle() if @isVisible()... | CoffeeScript | CoffeeScript | jeremyramin/terminal-plus | lib/tab-view.coffee | MIT | aa374df03168977ec5fce2ef3476d6f8b26b6ade | 478 | https://github.com/jeremyramin/terminal-plus/blob/aa374df03168977ec5fce2ef3476d6f8b26b6ade/lib/tab-view.coffee | 57 | 96 |
jeremyramin/terminal-plus:lib/tab-view.coffee:2:raw_corpus | raw_corpus | class TabView extends TerminalView
opened: false
lastActiveItem: null
windowHeight: $(window).height()
@getFocusedTerminal: ->
return TerminalView.getFocusedTerminal()
initialize: ({id, statusBar, path, pwd, terminal}) ->
super {id, statusBar, path, pwd, terminal}
@emitter = new Emitter
@fu... | CoffeeScript | jeremyramin/terminal-plus | lib/tab-view.coffee | MIT | 9baf5336e0f310f509256d5f9b44459b3a7f2882 | 478 | https://github.com/jeremyramin/terminal-plus/blob/9baf5336e0f310f509256d5f9b44459b3a7f2882/lib/tab-view.coffee | 7 | 56 | ||
jeremyramin/terminal-plus:lib/tab-view.coffee:2:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
class TabView extends TerminalView
opened: false
lastActiveItem: null
windowHeight: $(window).height()
@getFocusedTerminal: ->
return TerminalView.getFocusedTerminal()
initialize: ({id, statusBar, path, pwd, terminal}) ->
super {id, statusBar,... | var TabView,
boundMethodCheck = function(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new Error('Bound instance method accessed before binding'); } };
TabView = (function() {
class TabView extends TerminalView {
constructor() {
super(...arguments);
this.destroy = this.de... | CoffeeScript | JavaScript | jeremyramin/terminal-plus | lib/tab-view.coffee | MIT | 9baf5336e0f310f509256d5f9b44459b3a7f2882 | 478 | https://github.com/jeremyramin/terminal-plus/blob/9baf5336e0f310f509256d5f9b44459b3a7f2882/lib/tab-view.coffee | 7 | 56 |
jeremyramin/terminal-plus:lib/tab-view.coffee:2:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
var TabView,
boundMethodCheck = function(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new Error('Bound instance method accessed before binding'); } };
TabView = (function() {
class TabView extends TerminalView {
constructor() {
... | class TabView extends TerminalView
opened: false
lastActiveItem: null
windowHeight: $(window).height()
@getFocusedTerminal: ->
return TerminalView.getFocusedTerminal()
initialize: ({id, statusBar, path, pwd, terminal}) ->
super {id, statusBar, path, pwd, terminal}
@emitter = new Emitter
@fu... | JavaScript | CoffeeScript | jeremyramin/terminal-plus | lib/tab-view.coffee | MIT | 9baf5336e0f310f509256d5f9b44459b3a7f2882 | 478 | https://github.com/jeremyramin/terminal-plus/blob/9baf5336e0f310f509256d5f9b44459b3a7f2882/lib/tab-view.coffee | 7 | 56 |
jeremyramin/terminal-plus:lib/tab-view.coffee:2:completion | completion | class TabView extends TerminalView
opened: false
lastActiveItem: null
windowHeight: $(window).height()
@getFocusedTerminal: ->
return TerminalView.getFocusedTerminal()
initialize: ({id, statusBar, path, pwd, terminal}) ->
super {id, statusBar, path, pwd, terminal}
@emitter = new Emitter
@fu... | pane.addItem this, index
pane.activateItem this
detach: ->
atom.workspace.paneForItem(this)?.removeItem(this, true)
destroy: ({keepTerminal}={}) =>
@emitter.dispose()
super(keepTerminal)
open: =>
super()
if pane = atom.workspace.paneForItem(this)
pane.activateItem this
@focus(... | CoffeeScript | CoffeeScript | jeremyramin/terminal-plus | lib/tab-view.coffee | MIT | 9baf5336e0f310f509256d5f9b44459b3a7f2882 | 478 | https://github.com/jeremyramin/terminal-plus/blob/9baf5336e0f310f509256d5f9b44459b3a7f2882/lib/tab-view.coffee | 7 | 56 |
jeremyramin/terminal-plus:lib/tab-view.coffee:3:raw_corpus | raw_corpus | @open()
onDidChangeTitle: (callback) ->
@emitter.on 'did-change-title', callback
getIconName: ->
"terminal"
getTitle: ->
@terminal.getName() or "Terminal-Plus"
getPath: ->
return @terminal.getTitle()
onDidChangeTitle: (callback) ->
@emitter.on 'did-change-title', callback
updateNam... | CoffeeScript | jeremyramin/terminal-plus | lib/tab-view.coffee | MIT | 9baf5336e0f310f509256d5f9b44459b3a7f2882 | 478 | https://github.com/jeremyramin/terminal-plus/blob/9baf5336e0f310f509256d5f9b44459b3a7f2882/lib/tab-view.coffee | 57 | 89 | ||
jeremyramin/terminal-plus:lib/tab-view.coffee:3:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
@open()
onDidChangeTitle: (callback) ->
@emitter.on 'did-change-title', callback
getIconName: ->
"terminal"
getTitle: ->
@terminal.getName() or "Terminal-Plus"
getPath: ->
return @terminal.getTitle()
onDidChangeTitle: (callback) ->
... | this.open()({
onDidChangeTitle: function(callback) {
return this.emitter.on('did-change-title', callback);
},
getIconName: function() {
return "terminal";
},
getTitle: function() {
return this.terminal.getName() || "Terminal-Plus";
},
getPath: function() {
return this.terminal.getTitle();
... | CoffeeScript | JavaScript | jeremyramin/terminal-plus | lib/tab-view.coffee | MIT | 9baf5336e0f310f509256d5f9b44459b3a7f2882 | 478 | https://github.com/jeremyramin/terminal-plus/blob/9baf5336e0f310f509256d5f9b44459b3a7f2882/lib/tab-view.coffee | 57 | 89 |
jeremyramin/terminal-plus:lib/tab-view.coffee:3:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
this.open()({
onDidChangeTitle: function(callback) {
return this.emitter.on('did-change-title', callback);
},
getIconName: function() {
return "terminal";
},
getTitle: function() {
return this.terminal.getName() || "Terminal-Plus";
},
getP... | @open()
onDidChangeTitle: (callback) ->
@emitter.on 'did-change-title', callback
getIconName: ->
"terminal"
getTitle: ->
@terminal.getName() or "Terminal-Plus"
getPath: ->
return @terminal.getTitle()
onDidChangeTitle: (callback) ->
@emitter.on 'did-change-title', callback
updateNam... | JavaScript | CoffeeScript | jeremyramin/terminal-plus | lib/tab-view.coffee | MIT | 9baf5336e0f310f509256d5f9b44459b3a7f2882 | 478 | https://github.com/jeremyramin/terminal-plus/blob/9baf5336e0f310f509256d5f9b44459b3a7f2882/lib/tab-view.coffee | 57 | 89 |
jeremyramin/terminal-plus:lib/tab-view.coffee:3:completion | completion | @open()
onDidChangeTitle: (callback) ->
@emitter.on 'did-change-title', callback
getIconName: ->
"terminal"
getTitle: ->
@terminal.getName() or "Terminal-Plus"
getPath: ->
return @terminal.getTitle()
onDidChangeTitle: (callback) ->
@emitter.on 'did-change-title', callback | updateName: (name) ->
@emitter.emit 'did-change-title', name
toggleFullscreen: =>
@destroy keepTerminal: true
@terminal.enableAnimation()
panel = new (require './panel-view') {@terminal}
panel.toggle() if @isVisible()
@detach()
isVisible: ->
pane = atom.workspace.paneForItem(this)
... | CoffeeScript | CoffeeScript | jeremyramin/terminal-plus | lib/tab-view.coffee | MIT | 9baf5336e0f310f509256d5f9b44459b3a7f2882 | 478 | https://github.com/jeremyramin/terminal-plus/blob/9baf5336e0f310f509256d5f9b44459b3a7f2882/lib/tab-view.coffee | 57 | 89 |
jeremyramin/terminal-plus:lib/tab-view.coffee:1:raw_corpus | raw_corpus | {CompositeDisposable, Emitter} = require 'atom'
{$} = require 'atom-space-pen-views'
TerminalView = require './terminal-view'
module.exports =
class TabView extends TerminalView
opened: false
lastActiveItem: null
windowHeight: $(window).height()
@getFocusedTerminal: ->
return TerminalView.getFocusedTermi... | CoffeeScript | jeremyramin/terminal-plus | lib/tab-view.coffee | MIT | 9846136d407b3f20ce78ac8bf12470ed999a0056 | 478 | https://github.com/jeremyramin/terminal-plus/blob/9846136d407b3f20ce78ac8bf12470ed999a0056/lib/tab-view.coffee | 1 | 50 | ||
jeremyramin/terminal-plus:lib/tab-view.coffee:1:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
{CompositeDisposable, Emitter} = require 'atom'
{$} = require 'atom-space-pen-views'
TerminalView = require './terminal-view'
module.exports =
class TabView extends TerminalView
opened: false
lastActiveItem: null
windowHeight: $(window).height()
@getFo... | var $, CompositeDisposable, Emitter, TabView, TerminalView,
boundMethodCheck = function(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new Error('Bound instance method accessed before binding'); } };
({CompositeDisposable, Emitter} = require('atom'));
({$} = require('atom-space-pen-views')... | CoffeeScript | JavaScript | jeremyramin/terminal-plus | lib/tab-view.coffee | MIT | 9846136d407b3f20ce78ac8bf12470ed999a0056 | 478 | https://github.com/jeremyramin/terminal-plus/blob/9846136d407b3f20ce78ac8bf12470ed999a0056/lib/tab-view.coffee | 1 | 50 |
jeremyramin/terminal-plus:lib/tab-view.coffee:1:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
var $, CompositeDisposable, Emitter, TabView, TerminalView,
boundMethodCheck = function(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new Error('Bound instance method accessed before binding'); } };
({CompositeDisposable, Emitter} = re... | {CompositeDisposable, Emitter} = require 'atom'
{$} = require 'atom-space-pen-views'
TerminalView = require './terminal-view'
module.exports =
class TabView extends TerminalView
opened: false
lastActiveItem: null
windowHeight: $(window).height()
@getFocusedTerminal: ->
return TerminalView.getFocusedTermi... | JavaScript | CoffeeScript | jeremyramin/terminal-plus | lib/tab-view.coffee | MIT | 9846136d407b3f20ce78ac8bf12470ed999a0056 | 478 | https://github.com/jeremyramin/terminal-plus/blob/9846136d407b3f20ce78ac8bf12470ed999a0056/lib/tab-view.coffee | 1 | 50 |
jeremyramin/terminal-plus:lib/tab-view.coffee:1:completion | completion | {CompositeDisposable, Emitter} = require 'atom'
{$} = require 'atom-space-pen-views'
TerminalView = require './terminal-view'
module.exports =
class TabView extends TerminalView
opened: false
lastActiveItem: null
windowHeight: $(window).height()
@getFocusedTerminal: ->
return TerminalView.getFocusedTermi... | @attach()
attach: (pane, index) ->
pane ?= atom.workspace.getActivePane()
index ?= pane.getItems().length
pane.addItem this, index
pane.activateItem this
detach: ->
atom.workspace.paneForItem(this)?.removeItem(this, true)
destroy: ({keepTerminal}={}) =>
@emitter.dispose()
super(kee... | CoffeeScript | CoffeeScript | jeremyramin/terminal-plus | lib/tab-view.coffee | MIT | 9846136d407b3f20ce78ac8bf12470ed999a0056 | 478 | https://github.com/jeremyramin/terminal-plus/blob/9846136d407b3f20ce78ac8bf12470ed999a0056/lib/tab-view.coffee | 1 | 50 |
jeremyramin/terminal-plus:lib/tab-view.coffee:2:raw_corpus | raw_corpus | super()
toggle: ->
if @isFocused()
@hide()
else
@open()
onDidChangeTitle: (callback) ->
@emitter.on 'did-change-title', callback
getIconName: ->
"terminal"
getTitle: ->
@terminal.getName() or "Terminal-Plus"
getPath: ->
return @terminal.getTitle()
updateName: (name)... | CoffeeScript | jeremyramin/terminal-plus | lib/tab-view.coffee | MIT | 9846136d407b3f20ce78ac8bf12470ed999a0056 | 478 | https://github.com/jeremyramin/terminal-plus/blob/9846136d407b3f20ce78ac8bf12470ed999a0056/lib/tab-view.coffee | 51 | 79 | ||
jeremyramin/terminal-plus:lib/tab-view.coffee:2:completion | completion | super()
toggle: ->
if @isFocused()
@hide()
else
@open()
onDidChangeTitle: (callback) ->
@emitter.on 'did-change-title', callback
getIconName: ->
"terminal" | getTitle: ->
@terminal.getName() or "Terminal-Plus"
getPath: ->
return @terminal.getTitle()
updateName: (name) ->
@emitter.emit 'did-change-title', name
toggleFullscreen: =>
@detach()
@destroy keepTerminal: true
@terminal.enableAnimation()
panel = new (require './panel-view') {@term... | CoffeeScript | CoffeeScript | jeremyramin/terminal-plus | lib/tab-view.coffee | MIT | 9846136d407b3f20ce78ac8bf12470ed999a0056 | 478 | https://github.com/jeremyramin/terminal-plus/blob/9846136d407b3f20ce78ac8bf12470ed999a0056/lib/tab-view.coffee | 51 | 79 |
jeremyramin/terminal-plus:lib/tab-view.coffee:2:raw_corpus | raw_corpus | class TabView extends TerminalView
opened: false
windowHeight: $(window).height()
@getFocusedTerminal: ->
return TerminalView.getFocusedTerminal()
initialize: ({id, statusBar, path, pwd, terminal}) ->
super {id, statusBar, path, pwd, terminal}
@emitter = new Emitter
@fullscreenBtn = @addButto... | CoffeeScript | jeremyramin/terminal-plus | lib/tab-view.coffee | MIT | 2252b401b7c65d5b7af491721752f21632e999f8 | 478 | https://github.com/jeremyramin/terminal-plus/blob/2252b401b7c65d5b7af491721752f21632e999f8/lib/tab-view.coffee | 7 | 56 | ||
jeremyramin/terminal-plus:lib/tab-view.coffee:2:completion | completion | class TabView extends TerminalView
opened: false
windowHeight: $(window).height()
@getFocusedTerminal: ->
return TerminalView.getFocusedTerminal()
initialize: ({id, statusBar, path, pwd, terminal}) ->
super {id, statusBar, path, pwd, terminal}
@emitter = new Emitter
@fullscreenBtn = @addButto... | pane.addItem this, index
pane.activateItem this
detach: ->
pane = atom.workspace.paneForItem(this)
pane.removeItem(this)
destroy: ({saveTerminal} = {}) =>
@emitter.dispose()
@detach()
if saveTerminal
@terminal = null
super()
open: =>
@focus()
super()
hide: =>
@... | CoffeeScript | CoffeeScript | jeremyramin/terminal-plus | lib/tab-view.coffee | MIT | 2252b401b7c65d5b7af491721752f21632e999f8 | 478 | https://github.com/jeremyramin/terminal-plus/blob/2252b401b7c65d5b7af491721752f21632e999f8/lib/tab-view.coffee | 7 | 56 |
jeremyramin/terminal-plus:lib/tab-view.coffee:3:raw_corpus | raw_corpus | @hide()
else
@open()
onDidChangeTitle: (callback) ->
@emitter.on 'did-change-title', callback
getIconName: ->
"terminal"
getTitle: ->
@name or "Terminal-Plus"
getPath: ->
return @getProcessTitle()
setName: (name) ->
super()
@emitter.emit 'did-change-title', name
toggl... | CoffeeScript | jeremyramin/terminal-plus | lib/tab-view.coffee | MIT | 2252b401b7c65d5b7af491721752f21632e999f8 | 478 | https://github.com/jeremyramin/terminal-plus/blob/2252b401b7c65d5b7af491721752f21632e999f8/lib/tab-view.coffee | 57 | 82 | ||
jeremyramin/terminal-plus:lib/tab-view.coffee:3:completion | completion | @hide()
else
@open()
onDidChangeTitle: (callback) ->
@emitter.on 'did-change-title', callback
getIconName: ->
"terminal"
getTitle: ->
@name or "Terminal-Plus" | getPath: ->
return @getProcessTitle()
setName: (name) ->
super()
@emitter.emit 'did-change-title', name
toggleFullscreen: =>
terminal = @terminal
@destroy({saveTerminal: true})
panel = new (require './panel-view') {@id, @statusBar, terminal}
panel.attach()
panel.open() | CoffeeScript | CoffeeScript | jeremyramin/terminal-plus | lib/tab-view.coffee | MIT | 2252b401b7c65d5b7af491721752f21632e999f8 | 478 | https://github.com/jeremyramin/terminal-plus/blob/2252b401b7c65d5b7af491721752f21632e999f8/lib/tab-view.coffee | 57 | 82 |
jianliaoim/talk-os:talk-api2x/server/components/apn.coffee:1:raw_corpus | raw_corpus | apn = require 'apn'
config = require 'config'
apnConnection = new apn.Connection config.apn
pusher = module.exports
pusher.push = (token, alert, badge, payload = {}) ->
myDevice = new apn.Device token
note = new apn.Notification()
note.expiry = Math.floor(Date.now() / 1000) + 3600
note.badge = badge
note.a... | CoffeeScript | jianliaoim/talk-os | talk-api2x/server/components/apn.coffee | MIT | 2545c4497865779a55762e03963a39237df9046b | 2,703 | https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-api2x/server/components/apn.coffee | 1 | 17 | ||
jianliaoim/talk-os:talk-api2x/server/components/apn.coffee:1:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
apn = require 'apn'
config = require 'config'
apnConnection = new apn.Connection config.apn
pusher = module.exports
pusher.push = (token, alert, badge, payload = {}) ->
myDevice = new apn.Device token
note = new apn.Notification()
note.expiry = Math.floo... | var apn, apnConnection, config, pusher;
apn = require('apn');
config = require('config');
apnConnection = new apn.Connection(config.apn);
pusher = module.exports;
pusher.push = function(token, alert, badge, payload = {}) {
var myDevice, note;
myDevice = new apn.Device(token);
note = new apn.Notification();
... | CoffeeScript | JavaScript | jianliaoim/talk-os | talk-api2x/server/components/apn.coffee | MIT | 2545c4497865779a55762e03963a39237df9046b | 2,703 | https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-api2x/server/components/apn.coffee | 1 | 17 |
jianliaoim/talk-os:talk-api2x/server/components/apn.coffee:1:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
var apn, apnConnection, config, pusher;
apn = require('apn');
config = require('config');
apnConnection = new apn.Connection(config.apn);
pusher = module.exports;
pusher.push = function(token, alert, badge, payload = {}) {
var myDevice, note;
myDevice = ne... | apn = require 'apn'
config = require 'config'
apnConnection = new apn.Connection config.apn
pusher = module.exports
pusher.push = (token, alert, badge, payload = {}) ->
myDevice = new apn.Device token
note = new apn.Notification()
note.expiry = Math.floor(Date.now() / 1000) + 3600
note.badge = badge
note.a... | JavaScript | CoffeeScript | jianliaoim/talk-os | talk-api2x/server/components/apn.coffee | MIT | 2545c4497865779a55762e03963a39237df9046b | 2,703 | https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-api2x/server/components/apn.coffee | 1 | 17 |
jianliaoim/talk-os:talk-api2x/server/components/apn.coffee:1:completion | completion | apn = require 'apn'
config = require 'config'
apnConnection = new apn.Connection config.apn
pusher = module.exports
pusher.push = (token, alert, badge, payload = {}) -> | myDevice = new apn.Device token
note = new apn.Notification()
note.expiry = Math.floor(Date.now() / 1000) + 3600
note.badge = badge
note.alert = alert
note.sound = 'bubble.wav'
note.category = 'COMMENT_CATEGORY'
note.payload = payload
apnConnection.pushNotification note, myDevice | CoffeeScript | CoffeeScript | jianliaoim/talk-os | talk-api2x/server/components/apn.coffee | MIT | 2545c4497865779a55762e03963a39237df9046b | 2,703 | https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-api2x/server/components/apn.coffee | 1 | 17 |
soyjavi/QuoJS:spec/5_environment.coffee:1:raw_corpus | raw_corpus | describe "Environment", ->
it "know if device it's mobile or not", ->
expect($$.isMobile()).not.toBeTruthy()
it "get environment attributes", ->
environment = $$.environment()
expect(environment.browser?).toBeTruthy()
expect(environment.os?).not.toEqual null
expect(environment.screen?).toBeTr... | CoffeeScript | soyjavi/QuoJS | spec/5_environment.coffee | MIT | 7296aa6bc321370c1b92de005c9b55b9e1365596 | 2,055 | https://github.com/soyjavi/QuoJS/blob/7296aa6bc321370c1b92de005c9b55b9e1365596/spec/5_environment.coffee | 1 | 12 | ||
soyjavi/QuoJS:spec/5_environment.coffee:1:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
describe "Environment", ->
it "know if device it's mobile or not", ->
expect($$.isMobile()).not.toBeTruthy()
it "get environment attributes", ->
environment = $$.environment()
expect(environment.browser?).toBeTruthy()
expect(environment.os?... | describe("Environment", function() {
it("know if device it's mobile or not", function() {
return expect($$.isMobile()).not.toBeTruthy();
});
return it("get environment attributes", function() {
var environment;
environment = $$.environment();
expect(environment.browser != null).toBeTruthy();
e... | CoffeeScript | JavaScript | soyjavi/QuoJS | spec/5_environment.coffee | MIT | 7296aa6bc321370c1b92de005c9b55b9e1365596 | 2,055 | https://github.com/soyjavi/QuoJS/blob/7296aa6bc321370c1b92de005c9b55b9e1365596/spec/5_environment.coffee | 1 | 12 |
soyjavi/QuoJS:spec/5_environment.coffee:1:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
describe("Environment", function() {
it("know if device it's mobile or not", function() {
return expect($$.isMobile()).not.toBeTruthy();
});
return it("get environment attributes", function() {
var environment;
environment = $$.environment();
... | describe "Environment", ->
it "know if device it's mobile or not", ->
expect($$.isMobile()).not.toBeTruthy()
it "get environment attributes", ->
environment = $$.environment()
expect(environment.browser?).toBeTruthy()
expect(environment.os?).not.toEqual null
expect(environment.screen?).toBeTr... | JavaScript | CoffeeScript | soyjavi/QuoJS | spec/5_environment.coffee | MIT | 7296aa6bc321370c1b92de005c9b55b9e1365596 | 2,055 | https://github.com/soyjavi/QuoJS/blob/7296aa6bc321370c1b92de005c9b55b9e1365596/spec/5_environment.coffee | 1 | 12 |
soyjavi/QuoJS:spec/5_environment.coffee:1:completion | completion | describe "Environment", ->
it "know if device it's mobile or not", ->
expect($$.isMobile()).not.toBeTruthy() | it "get environment attributes", ->
environment = $$.environment()
expect(environment.browser?).toBeTruthy()
expect(environment.os?).not.toEqual null
expect(environment.screen?).toBeTruthy()
expect(environment.isMobile?).toBeTruthy() | CoffeeScript | CoffeeScript | soyjavi/QuoJS | spec/5_environment.coffee | MIT | 7296aa6bc321370c1b92de005c9b55b9e1365596 | 2,055 | https://github.com/soyjavi/QuoJS/blob/7296aa6bc321370c1b92de005c9b55b9e1365596/spec/5_environment.coffee | 1 | 12 |
mojotech/pioneer:test/steps/steps.coffee:1:raw_corpus | raw_corpus | module.exports = ->
@When /^I read the "([^"]*)" I should see "([^"]*)"$/, (selector, content) ->
new @Widget({
root: selector
})
.read()
.should.eventually.eql(content)
@When /^I find the "([^"]*)" element within "([^"]*)" I should see "([^"]*)"$/, (child, parent, content) ->
base = new ... | CoffeeScript | mojotech/pioneer | test/steps/steps.coffee | MIT | 1c77ffb13f5e3b88d62950430bbb7944dd341df0 | 523 | https://github.com/mojotech/pioneer/blob/1c77ffb13f5e3b88d62950430bbb7944dd341df0/test/steps/steps.coffee | 1 | 15 | ||
mojotech/pioneer:test/steps/steps.coffee:1:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
module.exports = ->
@When /^I read the "([^"]*)" I should see "([^"]*)"$/, (selector, content) ->
new @Widget({
root: selector
})
.read()
.should.eventually.eql(content)
@When /^I find the "([^"]*)" element within "([^"]*)" I should see... | module.exports = function() {
this.When(/^I read the "([^"]*)" I should see "([^"]*)"$/, function(selector, content) {
return new this.Widget({
root: selector
}).read().should.eventually.eql(content);
});
return this.When(/^I find the "([^"]*)" element within "([^"]*)" I should see "([^"]*)"$/, func... | CoffeeScript | JavaScript | mojotech/pioneer | test/steps/steps.coffee | MIT | 1c77ffb13f5e3b88d62950430bbb7944dd341df0 | 523 | https://github.com/mojotech/pioneer/blob/1c77ffb13f5e3b88d62950430bbb7944dd341df0/test/steps/steps.coffee | 1 | 15 |
mojotech/pioneer:test/steps/steps.coffee:1:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
module.exports = function() {
this.When(/^I read the "([^"]*)" I should see "([^"]*)"$/, function(selector, content) {
return new this.Widget({
root: selector
}).read().should.eventually.eql(content);
});
return this.When(/^I find the "([^"]*)" ... | module.exports = ->
@When /^I read the "([^"]*)" I should see "([^"]*)"$/, (selector, content) ->
new @Widget({
root: selector
})
.read()
.should.eventually.eql(content)
@When /^I find the "([^"]*)" element within "([^"]*)" I should see "([^"]*)"$/, (child, parent, content) ->
base = new ... | JavaScript | CoffeeScript | mojotech/pioneer | test/steps/steps.coffee | MIT | 1c77ffb13f5e3b88d62950430bbb7944dd341df0 | 523 | https://github.com/mojotech/pioneer/blob/1c77ffb13f5e3b88d62950430bbb7944dd341df0/test/steps/steps.coffee | 1 | 15 |
mojotech/pioneer:test/steps/steps.coffee:1:completion | completion | module.exports = ->
@When /^I read the "([^"]*)" I should see "([^"]*)"$/, (selector, content) ->
new @Widget({
root: selector
})
.read()
.should.eventually.eql(content) | @When /^I find the "([^"]*)" element within "([^"]*)" I should see "([^"]*)"$/, (child, parent, content) ->
base = new @Widget({
root: parent
})
base.read(child)
.should.eventually.eql(content) | CoffeeScript | CoffeeScript | mojotech/pioneer | test/steps/steps.coffee | MIT | 1c77ffb13f5e3b88d62950430bbb7944dd341df0 | 523 | https://github.com/mojotech/pioneer/blob/1c77ffb13f5e3b88d62950430bbb7944dd341df0/test/steps/steps.coffee | 1 | 15 |
mojotech/pioneer:test/steps/steps.coffee:1:raw_corpus | raw_corpus | Path = require "path"
fixturesBase = Path.resolve(__dirname, "../", "fixtures")
module.exports = ->
@When /^I view "([^"]*)"$/, (name) ->
@driver.get("file:///"+ Path.join(fixturesBase, name))
@When /^I read the "([^"]*)" I should see "([^"]*)"$/, (selector, content) ->
new @Widget({
root:... | CoffeeScript | mojotech/pioneer | test/steps/steps.coffee | MIT | 20abb1c9694898d1658634733f41acbd9ea8530e | 523 | https://github.com/mojotech/pioneer/blob/20abb1c9694898d1658634733f41acbd9ea8530e/test/steps/steps.coffee | 1 | 21 | ||
mojotech/pioneer:test/steps/steps.coffee:1:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
Path = require "path"
fixturesBase = Path.resolve(__dirname, "../", "fixtures")
module.exports = ->
@When /^I view "([^"]*)"$/, (name) ->
@driver.get("file:///"+ Path.join(fixturesBase, name))
@When /^I read the "([^"]*)" I should see "([^"]*)... | var Path, fixturesBase;
Path = require("path");
fixturesBase = Path.resolve(__dirname, "../", "fixtures");
module.exports = function() {
this.When(/^I view "([^"]*)"$/, function(name) {
return this.driver.get("file:///" + Path.join(fixturesBase, name));
});
this.When(/^I read the "([^"]*)" I should see "([... | CoffeeScript | JavaScript | mojotech/pioneer | test/steps/steps.coffee | MIT | 20abb1c9694898d1658634733f41acbd9ea8530e | 523 | https://github.com/mojotech/pioneer/blob/20abb1c9694898d1658634733f41acbd9ea8530e/test/steps/steps.coffee | 1 | 21 |
mojotech/pioneer:test/steps/steps.coffee:1:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
var Path, fixturesBase;
Path = require("path");
fixturesBase = Path.resolve(__dirname, "../", "fixtures");
module.exports = function() {
this.When(/^I view "([^"]*)"$/, function(name) {
return this.driver.get("file:///" + Path.join(fixturesBase, name));
... | Path = require "path"
fixturesBase = Path.resolve(__dirname, "../", "fixtures")
module.exports = ->
@When /^I view "([^"]*)"$/, (name) ->
@driver.get("file:///"+ Path.join(fixturesBase, name))
@When /^I read the "([^"]*)" I should see "([^"]*)"$/, (selector, content) ->
new @Widget({
root:... | JavaScript | CoffeeScript | mojotech/pioneer | test/steps/steps.coffee | MIT | 20abb1c9694898d1658634733f41acbd9ea8530e | 523 | https://github.com/mojotech/pioneer/blob/20abb1c9694898d1658634733f41acbd9ea8530e/test/steps/steps.coffee | 1 | 21 |
mojotech/pioneer:test/steps/steps.coffee:1:completion | completion | Path = require "path"
fixturesBase = Path.resolve(__dirname, "../", "fixtures")
module.exports = ->
@When /^I view "([^"]*)"$/, (name) ->
@driver.get("file:///"+ Path.join(fixturesBase, name))
@When /^I read the "([^"]*)" I should see "([^"]*)"$/, (selector, content) ->
new @Widget({
root:... | })
.read()
.should.eventually.eql(content)
@When /^I find the "([^"]*)" element within "([^"]*)" I should see "([^"]*)"$/, (child, parent, content) ->
base = new @Widget({
root: parent
})
base.read(child)
.should.eventually.eql(content) | CoffeeScript | CoffeeScript | mojotech/pioneer | test/steps/steps.coffee | MIT | 20abb1c9694898d1658634733f41acbd9ea8530e | 523 | https://github.com/mojotech/pioneer/blob/20abb1c9694898d1658634733f41acbd9ea8530e/test/steps/steps.coffee | 1 | 21 |
Glavin001/atom-beautify:src/beautifiers/r-beautifier/index.coffee:1:raw_corpus | raw_corpus | ###
Requires [formatR](https://github.com/yihui/formatR)
###
path = require("path")
"use strict"
Beautifier = require('../beautifier')
module.exports = class R extends Beautifier
name: "formatR"
link: "https://github.com/yihui/formatR"
options: {
R: true
}
beautify: (text, language, options) ->
r_... | CoffeeScript | Glavin001/atom-beautify | src/beautifiers/r-beautifier/index.coffee | MIT | 9d31e3bb6d8246d2d766fecbf6054bcd86c29a24 | 1,503 | https://github.com/Glavin001/atom-beautify/blob/9d31e3bb6d8246d2d766fecbf6054bcd86c29a24/src/beautifiers/r-beautifier/index.coffee | 1 | 25 | ||
Glavin001/atom-beautify:src/beautifiers/r-beautifier/index.coffee:1:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
###
Requires [formatR](https://github.com/yihui/formatR)
###
path = require("path")
"use strict"
Beautifier = require('../beautifier')
module.exports = class R extends Beautifier
name: "formatR"
link: "https://github.com/yihui/formatR"
options: {
R: ... | /*
Requires [formatR](https://github.com/yihui/formatR)
*/
var Beautifier, R, path;
path = require("path");
"use strict";
Beautifier = require('../beautifier');
module.exports = R = (function() {
class R extends Beautifier {
beautify(text, language, options) {
var r_beautifier;
r_beautifier = path... | CoffeeScript | JavaScript | Glavin001/atom-beautify | src/beautifiers/r-beautifier/index.coffee | MIT | 9d31e3bb6d8246d2d766fecbf6054bcd86c29a24 | 1,503 | https://github.com/Glavin001/atom-beautify/blob/9d31e3bb6d8246d2d766fecbf6054bcd86c29a24/src/beautifiers/r-beautifier/index.coffee | 1 | 25 |
Glavin001/atom-beautify:src/beautifiers/r-beautifier/index.coffee:1:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
/*
Requires [formatR](https://github.com/yihui/formatR)
*/
var Beautifier, R, path;
path = require("path");
"use strict";
Beautifier = require('../beautifier');
module.exports = R = (function() {
class R extends Beautifier {
beautify(text, language, optio... | ###
Requires [formatR](https://github.com/yihui/formatR)
###
path = require("path")
"use strict"
Beautifier = require('../beautifier')
module.exports = class R extends Beautifier
name: "formatR"
link: "https://github.com/yihui/formatR"
options: {
R: true
}
beautify: (text, language, options) ->
r_... | JavaScript | CoffeeScript | Glavin001/atom-beautify | src/beautifiers/r-beautifier/index.coffee | MIT | 9d31e3bb6d8246d2d766fecbf6054bcd86c29a24 | 1,503 | https://github.com/Glavin001/atom-beautify/blob/9d31e3bb6d8246d2d766fecbf6054bcd86c29a24/src/beautifiers/r-beautifier/index.coffee | 1 | 25 |
Glavin001/atom-beautify:src/beautifiers/r-beautifier/index.coffee:1:completion | completion | ###
Requires [formatR](https://github.com/yihui/formatR)
###
path = require("path")
"use strict"
Beautifier = require('../beautifier')
module.exports = class R extends Beautifier
name: "formatR"
link: "https://github.com/yihui/formatR" | options: {
R: true
}
beautify: (text, language, options) ->
r_beautifier = path.resolve(__dirname, "r-beautifier.r")
@run("Rscript", [
r_beautifier,
options.indent_size,
@tempFile("input", text),
'>',
@tempFile("input", text)
]) | CoffeeScript | CoffeeScript | Glavin001/atom-beautify | src/beautifiers/r-beautifier/index.coffee | MIT | 9d31e3bb6d8246d2d766fecbf6054bcd86c29a24 | 1,503 | https://github.com/Glavin001/atom-beautify/blob/9d31e3bb6d8246d2d766fecbf6054bcd86c29a24/src/beautifiers/r-beautifier/index.coffee | 1 | 25 |
mojotech/pioneer:test/integration/steps/shorthand.coffee:1:raw_corpus | raw_corpus | module.exports = ->
@When /^I shorthand double click an element$/, ->
@W.doubleClick({
selector: '.double'
}).then (w) -> w.read({selector: ".double"}).should.eventually.eql("wow such click")
@When /^I shorthand hover an element$/, ->
@W.hover({
selector: "h4"
}).then (w) ->
w.re... | CoffeeScript | mojotech/pioneer | test/integration/steps/shorthand.coffee | MIT | 2d3ade85e18e3ea1dfff2545bad4142aa9c496e4 | 523 | https://github.com/mojotech/pioneer/blob/2d3ade85e18e3ea1dfff2545bad4142aa9c496e4/test/integration/steps/shorthand.coffee | 3 | 52 | ||
mojotech/pioneer:test/integration/steps/shorthand.coffee:1:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
module.exports = ->
@When /^I shorthand double click an element$/, ->
@W.doubleClick({
selector: '.double'
}).then (w) -> w.read({selector: ".double"}).should.eventually.eql("wow such click")
@When /^I shorthand hover an element$/, ->
@W.h... | module.exports = function() {
this.When(/^I shorthand double click an element$/, function() {
return this.W.doubleClick({
selector: '.double'
}).then(function(w) {
return w.read({
selector: ".double"
}).should.eventually.eql("wow such click");
});
});
this.When(/^I shorthand ... | CoffeeScript | JavaScript | mojotech/pioneer | test/integration/steps/shorthand.coffee | MIT | 2d3ade85e18e3ea1dfff2545bad4142aa9c496e4 | 523 | https://github.com/mojotech/pioneer/blob/2d3ade85e18e3ea1dfff2545bad4142aa9c496e4/test/integration/steps/shorthand.coffee | 3 | 52 |
mojotech/pioneer:test/integration/steps/shorthand.coffee:1:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
module.exports = function() {
this.When(/^I shorthand double click an element$/, function() {
return this.W.doubleClick({
selector: '.double'
}).then(function(w) {
return w.read({
selector: ".double"
}).should.eventually.eql("wow... | module.exports = ->
@When /^I shorthand double click an element$/, ->
@W.doubleClick({
selector: '.double'
}).then (w) -> w.read({selector: ".double"}).should.eventually.eql("wow such click")
@When /^I shorthand hover an element$/, ->
@W.hover({
selector: "h4"
}).then (w) ->
w.re... | JavaScript | CoffeeScript | mojotech/pioneer | test/integration/steps/shorthand.coffee | MIT | 2d3ade85e18e3ea1dfff2545bad4142aa9c496e4 | 523 | https://github.com/mojotech/pioneer/blob/2d3ade85e18e3ea1dfff2545bad4142aa9c496e4/test/integration/steps/shorthand.coffee | 3 | 52 |
mojotech/pioneer:test/integration/steps/shorthand.coffee:1:completion | completion | module.exports = ->
@When /^I shorthand double click an element$/, ->
@W.doubleClick({
selector: '.double'
}).then (w) -> w.read({selector: ".double"}).should.eventually.eql("wow such click")
@When /^I shorthand hover an element$/, ->
@W.hover({
selector: "h4"
}).then (w) ->
w.re... | @When /^I shorthand isVisible an element$/, ->
@W.isVisible({
selector: ".wow"
}).should.eventually.eql(true)
@When /^I shorthand getAttribute an element$/, ->
@W.getAttribute({
attribute: "width",
selector: ".wow"
}).should.eventually.eql("400px")
@When /^I shorthand getValue th... | CoffeeScript | CoffeeScript | mojotech/pioneer | test/integration/steps/shorthand.coffee | MIT | 2d3ade85e18e3ea1dfff2545bad4142aa9c496e4 | 523 | https://github.com/mojotech/pioneer/blob/2d3ade85e18e3ea1dfff2545bad4142aa9c496e4/test/integration/steps/shorthand.coffee | 3 | 52 |
mojotech/pioneer:test/integration/steps/shorthand.coffee:2:raw_corpus | raw_corpus | html.trim()
.should.eql("<doge>many money</doge>")
@When /^I shorthand getOuterHTML an element$/, ->
@W.getOuterHTML({
selector: ".wow doge"
}).then (html) ->
html.split('\n').map((string) ->
string.trim()
)
.join("")
.should.eql("<doge>many money</doge>")
@When... | CoffeeScript | mojotech/pioneer | test/integration/steps/shorthand.coffee | MIT | 2d3ade85e18e3ea1dfff2545bad4142aa9c496e4 | 523 | https://github.com/mojotech/pioneer/blob/2d3ade85e18e3ea1dfff2545bad4142aa9c496e4/test/integration/steps/shorthand.coffee | 53 | 97 | ||
mojotech/pioneer:test/integration/steps/shorthand.coffee:2:completion | completion | html.trim()
.should.eql("<doge>many money</doge>")
@When /^I shorthand getOuterHTML an element$/, ->
@W.getOuterHTML({
selector: ".wow doge"
}).then (html) ->
html.split('\n').map((string) ->
string.trim()
)
.join("")
.should.eql("<doge>many money</doge>")
@When... | keys: [
"dogecoins",
Driver.Key.SPACE,
"are",
Driver.Key.SPACE,
"worth",
Driver.Key.SPACE,
"alot"
]
}).then =>
@getValue({
selector: ".inputbox"
}).should.eventually.eql("dogecoins are worth alot")
@When /^I shorthand call clear an... | CoffeeScript | CoffeeScript | mojotech/pioneer | test/integration/steps/shorthand.coffee | MIT | 2d3ade85e18e3ea1dfff2545bad4142aa9c496e4 | 523 | https://github.com/mojotech/pioneer/blob/2d3ade85e18e3ea1dfff2545bad4142aa9c496e4/test/integration/steps/shorthand.coffee | 53 | 97 |
mojotech/pioneer:test/integration/steps/shorthand.coffee:1:raw_corpus | raw_corpus | module.exports = ->
@When /^I shorthand double click an element$/, ->
@W.doubleClick({
selector: '.double'
}).then (w) -> w.read({selector: ".double"}).should.eventually.eql("wow such click")
@When /^I shorthand hover an element$/, ->
@W.hover({
selector: "h4"
}).then (w) ->
w.re... | CoffeeScript | mojotech/pioneer | test/integration/steps/shorthand.coffee | MIT | 6ffd127166647dca61f1a0ca3ae01f11678f766f | 523 | https://github.com/mojotech/pioneer/blob/6ffd127166647dca61f1a0ca3ae01f11678f766f/test/integration/steps/shorthand.coffee | 3 | 52 | ||
mojotech/pioneer:test/integration/steps/shorthand.coffee:1:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
module.exports = ->
@When /^I shorthand double click an element$/, ->
@W.doubleClick({
selector: '.double'
}).then (w) -> w.read({selector: ".double"}).should.eventually.eql("wow such click")
@When /^I shorthand hover an element$/, ->
@W.h... | module.exports = function() {
this.When(/^I shorthand double click an element$/, function() {
return this.W.doubleClick({
selector: '.double'
}).then(function(w) {
return w.read({
selector: ".double"
}).should.eventually.eql("wow such click");
});
});
this.When(/^I shorthand ... | CoffeeScript | JavaScript | mojotech/pioneer | test/integration/steps/shorthand.coffee | MIT | 6ffd127166647dca61f1a0ca3ae01f11678f766f | 523 | https://github.com/mojotech/pioneer/blob/6ffd127166647dca61f1a0ca3ae01f11678f766f/test/integration/steps/shorthand.coffee | 3 | 52 |
mojotech/pioneer:test/integration/steps/shorthand.coffee:1:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
module.exports = function() {
this.When(/^I shorthand double click an element$/, function() {
return this.W.doubleClick({
selector: '.double'
}).then(function(w) {
return w.read({
selector: ".double"
}).should.eventually.eql("wow... | module.exports = ->
@When /^I shorthand double click an element$/, ->
@W.doubleClick({
selector: '.double'
}).then (w) -> w.read({selector: ".double"}).should.eventually.eql("wow such click")
@When /^I shorthand hover an element$/, ->
@W.hover({
selector: "h4"
}).then (w) ->
w.re... | JavaScript | CoffeeScript | mojotech/pioneer | test/integration/steps/shorthand.coffee | MIT | 6ffd127166647dca61f1a0ca3ae01f11678f766f | 523 | https://github.com/mojotech/pioneer/blob/6ffd127166647dca61f1a0ca3ae01f11678f766f/test/integration/steps/shorthand.coffee | 3 | 52 |
mojotech/pioneer:test/integration/steps/shorthand.coffee:1:completion | completion | module.exports = ->
@When /^I shorthand double click an element$/, ->
@W.doubleClick({
selector: '.double'
}).then (w) -> w.read({selector: ".double"}).should.eventually.eql("wow such click")
@When /^I shorthand hover an element$/, ->
@W.hover({
selector: "h4"
}).then (w) ->
w.re... | @When /^I shorthand isVisible an element$/, ->
@W.isVisible({
selector: ".wow"
}).should.eventually.eql(true)
@When /^I shorthand getAttribute an element$/, ->
@W.getAttribute({
attribute: "width",
selector: ".wow"
}).should.eventually.eql("400px")
@When /^I shorthand getValue th... | CoffeeScript | CoffeeScript | mojotech/pioneer | test/integration/steps/shorthand.coffee | MIT | 6ffd127166647dca61f1a0ca3ae01f11678f766f | 523 | https://github.com/mojotech/pioneer/blob/6ffd127166647dca61f1a0ca3ae01f11678f766f/test/integration/steps/shorthand.coffee | 3 | 52 |
abe33/atom-pigments:lib/paths-scanner.coffee:1:raw_corpus | raw_corpus | Task = null
module.exports =
startTask: (paths, registry, callback) ->
Task ?= require('atom').Task
results = []
taskPath = require.resolve('./tasks/scan-paths-handler')
@task = Task.once(
taskPath,
[paths, registry.serialize()],
=>
@task = null
callback(results)
... | CoffeeScript | abe33/atom-pigments | lib/paths-scanner.coffee | MIT | 4bdef2e1ebeaa492a6c353c2fd9e7adecdebadf4 | 518 | https://github.com/abe33/atom-pigments/blob/4bdef2e1ebeaa492a6c353c2fd9e7adecdebadf4/lib/paths-scanner.coffee | 1 | 24 | ||
abe33/atom-pigments:lib/paths-scanner.coffee:1:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
Task = null
module.exports =
startTask: (paths, registry, callback) ->
Task ?= require('atom').Task
results = []
taskPath = require.resolve('./tasks/scan-paths-handler')
@task = Task.once(
taskPath,
[paths, registry.serialize()],
... | var Task;
Task = null;
module.exports = {
startTask: function(paths, registry, callback) {
var results, taskPath;
if (Task == null) {
Task = require('atom').Task;
}
results = [];
taskPath = require.resolve('./tasks/scan-paths-handler');
this.task = Task.once(taskPath, [paths, registry.... | CoffeeScript | JavaScript | abe33/atom-pigments | lib/paths-scanner.coffee | MIT | 4bdef2e1ebeaa492a6c353c2fd9e7adecdebadf4 | 518 | https://github.com/abe33/atom-pigments/blob/4bdef2e1ebeaa492a6c353c2fd9e7adecdebadf4/lib/paths-scanner.coffee | 1 | 24 |
abe33/atom-pigments:lib/paths-scanner.coffee:1:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
var Task;
Task = null;
module.exports = {
startTask: function(paths, registry, callback) {
var results, taskPath;
if (Task == null) {
Task = require('atom').Task;
}
results = [];
taskPath = require.resolve('./tasks/scan-paths-handler')... | Task = null
module.exports =
startTask: (paths, registry, callback) ->
Task ?= require('atom').Task
results = []
taskPath = require.resolve('./tasks/scan-paths-handler')
@task = Task.once(
taskPath,
[paths, registry.serialize()],
=>
@task = null
callback(results)
... | JavaScript | CoffeeScript | abe33/atom-pigments | lib/paths-scanner.coffee | MIT | 4bdef2e1ebeaa492a6c353c2fd9e7adecdebadf4 | 518 | https://github.com/abe33/atom-pigments/blob/4bdef2e1ebeaa492a6c353c2fd9e7adecdebadf4/lib/paths-scanner.coffee | 1 | 24 |
abe33/atom-pigments:lib/paths-scanner.coffee:1:completion | completion | Task = null
module.exports =
startTask: (paths, registry, callback) ->
Task ?= require('atom').Task
results = []
taskPath = require.resolve('./tasks/scan-paths-handler')
@task = Task.once(
taskPath,
[paths, registry.serialize()], | =>
@task = null
callback(results)
)
@task.on 'scan-paths:path-scanned', (result) ->
results = results.concat(result)
@task
terminateRunningTask: ->
@task?.terminate() | CoffeeScript | CoffeeScript | abe33/atom-pigments | lib/paths-scanner.coffee | MIT | 4bdef2e1ebeaa492a6c353c2fd9e7adecdebadf4 | 518 | https://github.com/abe33/atom-pigments/blob/4bdef2e1ebeaa492a6c353c2fd9e7adecdebadf4/lib/paths-scanner.coffee | 1 | 24 |
abe33/atom-pigments:lib/paths-scanner.coffee:1:raw_corpus | raw_corpus | {Task} = require 'atom'
module.exports =
startTask: (paths, registry, callback) ->
results = []
taskPath = require.resolve('./tasks/scan-paths-handler')
@task = Task.once(
taskPath,
[paths, registry.serialize()],
=>
@task = null
callback(results)
)
@task.on 'sc... | CoffeeScript | abe33/atom-pigments | lib/paths-scanner.coffee | MIT | ff6d0f5a491eed88feb63cac42c973352448b000 | 518 | https://github.com/abe33/atom-pigments/blob/ff6d0f5a491eed88feb63cac42c973352448b000/lib/paths-scanner.coffee | 1 | 22 | ||
abe33/atom-pigments:lib/paths-scanner.coffee:1:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
{Task} = require 'atom'
module.exports =
startTask: (paths, registry, callback) ->
results = []
taskPath = require.resolve('./tasks/scan-paths-handler')
@task = Task.once(
taskPath,
[paths, registry.serialize()],
=>
@task... | var Task;
({Task} = require('atom'));
module.exports = {
startTask: function(paths, registry, callback) {
var results, taskPath;
results = [];
taskPath = require.resolve('./tasks/scan-paths-handler');
this.task = Task.once(taskPath, [paths, registry.serialize()], () => {
this.task = null;
... | CoffeeScript | JavaScript | abe33/atom-pigments | lib/paths-scanner.coffee | MIT | ff6d0f5a491eed88feb63cac42c973352448b000 | 518 | https://github.com/abe33/atom-pigments/blob/ff6d0f5a491eed88feb63cac42c973352448b000/lib/paths-scanner.coffee | 1 | 22 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.