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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
cdglabs/apparatus:src/Model/Element.coffee:1:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
module.exports = Element = Node.createVariant
constructor: ->
# Call "super" constructor
Node.constructor.apply(this, arguments)
# Because the expanded properly is not inherited, it is initialized in
# this constructor for every Element.
@e... | var Element;
module.exports = Element = Node.createVariant({
constructor: function() {
// Call "super" constructor
Node.constructor.apply(this, arguments);
// Because the expanded properly is not inherited, it is initialized in
// this constructor for every Element.
this.expanded = false;
// ... | CoffeeScript | JavaScript | cdglabs/apparatus | src/Model/Element.coffee | MIT | e6bd2b9859b5c223ed589131247a02487b570769 | 1,052 | https://github.com/cdglabs/apparatus/blob/e6bd2b9859b5c223ed589131247a02487b570769/src/Model/Element.coffee | 9 | 58 |
cdglabs/apparatus:src/Model/Element.coffee:1:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
var Element;
module.exports = Element = Node.createVariant({
constructor: function() {
// Call "super" constructor
Node.constructor.apply(this, arguments);
// Because the expanded properly is not inherited, it is initialized in
// this constructo... | module.exports = Element = Node.createVariant
constructor: ->
# Call "super" constructor
Node.constructor.apply(this, arguments)
# Because the expanded properly is not inherited, it is initialized in
# this constructor for every Element.
@expanded = false
# TODO: Should more methods be cell'... | JavaScript | CoffeeScript | cdglabs/apparatus | src/Model/Element.coffee | MIT | e6bd2b9859b5c223ed589131247a02487b570769 | 1,052 | https://github.com/cdglabs/apparatus/blob/e6bd2b9859b5c223ed589131247a02487b570769/src/Model/Element.coffee | 9 | 58 |
cdglabs/apparatus:src/Model/Element.coffee:1:completion | completion | module.exports = Element = Node.createVariant
constructor: ->
# Call "super" constructor
Node.constructor.apply(this, arguments)
# Because the expanded properly is not inherited, it is initialized in
# this constructor for every Element.
@expanded = false
# TODO: Should more methods be cell'... | attributesToChange: ->
# TODO: Deal with controlled attributes
return @defaultAttributesToChange()
defaultAttributesToChange: ->
result = []
for component in @components()
continue unless component.defaultAttributesToChange?
for attribute in component.defaultAttributesToChange()
i... | CoffeeScript | CoffeeScript | cdglabs/apparatus | src/Model/Element.coffee | MIT | e6bd2b9859b5c223ed589131247a02487b570769 | 1,052 | https://github.com/cdglabs/apparatus/blob/e6bd2b9859b5c223ed589131247a02487b570769/src/Model/Element.coffee | 9 | 58 |
cdglabs/apparatus:src/Model/Element.coffee:2:raw_corpus | raw_corpus | parent = @parent()
if parent and parent.isVariantOf(Element)
return parent.accumulatedMatrix()
else
return new Util.Matrix()
_accumulatedMatrix: ->
return @contextMatrix().compose(@matrix())
# ===========================================================================
# Graphic
# ====... | CoffeeScript | cdglabs/apparatus | src/Model/Element.coffee | MIT | e6bd2b9859b5c223ed589131247a02487b570769 | 1,052 | https://github.com/cdglabs/apparatus/blob/e6bd2b9859b5c223ed589131247a02487b570769/src/Model/Element.coffee | 59 | 95 | ||
cdglabs/apparatus:src/Model/Element.coffee:2:completion | completion | parent = @parent()
if parent and parent.isVariantOf(Element)
return parent.accumulatedMatrix()
else
return new Util.Matrix()
_accumulatedMatrix: ->
return @contextMatrix().compose(@matrix())
# ===========================================================================
# Graphic
# ====... | graphic.particularElement = new Model.ParticularElement(this, spreadEnv)
graphic.matrix = @accumulatedMatrix()
graphic.components = _.map @components(), (component) ->
component.graphic()
graphic.childGraphics = _.flatten(_.map(@childElements(), (element) ->
element.allGraphics()
))
... | CoffeeScript | CoffeeScript | cdglabs/apparatus | src/Model/Element.coffee | MIT | e6bd2b9859b5c223ed589131247a02487b570769 | 1,052 | https://github.com/cdglabs/apparatus/blob/e6bd2b9859b5c223ed589131247a02487b570769/src/Model/Element.coffee | 59 | 95 |
jianliaoim/talk-os:talk-web/test/spec/handlers/network.spec.coffee:1:raw_corpus | raw_corpus | Immutable = require 'immutable'
describe 'Handlers: network', ->
beforeEach ->
@networkHandler = require 'handlers/network'
@api = require 'network/api'
@recorder = require 'actions-recorder'
describe 'Method: newConnection', ->
it 'should subscribe to users', ->
spyOn(@api.users.subscribe, ... | CoffeeScript | jianliaoim/talk-os | talk-web/test/spec/handlers/network.spec.coffee | MIT | 2545c4497865779a55762e03963a39237df9046b | 2,703 | https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-web/test/spec/handlers/network.spec.coffee | 1 | 50 | ||
jianliaoim/talk-os:talk-web/test/spec/handlers/network.spec.coffee:1:completion | completion | Immutable = require 'immutable'
describe 'Handlers: network', ->
beforeEach ->
@networkHandler = require 'handlers/network'
@api = require 'network/api'
@recorder = require 'actions-recorder'
describe 'Method: newConnection', ->
it 'should subscribe to users', ->
spyOn(@api.users.subscribe, ... | spyOn(userActions, 'userMe')
spyOn(teamActions, 'teamsFetch')
spyOn(roomActions, 'fetch')
spyOn(messageActions, 'messageReadChat')
@networkHandler.longReconnection()
describe 'common', ->
beforeEach ->
init
router:
data:
_teamId: 'te... | CoffeeScript | CoffeeScript | jianliaoim/talk-os | talk-web/test/spec/handlers/network.spec.coffee | MIT | 2545c4497865779a55762e03963a39237df9046b | 2,703 | https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-web/test/spec/handlers/network.spec.coffee | 1 | 50 |
jianliaoim/talk-os:talk-web/test/spec/handlers/network.spec.coffee:2:raw_corpus | raw_corpus | _teamId: 'team id'
_roomId: 'room id'
it 'should get messages for current room', ->
expect(roomActions.fetch).toHaveBeenCalledWith store.router.data._roomId
expect(messageActions.messageReadChat).not.toHaveBeenCalled()
describe 'in chat', ->
beforeEach ->
init
... | CoffeeScript | jianliaoim/talk-os | talk-web/test/spec/handlers/network.spec.coffee | MIT | 2545c4497865779a55762e03963a39237df9046b | 2,703 | https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-web/test/spec/handlers/network.spec.coffee | 51 | 70 | ||
jianliaoim/talk-os:talk-web/test/spec/handlers/network.spec.coffee:2:completion | completion | _teamId: 'team id'
_roomId: 'room id'
it 'should get messages for current room', ->
expect(roomActions.fetch).toHaveBeenCalledWith store.router.data._roomId
expect(messageActions.messageReadChat).not.toHaveBeenCalled()
describe 'in chat', ->
beforeEach ->
init | router:
data:
_teamId: 'team id'
_toId: 'to id'
it 'should get messages for current chat', ->
_teamId = store.router.data._teamId
_toId = store.router.data._toId
expect(messageActions.messageReadChat).toHaveBeenCalledWith _teamId, _toId
expe... | CoffeeScript | CoffeeScript | jianliaoim/talk-os | talk-web/test/spec/handlers/network.spec.coffee | MIT | 2545c4497865779a55762e03963a39237df9046b | 2,703 | https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-web/test/spec/handlers/network.spec.coffee | 51 | 70 |
octoblu/meshblu:test/test-database.coffee:1:raw_corpus | raw_corpus | async = require 'async'
USE_MONGO = process.env.USE_MONGO == 'true'
console.log "================================================"
console.log " using #{if USE_MONGO then 'mongo' else 'nedb'}"
console.log "================================================"
if USE_MONGO
mongojs = require 'mongojs'
MONGO_DATABASE =... | CoffeeScript | octoblu/meshblu | test/test-database.coffee | MIT | 36b57b1fa09d5ac6efe5af5b72e850e6c2166e07 | 815 | https://github.com/octoblu/meshblu/blob/36b57b1fa09d5ac6efe5af5b72e850e6c2166e07/test/test-database.coffee | 1 | 33 | ||
octoblu/meshblu:test/test-database.coffee:1:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
async = require 'async'
USE_MONGO = process.env.USE_MONGO == 'true'
console.log "================================================"
console.log " using #{if USE_MONGO then 'mongo' else 'nedb'}"
console.log "================================================"
if U... | var MONGO_DATABASE, TestDatabase, USE_MONGO, async, mongojs;
async = require('async');
USE_MONGO = process.env.USE_MONGO === 'true';
console.log("================================================");
console.log(` using ${USE_MONGO ? 'mongo' : 'nedb'}`);
console.log("================================================... | CoffeeScript | JavaScript | octoblu/meshblu | test/test-database.coffee | MIT | 36b57b1fa09d5ac6efe5af5b72e850e6c2166e07 | 815 | https://github.com/octoblu/meshblu/blob/36b57b1fa09d5ac6efe5af5b72e850e6c2166e07/test/test-database.coffee | 1 | 33 |
octoblu/meshblu:test/test-database.coffee:1:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
var MONGO_DATABASE, TestDatabase, USE_MONGO, async, mongojs;
async = require('async');
USE_MONGO = process.env.USE_MONGO === 'true';
console.log("================================================");
console.log(` using ${USE_MONGO ? 'mongo' : 'nedb'}`);
consol... | async = require 'async'
USE_MONGO = process.env.USE_MONGO == 'true'
console.log "================================================"
console.log " using #{if USE_MONGO then 'mongo' else 'nedb'}"
console.log "================================================"
if USE_MONGO
mongojs = require 'mongojs'
MONGO_DATABASE =... | JavaScript | CoffeeScript | octoblu/meshblu | test/test-database.coffee | MIT | 36b57b1fa09d5ac6efe5af5b72e850e6c2166e07 | 815 | https://github.com/octoblu/meshblu/blob/36b57b1fa09d5ac6efe5af5b72e850e6c2166e07/test/test-database.coffee | 1 | 33 |
octoblu/meshblu:test/test-database.coffee:1:completion | completion | async = require 'async'
USE_MONGO = process.env.USE_MONGO == 'true'
console.log "================================================"
console.log " using #{if USE_MONGO then 'mongo' else 'nedb'}"
console.log "================================================"
if USE_MONGO
mongojs = require 'mongojs'
MONGO_DATABASE =... | autoload: true
onload: => callback null, datastore
@open: (callback=->) =>
if USE_MONGO
async.parallel [
(next) => MONGO_DATABASE.devices.remove next # REAL MONGO DOESN'T BIND ITS FUNCTIONS, NO async.apply
(next) => MONGO_DATABASE.subscriptions.remove next
], (error) =>
... | CoffeeScript | CoffeeScript | octoblu/meshblu | test/test-database.coffee | MIT | 36b57b1fa09d5ac6efe5af5b72e850e6c2166e07 | 815 | https://github.com/octoblu/meshblu/blob/36b57b1fa09d5ac6efe5af5b72e850e6c2166e07/test/test-database.coffee | 1 | 33 |
octoblu/meshblu:test/test-database.coffee:1:raw_corpus | raw_corpus | async = require 'async'
USE_MONGO = process.env.USE_MONGO == 'true'
console.log "================================================"
console.log " using #{if USE_MONGO then 'mongo' else 'nedb'}"
console.log "================================================"
if USE_MONGO
mongojs = require 'mongojs'
MONGO_DATABASE =... | CoffeeScript | octoblu/meshblu | test/test-database.coffee | MIT | 6934fed7ad8859101f0073d865cc2f820dcc608f | 815 | https://github.com/octoblu/meshblu/blob/6934fed7ad8859101f0073d865cc2f820dcc608f/test/test-database.coffee | 1 | 33 | ||
octoblu/meshblu:test/test-database.coffee:1:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
async = require 'async'
USE_MONGO = process.env.USE_MONGO == 'true'
console.log "================================================"
console.log " using #{if USE_MONGO then 'mongo' else 'nedb'}"
console.log "================================================"
if U... | var MONGO_DATABASE, TestDatabase, USE_MONGO, async, mongojs;
async = require('async');
USE_MONGO = process.env.USE_MONGO === 'true';
console.log("================================================");
console.log(` using ${USE_MONGO ? 'mongo' : 'nedb'}`);
console.log("================================================... | CoffeeScript | JavaScript | octoblu/meshblu | test/test-database.coffee | MIT | 6934fed7ad8859101f0073d865cc2f820dcc608f | 815 | https://github.com/octoblu/meshblu/blob/6934fed7ad8859101f0073d865cc2f820dcc608f/test/test-database.coffee | 1 | 33 |
octoblu/meshblu:test/test-database.coffee:1:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
var MONGO_DATABASE, TestDatabase, USE_MONGO, async, mongojs;
async = require('async');
USE_MONGO = process.env.USE_MONGO === 'true';
console.log("================================================");
console.log(` using ${USE_MONGO ? 'mongo' : 'nedb'}`);
consol... | async = require 'async'
USE_MONGO = process.env.USE_MONGO == 'true'
console.log "================================================"
console.log " using #{if USE_MONGO then 'mongo' else 'nedb'}"
console.log "================================================"
if USE_MONGO
mongojs = require 'mongojs'
MONGO_DATABASE =... | JavaScript | CoffeeScript | octoblu/meshblu | test/test-database.coffee | MIT | 6934fed7ad8859101f0073d865cc2f820dcc608f | 815 | https://github.com/octoblu/meshblu/blob/6934fed7ad8859101f0073d865cc2f820dcc608f/test/test-database.coffee | 1 | 33 |
octoblu/meshblu:test/test-database.coffee:1:completion | completion | async = require 'async'
USE_MONGO = process.env.USE_MONGO == 'true'
console.log "================================================"
console.log " using #{if USE_MONGO then 'mongo' else 'nedb'}"
console.log "================================================"
if USE_MONGO
mongojs = require 'mongojs'
MONGO_DATABASE =... | autoload: true
onload: => callback null, datastore
@open: (callback=->) =>
if USE_MONGO
async.parallel [
async.apply MONGO_DATABASE.devices.remove
async.apply MONGO_DATABASE.subscriptions.remove
], (error) =>
callback error, MONGO_DATABASE
else
async.parallel
... | CoffeeScript | CoffeeScript | octoblu/meshblu | test/test-database.coffee | MIT | 6934fed7ad8859101f0073d865cc2f820dcc608f | 815 | https://github.com/octoblu/meshblu/blob/6934fed7ad8859101f0073d865cc2f820dcc608f/test/test-database.coffee | 1 | 33 |
octoblu/meshblu:test/test-database.coffee:1:raw_corpus | raw_corpus | async = require 'async'
USE_MONGO = process.env.USE_MONGO == 'true'
console.log "================================================"
console.log " using #{if USE_MONGO then 'mongo' else 'nedb'}"
console.log "================================================"
if USE_MONGO
mongojs = require 'mongojs'
MONGO_DATABASE =... | CoffeeScript | octoblu/meshblu | test/test-database.coffee | MIT | 66ed8dd9827f4cc75c600b7777d2625459b3b095 | 815 | https://github.com/octoblu/meshblu/blob/66ed8dd9827f4cc75c600b7777d2625459b3b095/test/test-database.coffee | 1 | 32 | ||
octoblu/meshblu:test/test-database.coffee:1:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
async = require 'async'
USE_MONGO = process.env.USE_MONGO == 'true'
console.log "================================================"
console.log " using #{if USE_MONGO then 'mongo' else 'nedb'}"
console.log "================================================"
if U... | var MONGO_DATABASE, TestDatabase, USE_MONGO, async, mongojs;
async = require('async');
USE_MONGO = process.env.USE_MONGO === 'true';
console.log("================================================");
console.log(` using ${USE_MONGO ? 'mongo' : 'nedb'}`);
console.log("================================================... | CoffeeScript | JavaScript | octoblu/meshblu | test/test-database.coffee | MIT | 66ed8dd9827f4cc75c600b7777d2625459b3b095 | 815 | https://github.com/octoblu/meshblu/blob/66ed8dd9827f4cc75c600b7777d2625459b3b095/test/test-database.coffee | 1 | 32 |
octoblu/meshblu:test/test-database.coffee:1:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
var MONGO_DATABASE, TestDatabase, USE_MONGO, async, mongojs;
async = require('async');
USE_MONGO = process.env.USE_MONGO === 'true';
console.log("================================================");
console.log(` using ${USE_MONGO ? 'mongo' : 'nedb'}`);
consol... | async = require 'async'
USE_MONGO = process.env.USE_MONGO == 'true'
console.log "================================================"
console.log " using #{if USE_MONGO then 'mongo' else 'nedb'}"
console.log "================================================"
if USE_MONGO
mongojs = require 'mongojs'
MONGO_DATABASE =... | JavaScript | CoffeeScript | octoblu/meshblu | test/test-database.coffee | MIT | 66ed8dd9827f4cc75c600b7777d2625459b3b095 | 815 | https://github.com/octoblu/meshblu/blob/66ed8dd9827f4cc75c600b7777d2625459b3b095/test/test-database.coffee | 1 | 32 |
octoblu/meshblu:test/test-database.coffee:1:completion | completion | async = require 'async'
USE_MONGO = process.env.USE_MONGO == 'true'
console.log "================================================"
console.log " using #{if USE_MONGO then 'mongo' else 'nedb'}"
console.log "================================================"
if USE_MONGO
mongojs = require 'mongojs'
MONGO_DATABASE =... | autoload: true
onload: => callback null, datastore
@open: (callback=->) =>
if USE_MONGO
async.parallel [
(cb=->) => MONGO_DATABASE.devices.remove cb
(cb=->) => MONGO_DATABASE.subscriptions.remove cb
], (error) => callback error, MONGO_DATABASE
else
async.parallel
... | CoffeeScript | CoffeeScript | octoblu/meshblu | test/test-database.coffee | MIT | 66ed8dd9827f4cc75c600b7777d2625459b3b095 | 815 | https://github.com/octoblu/meshblu/blob/66ed8dd9827f4cc75c600b7777d2625459b3b095/test/test-database.coffee | 1 | 32 |
octoblu/meshblu:test/test-database.coffee:1:raw_corpus | raw_corpus | async = require 'async'
USE_MONGO = process.env.USE_MONGO == 'true'
console.log "================================================"
console.log " using #{if USE_MONGO then 'mongo' else 'nedb'}"
console.log "================================================"
if USE_MONGO
mongojs = require '@octoblu/mongojs'
MONGO_D... | CoffeeScript | octoblu/meshblu | test/test-database.coffee | MIT | 6c62e56b3e6529d4e2796c57951968941900a50b | 815 | https://github.com/octoblu/meshblu/blob/6c62e56b3e6529d4e2796c57951968941900a50b/test/test-database.coffee | 1 | 32 | ||
octoblu/meshblu:test/test-database.coffee:1:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
async = require 'async'
USE_MONGO = process.env.USE_MONGO == 'true'
console.log "================================================"
console.log " using #{if USE_MONGO then 'mongo' else 'nedb'}"
console.log "================================================"
if U... | var MONGO_DATABASE, TestDatabase, USE_MONGO, async, mongojs;
async = require('async');
USE_MONGO = process.env.USE_MONGO === 'true';
console.log("================================================");
console.log(` using ${USE_MONGO ? 'mongo' : 'nedb'}`);
console.log("================================================... | CoffeeScript | JavaScript | octoblu/meshblu | test/test-database.coffee | MIT | 6c62e56b3e6529d4e2796c57951968941900a50b | 815 | https://github.com/octoblu/meshblu/blob/6c62e56b3e6529d4e2796c57951968941900a50b/test/test-database.coffee | 1 | 32 |
octoblu/meshblu:test/test-database.coffee:1:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
var MONGO_DATABASE, TestDatabase, USE_MONGO, async, mongojs;
async = require('async');
USE_MONGO = process.env.USE_MONGO === 'true';
console.log("================================================");
console.log(` using ${USE_MONGO ? 'mongo' : 'nedb'}`);
consol... | async = require 'async'
USE_MONGO = process.env.USE_MONGO == 'true'
console.log "================================================"
console.log " using #{if USE_MONGO then 'mongo' else 'nedb'}"
console.log "================================================"
if USE_MONGO
mongojs = require '@octoblu/mongojs'
MONGO_D... | JavaScript | CoffeeScript | octoblu/meshblu | test/test-database.coffee | MIT | 6c62e56b3e6529d4e2796c57951968941900a50b | 815 | https://github.com/octoblu/meshblu/blob/6c62e56b3e6529d4e2796c57951968941900a50b/test/test-database.coffee | 1 | 32 |
octoblu/meshblu:test/test-database.coffee:1:completion | completion | async = require 'async'
USE_MONGO = process.env.USE_MONGO == 'true'
console.log "================================================"
console.log " using #{if USE_MONGO then 'mongo' else 'nedb'}"
console.log "================================================"
if USE_MONGO
mongojs = require '@octoblu/mongojs'
MONGO_D... | autoload: true
onload: => callback null, datastore
@open: (callback=->) =>
if USE_MONGO
async.parallel [
(cb=->) => MONGO_DATABASE.devices.remove cb
(cb=->) => MONGO_DATABASE.subscriptions.remove cb
], (error) => callback error, MONGO_DATABASE
else
async.parallel
... | CoffeeScript | CoffeeScript | octoblu/meshblu | test/test-database.coffee | MIT | 6c62e56b3e6529d4e2796c57951968941900a50b | 815 | https://github.com/octoblu/meshblu/blob/6c62e56b3e6529d4e2796c57951968941900a50b/test/test-database.coffee | 1 | 32 |
jianliaoim/talk-os:talk-web/client/app/filter-contact.coffee:1:raw_corpus | raw_corpus | module.exports = React.createClass
displayName: 'filter-contact'
mixins: [PureRenderMixin, mixinQuery]
propTypes:
_teamId: T.string.isRequired
_creatorId: T.string
onChange: T.func.isRequired
componentDidMount: ->
# bad idea to send actions in lifecycle
contactActions.fetchLeftContacts @p... | CoffeeScript | jianliaoim/talk-os | talk-web/client/app/filter-contact.coffee | MIT | 2545c4497865779a55762e03963a39237df9046b | 2,703 | https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-web/client/app/filter-contact.coffee | 27 | 76 | ||
jianliaoim/talk-os:talk-web/client/app/filter-contact.coffee:1:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
module.exports = React.createClass
displayName: 'filter-contact'
mixins: [PureRenderMixin, mixinQuery]
propTypes:
_teamId: T.string.isRequired
_creatorId: T.string
onChange: T.func.isRequired
componentDidMount: ->
# bad idea to send act... | module.exports = React.createClass({
displayName: 'filter-contact',
mixins: [PureRenderMixin, mixinQuery],
propTypes: {
_teamId: T.string.isRequired,
_creatorId: T.string,
onChange: T.func.isRequired
},
componentDidMount: function() {
// bad idea to send actions in lifecycle
contactActions... | CoffeeScript | JavaScript | jianliaoim/talk-os | talk-web/client/app/filter-contact.coffee | MIT | 2545c4497865779a55762e03963a39237df9046b | 2,703 | https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-web/client/app/filter-contact.coffee | 27 | 76 |
jianliaoim/talk-os:talk-web/client/app/filter-contact.coffee:1:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
module.exports = React.createClass({
displayName: 'filter-contact',
mixins: [PureRenderMixin, mixinQuery],
propTypes: {
_teamId: T.string.isRequired,
_creatorId: T.string,
onChange: T.func.isRequired
},
componentDidMount: function() {
// b... | module.exports = React.createClass
displayName: 'filter-contact'
mixins: [PureRenderMixin, mixinQuery]
propTypes:
_teamId: T.string.isRequired
_creatorId: T.string
onChange: T.func.isRequired
componentDidMount: ->
# bad idea to send actions in lifecycle
contactActions.fetchLeftContacts @p... | JavaScript | CoffeeScript | jianliaoim/talk-os | talk-web/client/app/filter-contact.coffee | MIT | 2545c4497865779a55762e03963a39237df9046b | 2,703 | https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-web/client/app/filter-contact.coffee | 27 | 76 |
jianliaoim/talk-os:talk-web/client/app/filter-contact.coffee:1:completion | completion | module.exports = React.createClass
displayName: 'filter-contact'
mixins: [PureRenderMixin, mixinQuery]
propTypes:
_teamId: T.string.isRequired
_creatorId: T.string
onChange: T.func.isRequired
componentDidMount: ->
# bad idea to send actions in lifecycle
contactActions.fetchLeftContacts @p... | getDefaultIndex: ->
if @props._creatorId
(@getSortedContacts().findIndex (contact) => contact.get('_id') is @props._creatorId) + 1
else
0
getSortedContacts: ->
currentContacts = query.orList(query.contactsBy recorder.getState(), @props._teamId)
leftContacts = query.orList(query.leftContac... | CoffeeScript | CoffeeScript | jianliaoim/talk-os | talk-web/client/app/filter-contact.coffee | MIT | 2545c4497865779a55762e03963a39237df9046b | 2,703 | https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-web/client/app/filter-contact.coffee | 27 | 76 |
jianliaoim/talk-os:talk-web/client/app/filter-contact.coffee:2:raw_corpus | raw_corpus | handleScroll: ->
unless @refs.scroll?
return
each = 40
scrollEl = @refs.scroll
totalHeight = scrollEl.clientHeight
top = scrollEl.scrollTop
if @state.query.length > 0
current = @state.index
else
current = @state.index + 1
startY = current * each
if (startY - top ... | CoffeeScript | jianliaoim/talk-os | talk-web/client/app/filter-contact.coffee | MIT | 2545c4497865779a55762e03963a39237df9046b | 2,703 | https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-web/client/app/filter-contact.coffee | 77 | 126 | ||
jianliaoim/talk-os:talk-web/client/app/filter-contact.coffee:2:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
handleScroll: ->
unless @refs.scroll?
return
each = 40
scrollEl = @refs.scroll
totalHeight = scrollEl.clientHeight
top = scrollEl.scrollTop
if @state.query.length > 0
current = @state.index
else
current = @state.inde... | ({
handleScroll: function() {
var current, each, scrollEl, startY, top, totalHeight, y;
if (this.refs.scroll == null) {
return;
}
each = 40;
scrollEl = this.refs.scroll;
totalHeight = scrollEl.clientHeight;
top = scrollEl.scrollTop;
if (this.state.query.length > 0) {
curren... | CoffeeScript | JavaScript | jianliaoim/talk-os | talk-web/client/app/filter-contact.coffee | MIT | 2545c4497865779a55762e03963a39237df9046b | 2,703 | https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-web/client/app/filter-contact.coffee | 77 | 126 |
jianliaoim/talk-os:talk-web/client/app/filter-contact.coffee:2:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
({
handleScroll: function() {
var current, each, scrollEl, startY, top, totalHeight, y;
if (this.refs.scroll == null) {
return;
}
each = 40;
scrollEl = this.refs.scroll;
totalHeight = scrollEl.clientHeight;
top = scrollEl.scrollT... | handleScroll: ->
unless @refs.scroll?
return
each = 40
scrollEl = @refs.scroll
totalHeight = scrollEl.clientHeight
top = scrollEl.scrollTop
if @state.query.length > 0
current = @state.index
else
current = @state.index + 1
startY = current * each
if (startY - top ... | JavaScript | CoffeeScript | jianliaoim/talk-os | talk-web/client/app/filter-contact.coffee | MIT | 2545c4497865779a55762e03963a39237df9046b | 2,703 | https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-web/client/app/filter-contact.coffee | 77 | 126 |
jianliaoim/talk-os:talk-web/client/app/filter-contact.coffee:2:completion | completion | handleScroll: ->
unless @refs.scroll?
return
each = 40
scrollEl = @refs.scroll
totalHeight = scrollEl.clientHeight
top = scrollEl.scrollTop
if @state.query.length > 0
current = @state.index
else
current = @state.index + 1
startY = current * each
if (startY - top ... | moveDown: ->
if (@state.index + 1) >= @getListLength()
@setState index: 0
else
@setState index: @state.index + 1
selectCurrent: ->
contacts = @getSortedContacts()
if (@state.query.length is 0)
if @state.index is 0
@props.onChange undefined
else
current = @state... | CoffeeScript | CoffeeScript | jianliaoim/talk-os | talk-web/client/app/filter-contact.coffee | MIT | 2545c4497865779a55762e03963a39237df9046b | 2,703 | https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-web/client/app/filter-contact.coffee | 77 | 126 |
jianliaoim/talk-os:talk-web/client/app/filter-contact.coffee:3:raw_corpus | raw_corpus | @setState query: event.target.value.trim(), index: 0
onInputClick: (event) ->
event.stopPropagation()
onItemClick: (contact, index) ->
@props.onChange contact.get('_id')
if @state.query.length > 0
@setState index: index
else
@setState index: index + 1
onAllClick: ->
@props.onCha... | CoffeeScript | jianliaoim/talk-os | talk-web/client/app/filter-contact.coffee | MIT | 2545c4497865779a55762e03963a39237df9046b | 2,703 | https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-web/client/app/filter-contact.coffee | 127 | 176 | ||
jianliaoim/talk-os:talk-web/client/app/filter-contact.coffee:3:completion | completion | @setState query: event.target.value.trim(), index: 0
onInputClick: (event) ->
event.stopPropagation()
onItemClick: (contact, index) ->
@props.onChange contact.get('_id')
if @state.query.length > 0
@setState index: index
else
@setState index: index + 1
onAllClick: ->
@props.onCha... | index: index
showMenu: not @state.showMenu
# render views
renderContacts: ->
contacts = @getSortedContacts()
if @state.query.length > 0
current = @state.index
else
current = @state.index - 1
contacts.map (contact, index) =>
isQuit = if contact.get('isQuit') then "(#{lang.ge... | CoffeeScript | CoffeeScript | jianliaoim/talk-os | talk-web/client/app/filter-contact.coffee | MIT | 2545c4497865779a55762e03963a39237df9046b | 2,703 | https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-web/client/app/filter-contact.coffee | 127 | 176 |
jianliaoim/talk-os:talk-web/client/app/filter-contact.coffee:4:raw_corpus | raw_corpus | displayText: contact?.get('name') or undefined
defaultText: lang.getText('all-members')
name: 'filter-contact'
show: @state.showMenu
onToggle: @onMenuToggle
input
className: 'query', value: @state.query, autoFocus: true, type: 'text'
onChange: @onQueryChange, onClick: @onIn... | CoffeeScript | jianliaoim/talk-os | talk-web/client/app/filter-contact.coffee | MIT | 2545c4497865779a55762e03963a39237df9046b | 2,703 | https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-web/client/app/filter-contact.coffee | 177 | 189 | ||
jianliaoim/talk-os:talk-web/client/app/filter-contact.coffee:4:completion | completion | displayText: contact?.get('name') or undefined
defaultText: lang.getText('all-members')
name: 'filter-contact'
show: @state.showMenu
onToggle: @onMenuToggle
input | className: 'query', value: @state.query, autoFocus: true, type: 'text'
onChange: @onQueryChange, onClick: @onInputClick, onKeyDown: @onKeyDown
div ref: 'scroll', className: 'scroll thin-scroll',
if @state.query.length is 0
className = classnames 'item', 'is-active': @state.index is 0
... | CoffeeScript | CoffeeScript | jianliaoim/talk-os | talk-web/client/app/filter-contact.coffee | MIT | 2545c4497865779a55762e03963a39237df9046b | 2,703 | https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-web/client/app/filter-contact.coffee | 177 | 189 |
jianliaoim/talk-os:talk-web/client/guest/actions.coffee:1:raw_corpus | raw_corpus | TALK = require '../config'
dispatcher = require '../dispatcher'
NotifyActions = require '../actions/notify'
reqwest = require 'reqwest'
exports.userCreate = (name, email, avatarUrl, success, error) ->
data = {name, avatarUrl}
if email then data.email = email
reqwest
url: "#{TALK.apiHost}/users/"
method: ... | CoffeeScript | jianliaoim/talk-os | talk-web/client/guest/actions.coffee | MIT | 2545c4497865779a55762e03963a39237df9046b | 2,703 | https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-web/client/guest/actions.coffee | 1 | 50 | ||
jianliaoim/talk-os:talk-web/client/guest/actions.coffee:1:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
TALK = require '../config'
dispatcher = require '../dispatcher'
NotifyActions = require '../actions/notify'
reqwest = require 'reqwest'
exports.userCreate = (name, email, avatarUrl, success, error) ->
data = {name, avatarUrl}
if email then data.email = email... | var NotifyActions, TALK, dispatcher, reqwest;
TALK = require('../config');
dispatcher = require('../dispatcher');
NotifyActions = require('../actions/notify');
reqwest = require('reqwest');
exports.userCreate = function(name, email, avatarUrl, success, error) {
var data;
data = {name, avatarUrl};
if (email) ... | CoffeeScript | JavaScript | jianliaoim/talk-os | talk-web/client/guest/actions.coffee | MIT | 2545c4497865779a55762e03963a39237df9046b | 2,703 | https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-web/client/guest/actions.coffee | 1 | 50 |
jianliaoim/talk-os:talk-web/client/guest/actions.coffee:1:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
var NotifyActions, TALK, dispatcher, reqwest;
TALK = require('../config');
dispatcher = require('../dispatcher');
NotifyActions = require('../actions/notify');
reqwest = require('reqwest');
exports.userCreate = function(name, email, avatarUrl, success, error) ... | TALK = require '../config'
dispatcher = require '../dispatcher'
NotifyActions = require '../actions/notify'
reqwest = require 'reqwest'
exports.userCreate = (name, email, avatarUrl, success, error) ->
data = {name, avatarUrl}
if email then data.email = email
reqwest
url: "#{TALK.apiHost}/users/"
method: ... | JavaScript | CoffeeScript | jianliaoim/talk-os | talk-web/client/guest/actions.coffee | MIT | 2545c4497865779a55762e03963a39237df9046b | 2,703 | https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-web/client/guest/actions.coffee | 1 | 50 |
jianliaoim/talk-os:talk-web/client/guest/actions.coffee:1:completion | completion | TALK = require '../config'
dispatcher = require '../dispatcher'
NotifyActions = require '../actions/notify'
reqwest = require 'reqwest'
exports.userCreate = (name, email, avatarUrl, success, error) ->
data = {name, avatarUrl}
if email then data.email = email
reqwest
url: "#{TALK.apiHost}/users/"
method: ... | url: "#{TALK.apiHost}/rooms/#{guestToken}"
method: 'GET'
headers:
'X-Socket-Id': TALK['X-Socket-Id']
success: (resp) ->
dispatcher.handleViewAction type: 'guest-topic/fetch', data: resp
success? resp
error: error
exports.roomJoin = (guestToken, success, error) ->
reqwest
url: "#... | CoffeeScript | CoffeeScript | jianliaoim/talk-os | talk-web/client/guest/actions.coffee | MIT | 2545c4497865779a55762e03963a39237df9046b | 2,703 | https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-web/client/guest/actions.coffee | 1 | 50 |
Pagedraw/pagedraw:deploy-checks/deserialize-check.coffee:1:raw_corpus | raw_corpus | require('../coffeescript-register-web')
require('../src/load_compiler')
ProgressBar = require 'progress'
_l = require 'lodash'
request = require 'request'
url = require 'url'
{assert, throttled_map} = require '../src/util'
jsondiffpatch = require 'jsondiffpatch'
{Doc} = require '../src/doc'
server = require '../src/e... | CoffeeScript | Pagedraw/pagedraw | deploy-checks/deserialize-check.coffee | MIT | aba1bd1b8ef6bb7f58866a9d11ebb7f1e0e18a8e | 3,558 | https://github.com/Pagedraw/pagedraw/blob/aba1bd1b8ef6bb7f58866a9d11ebb7f1e0e18a8e/deploy-checks/deserialize-check.coffee | 1 | 40 | ||
Pagedraw/pagedraw:deploy-checks/deserialize-check.coffee:1:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
require('../coffeescript-register-web')
require('../src/load_compiler')
ProgressBar = require 'progress'
_l = require 'lodash'
request = require 'request'
url = require 'url'
{assert, throttled_map} = require '../src/util'
jsondiffpatch = require 'jsondiffpatch'... | var Doc, ProgressBar, _l, assert, fetch_docs, jsondiffpatch, pagedraw_api_client, request, server, throttled_map, url;
require('../coffeescript-register-web');
require('../src/load_compiler');
ProgressBar = require('progress');
_l = require('lodash');
request = require('request');
url = require('url');
({assert,... | CoffeeScript | JavaScript | Pagedraw/pagedraw | deploy-checks/deserialize-check.coffee | MIT | aba1bd1b8ef6bb7f58866a9d11ebb7f1e0e18a8e | 3,558 | https://github.com/Pagedraw/pagedraw/blob/aba1bd1b8ef6bb7f58866a9d11ebb7f1e0e18a8e/deploy-checks/deserialize-check.coffee | 1 | 40 |
Pagedraw/pagedraw:deploy-checks/deserialize-check.coffee:1:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
var Doc, ProgressBar, _l, assert, fetch_docs, jsondiffpatch, pagedraw_api_client, request, server, throttled_map, url;
require('../coffeescript-register-web');
require('../src/load_compiler');
ProgressBar = require('progress');
_l = require('lodash');
request ... | require('../coffeescript-register-web')
require('../src/load_compiler')
ProgressBar = require 'progress'
_l = require 'lodash'
request = require 'request'
url = require 'url'
{assert, throttled_map} = require '../src/util'
jsondiffpatch = require 'jsondiffpatch'
{Doc} = require '../src/doc'
server = require '../src/e... | JavaScript | CoffeeScript | Pagedraw/pagedraw | deploy-checks/deserialize-check.coffee | MIT | aba1bd1b8ef6bb7f58866a9d11ebb7f1e0e18a8e | 3,558 | https://github.com/Pagedraw/pagedraw/blob/aba1bd1b8ef6bb7f58866a9d11ebb7f1e0e18a8e/deploy-checks/deserialize-check.coffee | 1 | 40 |
Pagedraw/pagedraw:deploy-checks/deserialize-check.coffee:1:completion | completion | require('../coffeescript-register-web')
require('../src/load_compiler')
ProgressBar = require 'progress'
_l = require 'lodash'
request = require 'request'
url = require 'url'
{assert, throttled_map} = require '../src/util'
jsondiffpatch = require 'jsondiffpatch'
{Doc} = require '../src/doc'
server = require '../src/e... | console.log "Deserialize checking #{docs.length} docs"
bar = new ProgressBar('[:bar] :rate docs/sec :percent done :etas remain', {
total: docs.length
width: 50
})
throttled_map(50, docs, ({docserver_id, doc_id}) -> new Promise (accept, reject) ->
docRef = pagedraw_api_client.getDocR... | CoffeeScript | CoffeeScript | Pagedraw/pagedraw | deploy-checks/deserialize-check.coffee | MIT | aba1bd1b8ef6bb7f58866a9d11ebb7f1e0e18a8e | 3,558 | https://github.com/Pagedraw/pagedraw/blob/aba1bd1b8ef6bb7f58866a9d11ebb7f1e0e18a8e/deploy-checks/deserialize-check.coffee | 1 | 40 |
littlebee/git-time-machine:spec/git-time-machine-spec.coffee:1:raw_corpus | raw_corpus | GitTimeMachine = require '../lib/git-time-machine'
# Use the command `window:run-package-specs` (cmd-alt-ctrl-p) to run specs.
#
# To run a specific `it` or `describe` block add an `f` to the front (e.g. `fit`
# or `fdescribe`). Remove the `f` to unfocus the block.
describe "GitTimeMachine", ->
[workspaceElement, a... | CoffeeScript | littlebee/git-time-machine | spec/git-time-machine-spec.coffee | MIT | 2b2a9b6ccc55dda0429a45aae913d1a0f6666439 | 1,111 | https://github.com/littlebee/git-time-machine/blob/2b2a9b6ccc55dda0429a45aae913d1a0f6666439/spec/git-time-machine-spec.coffee | 1 | 50 | ||
littlebee/git-time-machine:spec/git-time-machine-spec.coffee:1:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
GitTimeMachine = require '../lib/git-time-machine'
# Use the command `window:run-package-specs` (cmd-alt-ctrl-p) to run specs.
#
# To run a specific `it` or `describe` block add an `f` to the front (e.g. `fit`
# or `fdescribe`). Remove the `f` to unfocus the blo... | var GitTimeMachine;
GitTimeMachine = require('../lib/git-time-machine');
// Use the command `window:run-package-specs` (cmd-alt-ctrl-p) to run specs.
// To run a specific `it` or `describe` block add an `f` to the front (e.g. `fit`
// or `fdescribe`). Remove the `f` to unfocus the block.
describe("GitTimeMachine", f... | CoffeeScript | JavaScript | littlebee/git-time-machine | spec/git-time-machine-spec.coffee | MIT | 2b2a9b6ccc55dda0429a45aae913d1a0f6666439 | 1,111 | https://github.com/littlebee/git-time-machine/blob/2b2a9b6ccc55dda0429a45aae913d1a0f6666439/spec/git-time-machine-spec.coffee | 1 | 50 |
littlebee/git-time-machine:spec/git-time-machine-spec.coffee:1:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
var GitTimeMachine;
GitTimeMachine = require('../lib/git-time-machine');
// Use the command `window:run-package-specs` (cmd-alt-ctrl-p) to run specs.
// To run a specific `it` or `describe` block add an `f` to the front (e.g. `fit`
// or `fdescribe`). Remove the... | GitTimeMachine = require '../lib/git-time-machine'
# Use the command `window:run-package-specs` (cmd-alt-ctrl-p) to run specs.
#
# To run a specific `it` or `describe` block add an `f` to the front (e.g. `fit`
# or `fdescribe`). Remove the `f` to unfocus the block.
describe "GitTimeMachine", ->
[workspaceElement, a... | JavaScript | CoffeeScript | littlebee/git-time-machine | spec/git-time-machine-spec.coffee | MIT | 2b2a9b6ccc55dda0429a45aae913d1a0f6666439 | 1,111 | https://github.com/littlebee/git-time-machine/blob/2b2a9b6ccc55dda0429a45aae913d1a0f6666439/spec/git-time-machine-spec.coffee | 1 | 50 |
littlebee/git-time-machine:spec/git-time-machine-spec.coffee:1:completion | completion | GitTimeMachine = require '../lib/git-time-machine'
# Use the command `window:run-package-specs` (cmd-alt-ctrl-p) to run specs.
#
# To run a specific `it` or `describe` block add an `f` to the front (e.g. `fit`
# or `fdescribe`). Remove the `f` to unfocus the block.
describe "GitTimeMachine", ->
[workspaceElement, a... | activationPromise
runs ->
expect(workspaceElement.querySelector('.git-time-machine')).toExist()
gitTimeMachineElement = workspaceElement.querySelector('.git-time-machine')
expect(gitTimeMachineElement).toExist()
gitTimeMachinePanel = atom.workspace.panelForItem(gitTimeMachineEle... | CoffeeScript | CoffeeScript | littlebee/git-time-machine | spec/git-time-machine-spec.coffee | MIT | 2b2a9b6ccc55dda0429a45aae913d1a0f6666439 | 1,111 | https://github.com/littlebee/git-time-machine/blob/2b2a9b6ccc55dda0429a45aae913d1a0f6666439/spec/git-time-machine-spec.coffee | 1 | 50 |
littlebee/git-time-machine:spec/git-time-machine-spec.coffee:2:raw_corpus | raw_corpus | # activated.
atom.commands.dispatch workspaceElement, 'git-time-machine:toggle'
waitsForPromise ->
activationPromise
runs ->
# Now we can test for view visibility
gitTimeMachineElement = workspaceElement.querySelector('.git-time-machine')
expect(gitTimeMachineElement)... | CoffeeScript | littlebee/git-time-machine | spec/git-time-machine-spec.coffee | MIT | 2b2a9b6ccc55dda0429a45aae913d1a0f6666439 | 1,111 | https://github.com/littlebee/git-time-machine/blob/2b2a9b6ccc55dda0429a45aae913d1a0f6666439/spec/git-time-machine-spec.coffee | 51 | 62 | ||
littlebee/git-time-machine:spec/git-time-machine-spec.coffee:2:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
# activated.
atom.commands.dispatch workspaceElement, 'git-time-machine:toggle'
waitsForPromise ->
activationPromise
runs ->
# Now we can test for view visibility
gitTimeMachineElement = workspaceElement.querySelector('... | // activated.
atom.commands.dispatch(workspaceElement, 'git-time-machine:toggle');
waitsForPromise(function() {
return activationPromise;
});
runs(function() {
var gitTimeMachineElement;
// Now we can test for view visibility
gitTimeMachineElement = workspaceElement.querySelector('.git-time-machine');
expec... | CoffeeScript | JavaScript | littlebee/git-time-machine | spec/git-time-machine-spec.coffee | MIT | 2b2a9b6ccc55dda0429a45aae913d1a0f6666439 | 1,111 | https://github.com/littlebee/git-time-machine/blob/2b2a9b6ccc55dda0429a45aae913d1a0f6666439/spec/git-time-machine-spec.coffee | 51 | 62 |
littlebee/git-time-machine:spec/git-time-machine-spec.coffee:2:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
// activated.
atom.commands.dispatch(workspaceElement, 'git-time-machine:toggle');
waitsForPromise(function() {
return activationPromise;
});
runs(function() {
var gitTimeMachineElement;
// Now we can test for view visibility
gitTimeMachineElement = works... | # activated.
atom.commands.dispatch workspaceElement, 'git-time-machine:toggle'
waitsForPromise ->
activationPromise
runs ->
# Now we can test for view visibility
gitTimeMachineElement = workspaceElement.querySelector('.git-time-machine')
expect(gitTimeMachineElement)... | JavaScript | CoffeeScript | littlebee/git-time-machine | spec/git-time-machine-spec.coffee | MIT | 2b2a9b6ccc55dda0429a45aae913d1a0f6666439 | 1,111 | https://github.com/littlebee/git-time-machine/blob/2b2a9b6ccc55dda0429a45aae913d1a0f6666439/spec/git-time-machine-spec.coffee | 51 | 62 |
littlebee/git-time-machine:spec/git-time-machine-spec.coffee:2:completion | completion | # activated.
atom.commands.dispatch workspaceElement, 'git-time-machine:toggle'
waitsForPromise ->
activationPromise | runs ->
# Now we can test for view visibility
gitTimeMachineElement = workspaceElement.querySelector('.git-time-machine')
expect(gitTimeMachineElement).toBeVisible()
atom.commands.dispatch workspaceElement, 'git-time-machine:toggle'
expect(gitTimeMachineElement).not.toBeVisible() | CoffeeScript | CoffeeScript | littlebee/git-time-machine | spec/git-time-machine-spec.coffee | MIT | 2b2a9b6ccc55dda0429a45aae913d1a0f6666439 | 1,111 | https://github.com/littlebee/git-time-machine/blob/2b2a9b6ccc55dda0429a45aae913d1a0f6666439/spec/git-time-machine-spec.coffee | 51 | 62 |
littlebee/git-time-machine:spec/git-time-machine-spec.coffee:1:raw_corpus | raw_corpus | GitTimeMachine = require '../lib/git-time-machine'
# Use the command `window:run-package-specs` (cmd-alt-ctrl-p) to run specs.
#
# To run a specific `it` or `describe` block add an `f` to the front (e.g. `fit`
# or `fdescribe`). Remove the `f` to unfocus the block.
describe "GitTimeMachine", ->
[workspaceElement, a... | CoffeeScript | littlebee/git-time-machine | spec/git-time-machine-spec.coffee | MIT | 85147d9eeffff51adcc778c24fbe0eb2bf371fc9 | 1,111 | https://github.com/littlebee/git-time-machine/blob/85147d9eeffff51adcc778c24fbe0eb2bf371fc9/spec/git-time-machine-spec.coffee | 1 | 50 | ||
littlebee/git-time-machine:spec/git-time-machine-spec.coffee:1:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
GitTimeMachine = require '../lib/git-time-machine'
# Use the command `window:run-package-specs` (cmd-alt-ctrl-p) to run specs.
#
# To run a specific `it` or `describe` block add an `f` to the front (e.g. `fit`
# or `fdescribe`). Remove the `f` to unfocus the blo... | var GitTimeMachine;
GitTimeMachine = require('../lib/git-time-machine');
// Use the command `window:run-package-specs` (cmd-alt-ctrl-p) to run specs.
// To run a specific `it` or `describe` block add an `f` to the front (e.g. `fit`
// or `fdescribe`). Remove the `f` to unfocus the block.
describe("GitTimeMachine", f... | CoffeeScript | JavaScript | littlebee/git-time-machine | spec/git-time-machine-spec.coffee | MIT | 85147d9eeffff51adcc778c24fbe0eb2bf371fc9 | 1,111 | https://github.com/littlebee/git-time-machine/blob/85147d9eeffff51adcc778c24fbe0eb2bf371fc9/spec/git-time-machine-spec.coffee | 1 | 50 |
littlebee/git-time-machine:spec/git-time-machine-spec.coffee:1:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
var GitTimeMachine;
GitTimeMachine = require('../lib/git-time-machine');
// Use the command `window:run-package-specs` (cmd-alt-ctrl-p) to run specs.
// To run a specific `it` or `describe` block add an `f` to the front (e.g. `fit`
// or `fdescribe`). Remove the... | GitTimeMachine = require '../lib/git-time-machine'
# Use the command `window:run-package-specs` (cmd-alt-ctrl-p) to run specs.
#
# To run a specific `it` or `describe` block add an `f` to the front (e.g. `fit`
# or `fdescribe`). Remove the `f` to unfocus the block.
describe "GitTimeMachine", ->
[workspaceElement, a... | JavaScript | CoffeeScript | littlebee/git-time-machine | spec/git-time-machine-spec.coffee | MIT | 85147d9eeffff51adcc778c24fbe0eb2bf371fc9 | 1,111 | https://github.com/littlebee/git-time-machine/blob/85147d9eeffff51adcc778c24fbe0eb2bf371fc9/spec/git-time-machine-spec.coffee | 1 | 50 |
littlebee/git-time-machine:spec/git-time-machine-spec.coffee:1:completion | completion | GitTimeMachine = require '../lib/git-time-machine'
# Use the command `window:run-package-specs` (cmd-alt-ctrl-p) to run specs.
#
# To run a specific `it` or `describe` block add an `f` to the front (e.g. `fit`
# or `fdescribe`). Remove the `f` to unfocus the block.
describe "GitTimeMachine", ->
[workspaceElement, a... | activationPromise
runs ->
expect(workspaceElement.querySelector('.git-time-machine')).toExist()
gitTimeMachineElement = workspaceElement.querySelector('.git-time-machine')
expect(gitTimeMachineElement).toExist()
gitTimeMachinePanel = atom.workspace.panelForItem(gitTimeMachineEle... | CoffeeScript | CoffeeScript | littlebee/git-time-machine | spec/git-time-machine-spec.coffee | MIT | 85147d9eeffff51adcc778c24fbe0eb2bf371fc9 | 1,111 | https://github.com/littlebee/git-time-machine/blob/85147d9eeffff51adcc778c24fbe0eb2bf371fc9/spec/git-time-machine-spec.coffee | 1 | 50 |
littlebee/git-time-machine:spec/git-time-machine-spec.coffee:1:raw_corpus | raw_corpus | GitTimeMachine = require '../lib/git-time-machine'
# Use the command `window:run-package-specs` (cmd-alt-ctrl-p) to run specs.
#
# To run a specific `it` or `describe` block add an `f` to the front (e.g. `fit`
# or `fdescribe`). Remove the `f` to unfocus the block.
describe "GitTimeMachine", ->
[workspaceElement, a... | CoffeeScript | littlebee/git-time-machine | spec/git-time-machine-spec.coffee | MIT | 5545cea64434a8c151856e362471555ead365199 | 1,111 | https://github.com/littlebee/git-time-machine/blob/5545cea64434a8c151856e362471555ead365199/spec/git-time-machine-spec.coffee | 1 | 50 | ||
littlebee/git-time-machine:spec/git-time-machine-spec.coffee:1:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
GitTimeMachine = require '../lib/git-time-machine'
# Use the command `window:run-package-specs` (cmd-alt-ctrl-p) to run specs.
#
# To run a specific `it` or `describe` block add an `f` to the front (e.g. `fit`
# or `fdescribe`). Remove the `f` to unfocus the blo... | var GitTimeMachine;
GitTimeMachine = require('../lib/git-time-machine');
// Use the command `window:run-package-specs` (cmd-alt-ctrl-p) to run specs.
// To run a specific `it` or `describe` block add an `f` to the front (e.g. `fit`
// or `fdescribe`). Remove the `f` to unfocus the block.
describe("GitTimeMachine", f... | CoffeeScript | JavaScript | littlebee/git-time-machine | spec/git-time-machine-spec.coffee | MIT | 5545cea64434a8c151856e362471555ead365199 | 1,111 | https://github.com/littlebee/git-time-machine/blob/5545cea64434a8c151856e362471555ead365199/spec/git-time-machine-spec.coffee | 1 | 50 |
littlebee/git-time-machine:spec/git-time-machine-spec.coffee:1:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
var GitTimeMachine;
GitTimeMachine = require('../lib/git-time-machine');
// Use the command `window:run-package-specs` (cmd-alt-ctrl-p) to run specs.
// To run a specific `it` or `describe` block add an `f` to the front (e.g. `fit`
// or `fdescribe`). Remove the... | GitTimeMachine = require '../lib/git-time-machine'
# Use the command `window:run-package-specs` (cmd-alt-ctrl-p) to run specs.
#
# To run a specific `it` or `describe` block add an `f` to the front (e.g. `fit`
# or `fdescribe`). Remove the `f` to unfocus the block.
describe "GitTimeMachine", ->
[workspaceElement, a... | JavaScript | CoffeeScript | littlebee/git-time-machine | spec/git-time-machine-spec.coffee | MIT | 5545cea64434a8c151856e362471555ead365199 | 1,111 | https://github.com/littlebee/git-time-machine/blob/5545cea64434a8c151856e362471555ead365199/spec/git-time-machine-spec.coffee | 1 | 50 |
littlebee/git-time-machine:spec/git-time-machine-spec.coffee:1:completion | completion | GitTimeMachine = require '../lib/git-time-machine'
# Use the command `window:run-package-specs` (cmd-alt-ctrl-p) to run specs.
#
# To run a specific `it` or `describe` block add an `f` to the front (e.g. `fit`
# or `fdescribe`). Remove the `f` to unfocus the block.
describe "GitTimeMachine", ->
[workspaceElement, a... | activationPromise
runs ->
expect(workspaceElement.querySelector('.git-time-machine')).toExist()
gitTimeMachineElement = workspaceElement.querySelector('.git-time-machine')
expect(gitTimeMachineElement).toExist()
gitTimeMachinePanel = atom.workspace.panelForItem(gitTimeMachineEle... | CoffeeScript | CoffeeScript | littlebee/git-time-machine | spec/git-time-machine-spec.coffee | MIT | 5545cea64434a8c151856e362471555ead365199 | 1,111 | https://github.com/littlebee/git-time-machine/blob/5545cea64434a8c151856e362471555ead365199/spec/git-time-machine-spec.coffee | 1 | 50 |
littlebee/git-time-machine:spec/git-time-machine-spec.coffee:2:raw_corpus | raw_corpus | # activated.
atom.commands.dispatch workspaceElement, 'git-time-machine:open'
waitsForPromise ->
activationPromise
runs ->
# Now we can test for view visibility
gitTimeMachineElement = workspaceElement.querySelector('.git-time-machine')
expect(gitTimeMachineElement).t... | CoffeeScript | littlebee/git-time-machine | spec/git-time-machine-spec.coffee | MIT | 5545cea64434a8c151856e362471555ead365199 | 1,111 | https://github.com/littlebee/git-time-machine/blob/5545cea64434a8c151856e362471555ead365199/spec/git-time-machine-spec.coffee | 51 | 62 | ||
littlebee/git-time-machine:spec/git-time-machine-spec.coffee:2:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
# activated.
atom.commands.dispatch workspaceElement, 'git-time-machine:open'
waitsForPromise ->
activationPromise
runs ->
# Now we can test for view visibility
gitTimeMachineElement = workspaceElement.querySelector('.g... | // activated.
atom.commands.dispatch(workspaceElement, 'git-time-machine:open');
waitsForPromise(function() {
return activationPromise;
});
runs(function() {
var gitTimeMachineElement;
// Now we can test for view visibility
gitTimeMachineElement = workspaceElement.querySelector('.git-time-machine');
expect(... | CoffeeScript | JavaScript | littlebee/git-time-machine | spec/git-time-machine-spec.coffee | MIT | 5545cea64434a8c151856e362471555ead365199 | 1,111 | https://github.com/littlebee/git-time-machine/blob/5545cea64434a8c151856e362471555ead365199/spec/git-time-machine-spec.coffee | 51 | 62 |
littlebee/git-time-machine:spec/git-time-machine-spec.coffee:2:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
// activated.
atom.commands.dispatch(workspaceElement, 'git-time-machine:open');
waitsForPromise(function() {
return activationPromise;
});
runs(function() {
var gitTimeMachineElement;
// Now we can test for view visibility
gitTimeMachineElement = workspa... | # activated.
atom.commands.dispatch workspaceElement, 'git-time-machine:open'
waitsForPromise ->
activationPromise
runs ->
# Now we can test for view visibility
gitTimeMachineElement = workspaceElement.querySelector('.git-time-machine')
expect(gitTimeMachineElement).t... | JavaScript | CoffeeScript | littlebee/git-time-machine | spec/git-time-machine-spec.coffee | MIT | 5545cea64434a8c151856e362471555ead365199 | 1,111 | https://github.com/littlebee/git-time-machine/blob/5545cea64434a8c151856e362471555ead365199/spec/git-time-machine-spec.coffee | 51 | 62 |
littlebee/git-time-machine:spec/git-time-machine-spec.coffee:2:completion | completion | # activated.
atom.commands.dispatch workspaceElement, 'git-time-machine:open'
waitsForPromise ->
activationPromise | runs ->
# Now we can test for view visibility
gitTimeMachineElement = workspaceElement.querySelector('.git-time-machine')
expect(gitTimeMachineElement).toBeVisible()
atom.commands.dispatch workspaceElement, 'git-time-machine:open'
expect(gitTimeMachineElement).not.toBeVisible() | CoffeeScript | CoffeeScript | littlebee/git-time-machine | spec/git-time-machine-spec.coffee | MIT | 5545cea64434a8c151856e362471555ead365199 | 1,111 | https://github.com/littlebee/git-time-machine/blob/5545cea64434a8c151856e362471555ead365199/spec/git-time-machine-spec.coffee | 51 | 62 |
octoblu/meshblu:lib/logEvent.coffee:1:raw_corpus | raw_corpus | _ = require 'lodash'
module.exports = (eventCode, data, dependencies={}) ->
config = dependencies.config || require '../config'
moment = dependencies.moment || require 'moment'
data = _.clone data || {}
data.eventCode = eventCode || 0
data.timestamp ?= moment().toISOString()
if data.payload && !_.isPlain... | CoffeeScript | octoblu/meshblu | lib/logEvent.coffee | MIT | 5c38c9188a035434799d2fbe73465d3c0e2a25a9 | 815 | https://github.com/octoblu/meshblu/blob/5c38c9188a035434799d2fbe73465d3c0e2a25a9/lib/logEvent.coffee | 1 | 16 | ||
octoblu/meshblu:lib/logEvent.coffee:1:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
_ = require 'lodash'
module.exports = (eventCode, data, dependencies={}) ->
config = dependencies.config || require '../config'
moment = dependencies.moment || require 'moment'
data = _.clone data || {}
data.eventCode = eventCode || 0
data.timestamp ?... | var _;
_ = require('lodash');
module.exports = function(eventCode, data, dependencies = {}) {
var config, moment;
config = dependencies.config || require('../config');
moment = dependencies.moment || require('moment');
data = _.clone(data || {});
data.eventCode = eventCode || 0;
if (data.timestamp == null... | CoffeeScript | JavaScript | octoblu/meshblu | lib/logEvent.coffee | MIT | 5c38c9188a035434799d2fbe73465d3c0e2a25a9 | 815 | https://github.com/octoblu/meshblu/blob/5c38c9188a035434799d2fbe73465d3c0e2a25a9/lib/logEvent.coffee | 1 | 16 |
octoblu/meshblu:lib/logEvent.coffee:1:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
var _;
_ = require('lodash');
module.exports = function(eventCode, data, dependencies = {}) {
var config, moment;
config = dependencies.config || require('../config');
moment = dependencies.moment || require('moment');
data = _.clone(data || {});
data.e... | _ = require 'lodash'
module.exports = (eventCode, data, dependencies={}) ->
config = dependencies.config || require '../config'
moment = dependencies.moment || require 'moment'
data = _.clone data || {}
data.eventCode = eventCode || 0
data.timestamp ?= moment().toISOString()
if data.payload && !_.isPlain... | JavaScript | CoffeeScript | octoblu/meshblu | lib/logEvent.coffee | MIT | 5c38c9188a035434799d2fbe73465d3c0e2a25a9 | 815 | https://github.com/octoblu/meshblu/blob/5c38c9188a035434799d2fbe73465d3c0e2a25a9/lib/logEvent.coffee | 1 | 16 |
octoblu/meshblu:lib/logEvent.coffee:1:completion | completion | _ = require 'lodash'
module.exports = (eventCode, data, dependencies={}) ->
config = dependencies.config || require '../config'
moment = dependencies.moment || require 'moment'
data = _.clone data || {}
data.eventCode = eventCode || 0 | data.timestamp ?= moment().toISOString()
if data.payload && !_.isPlainObject data.payload
data.payload = message: data.payload
if config.eventLoggers?
config.eventLoggers.console.log 'info', data if config.eventLoggers.console
config.eventLoggers.file.log 'info', data if config.eventLoggers.file | CoffeeScript | CoffeeScript | octoblu/meshblu | lib/logEvent.coffee | MIT | 5c38c9188a035434799d2fbe73465d3c0e2a25a9 | 815 | https://github.com/octoblu/meshblu/blob/5c38c9188a035434799d2fbe73465d3c0e2a25a9/lib/logEvent.coffee | 1 | 16 |
ExpediaGroup/cyclotron:cyclotron-site/app/scripts/dashboards/dataSources/dataSources.javascript.coffee:1:raw_corpus | raw_corpus | ###
# Copyright (c) 2013-2018 the original author or authors.
#
# Licensed under the MIT License (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.opensource.org/licenses/mit-license.php
#
# Unless required by applicable law ... | CoffeeScript | ExpediaGroup/cyclotron | cyclotron-site/app/scripts/dashboards/dataSources/dataSources.javascript.coffee | MIT | 0228db71d84a3138a9ffddb50d8f4f8ff37cc5ab | 1,544 | https://github.com/ExpediaGroup/cyclotron/blob/0228db71d84a3138a9ffddb50d8f4f8ff37cc5ab/cyclotron-site/app/scripts/dashboards/dataSources/dataSources.javascript.coffee | 1 | 50 | ||
ExpediaGroup/cyclotron:cyclotron-site/app/scripts/dashboards/dataSources/dataSources.javascript.coffee:1:completion | completion | ###
# Copyright (c) 2013-2018 the original author or authors.
#
# Licensed under the MIT License (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.opensource.org/licenses/mit-license.php
#
# Unless required by applicable law ... | #
cyclotronDataSources.factory 'javascriptDataSource', ($q, $http, configService, dataSourceFactory) ->
runner = (options) ->
q = $q.defer()
processor = _.jsEval options.processor
if !_.isFunction(processor) then processor = null
if processor?
promise = $q.defer()
... | CoffeeScript | CoffeeScript | ExpediaGroup/cyclotron | cyclotron-site/app/scripts/dashboards/dataSources/dataSources.javascript.coffee | MIT | 0228db71d84a3138a9ffddb50d8f4f8ff37cc5ab | 1,544 | https://github.com/ExpediaGroup/cyclotron/blob/0228db71d84a3138a9ffddb50d8f4f8ff37cc5ab/cyclotron-site/app/scripts/dashboards/dataSources/dataSources.javascript.coffee | 1 | 50 |
ExpediaGroup/cyclotron:cyclotron-site/app/scripts/dashboards/dataSources/dataSources.javascript.coffee:2:raw_corpus | raw_corpus | data: data
columns: null
else
err = 'Invalid data set returned in JavaScript Data Source. Returned object must be an array of objects.'
console.log err
q.reject err
q2.catch (rea... | CoffeeScript | ExpediaGroup/cyclotron | cyclotron-site/app/scripts/dashboards/dataSources/dataSources.javascript.coffee | MIT | 0228db71d84a3138a9ffddb50d8f4f8ff37cc5ab | 1,544 | https://github.com/ExpediaGroup/cyclotron/blob/0228db71d84a3138a9ffddb50d8f4f8ff37cc5ab/cyclotron-site/app/scripts/dashboards/dataSources/dataSources.javascript.coffee | 51 | 68 | ||
ExpediaGroup/cyclotron:cyclotron-site/app/scripts/dashboards/dataSources/dataSources.javascript.coffee:2:completion | completion | data: data
columns: null
else
err = 'Invalid data set returned in JavaScript Data Source. Returned object must be an array of objects.'
console.log err
q.reject err
q2.catch (rea... | q.reject reason
catch error
q.reject error
else
q.reject 'Processor is not a function.'
return q.promise
dataSourceFactory.create 'JavaScript', runner | CoffeeScript | CoffeeScript | ExpediaGroup/cyclotron | cyclotron-site/app/scripts/dashboards/dataSources/dataSources.javascript.coffee | MIT | 0228db71d84a3138a9ffddb50d8f4f8ff37cc5ab | 1,544 | https://github.com/ExpediaGroup/cyclotron/blob/0228db71d84a3138a9ffddb50d8f4f8ff37cc5ab/cyclotron-site/app/scripts/dashboards/dataSources/dataSources.javascript.coffee | 51 | 68 |
ExpediaGroup/cyclotron:cyclotron-site/app/scripts/dashboards/dataSources/dataSources.javascript.coffee:1:raw_corpus | raw_corpus | ###
# Copyright (c) 2013-2015 the original author or authors.
#
# Licensed under the MIT License (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.opensource.org/licenses/mit-license.php
#
# Unless required by applicable law ... | CoffeeScript | ExpediaGroup/cyclotron | cyclotron-site/app/scripts/dashboards/dataSources/dataSources.javascript.coffee | MIT | 2c2eb7bc16616a8b1d9601b8307884f5f6be40de | 1,544 | https://github.com/ExpediaGroup/cyclotron/blob/2c2eb7bc16616a8b1d9601b8307884f5f6be40de/cyclotron-site/app/scripts/dashboards/dataSources/dataSources.javascript.coffee | 1 | 50 | ||
ExpediaGroup/cyclotron:cyclotron-site/app/scripts/dashboards/dataSources/dataSources.javascript.coffee:1:completion | completion | ###
# Copyright (c) 2013-2015 the original author or authors.
#
# Licensed under the MIT License (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.opensource.org/licenses/mit-license.php
#
# Unless required by applicable law ... | #
cyclotronDataSources.factory 'javascriptDataSource', ($q, $http, configService, dataSourceFactory) ->
runner = (options) ->
q = $q.defer()
processor = _.jsEval options.processor
if !_.isFunction(processor) then processor = null
if processor?
promise = $q.defer()
... | CoffeeScript | CoffeeScript | ExpediaGroup/cyclotron | cyclotron-site/app/scripts/dashboards/dataSources/dataSources.javascript.coffee | MIT | 2c2eb7bc16616a8b1d9601b8307884f5f6be40de | 1,544 | https://github.com/ExpediaGroup/cyclotron/blob/2c2eb7bc16616a8b1d9601b8307884f5f6be40de/cyclotron-site/app/scripts/dashboards/dataSources/dataSources.javascript.coffee | 1 | 50 |
ExpediaGroup/cyclotron:cyclotron-site/app/scripts/dashboards/dataSources/dataSources.javascript.coffee:1:raw_corpus | raw_corpus | ###
# Copyright (c) 2013-2015 the original author or authors.
#
# Licensed under the MIT License (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.opensource.org/licenses/mit-license.php
#
# Unless required by applicable law ... | CoffeeScript | ExpediaGroup/cyclotron | cyclotron-site/app/scripts/dashboards/dataSources/dataSources.javascript.coffee | MIT | 14b0e411415be801f94fe13ea6f63d5ad957c2ed | 1,544 | https://github.com/ExpediaGroup/cyclotron/blob/14b0e411415be801f94fe13ea6f63d5ad957c2ed/cyclotron-site/app/scripts/dashboards/dataSources/dataSources.javascript.coffee | 1 | 50 | ||
ExpediaGroup/cyclotron:cyclotron-site/app/scripts/dashboards/dataSources/dataSources.javascript.coffee:1:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
###
# Copyright (c) 2013-2015 the original author or authors.
#
# Licensed under the MIT License (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.opensource.org/licens... | /*
* Copyright (c) 2013-2015 the original author or authors.
*
* Licensed under the MIT License (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.opensource.org/licenses/mit-license.php
*
* Unless required by applica... | CoffeeScript | JavaScript | ExpediaGroup/cyclotron | cyclotron-site/app/scripts/dashboards/dataSources/dataSources.javascript.coffee | MIT | 14b0e411415be801f94fe13ea6f63d5ad957c2ed | 1,544 | https://github.com/ExpediaGroup/cyclotron/blob/14b0e411415be801f94fe13ea6f63d5ad957c2ed/cyclotron-site/app/scripts/dashboards/dataSources/dataSources.javascript.coffee | 1 | 50 |
ExpediaGroup/cyclotron:cyclotron-site/app/scripts/dashboards/dataSources/dataSources.javascript.coffee:1:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
/*
* Copyright (c) 2013-2015 the original author or authors.
*
* Licensed under the MIT License (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.opensource.org/li... | ###
# Copyright (c) 2013-2015 the original author or authors.
#
# Licensed under the MIT License (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.opensource.org/licenses/mit-license.php
#
# Unless required by applicable law ... | JavaScript | CoffeeScript | ExpediaGroup/cyclotron | cyclotron-site/app/scripts/dashboards/dataSources/dataSources.javascript.coffee | MIT | 14b0e411415be801f94fe13ea6f63d5ad957c2ed | 1,544 | https://github.com/ExpediaGroup/cyclotron/blob/14b0e411415be801f94fe13ea6f63d5ad957c2ed/cyclotron-site/app/scripts/dashboards/dataSources/dataSources.javascript.coffee | 1 | 50 |
ExpediaGroup/cyclotron:cyclotron-site/app/scripts/dashboards/dataSources/dataSources.javascript.coffee:1:completion | completion | ###
# Copyright (c) 2013-2015 the original author or authors.
#
# Licensed under the MIT License (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.opensource.org/licenses/mit-license.php
#
# Unless required by applicable law ... | #
cyclotronDataSources.factory 'javascriptDataSource', ($q, $http, configService, dataSourceFactory) ->
runner = (options) ->
q = $q.defer()
processor = _.jsEval options.processor
if !_.isFunction(processor) then processor = null
if processor?
promise = $q.defer()
... | CoffeeScript | CoffeeScript | ExpediaGroup/cyclotron | cyclotron-site/app/scripts/dashboards/dataSources/dataSources.javascript.coffee | MIT | 14b0e411415be801f94fe13ea6f63d5ad957c2ed | 1,544 | https://github.com/ExpediaGroup/cyclotron/blob/14b0e411415be801f94fe13ea6f63d5ad957c2ed/cyclotron-site/app/scripts/dashboards/dataSources/dataSources.javascript.coffee | 1 | 50 |
ExpediaGroup/cyclotron:cyclotron-site/app/scripts/dashboards/dataSources/dataSources.javascript.coffee:2:raw_corpus | raw_corpus | columns: null
else
err = 'Invalid data set returned in JavaScript Data Source. Returned object must be an array of objects.'
console.log err
q.reject err
q2.catch (reason) ->
console.log(reason)
q.r... | CoffeeScript | ExpediaGroup/cyclotron | cyclotron-site/app/scripts/dashboards/dataSources/dataSources.javascript.coffee | MIT | 14b0e411415be801f94fe13ea6f63d5ad957c2ed | 1,544 | https://github.com/ExpediaGroup/cyclotron/blob/14b0e411415be801f94fe13ea6f63d5ad957c2ed/cyclotron-site/app/scripts/dashboards/dataSources/dataSources.javascript.coffee | 51 | 65 | ||
ExpediaGroup/cyclotron:cyclotron-site/app/scripts/dashboards/dataSources/dataSources.javascript.coffee:2:completion | completion | columns: null
else
err = 'Invalid data set returned in JavaScript Data Source. Returned object must be an array of objects.'
console.log err
q.reject err
q2.catch (reason) -> | console.log(reason)
q.reject reason
else
q.reject 'Processor is not a function.'
return q.promise
dataSourceFactory.create 'JavaScript', runner | CoffeeScript | CoffeeScript | ExpediaGroup/cyclotron | cyclotron-site/app/scripts/dashboards/dataSources/dataSources.javascript.coffee | MIT | 14b0e411415be801f94fe13ea6f63d5ad957c2ed | 1,544 | https://github.com/ExpediaGroup/cyclotron/blob/14b0e411415be801f94fe13ea6f63d5ad957c2ed/cyclotron-site/app/scripts/dashboards/dataSources/dataSources.javascript.coffee | 51 | 65 |
orktes/atom-react:spec/autocomplete-spec.coffee:1:raw_corpus | raw_corpus | describe "Tag autocomplete tests", ->
[editor, buffer, languageMode] = []
beforeEach ->
waitsForPromise ->
atom.packages.activatePackage("react")
waitsForPromise ->
atom.workspace.open("foofoo", autoIndent: false).then (o) ->
editor = o
{buffer, languageMode} = editor
... | CoffeeScript | orktes/atom-react | spec/autocomplete-spec.coffee | MIT | f045e1c6682360a2c74f3de522ce93a9ea4fcbfb | 473 | https://github.com/orktes/atom-react/blob/f045e1c6682360a2c74f3de522ce93a9ea4fcbfb/spec/autocomplete-spec.coffee | 1 | 50 | ||
orktes/atom-react:spec/autocomplete-spec.coffee:1:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
describe "Tag autocomplete tests", ->
[editor, buffer, languageMode] = []
beforeEach ->
waitsForPromise ->
atom.packages.activatePackage("react")
waitsForPromise ->
atom.workspace.open("foofoo", autoIndent: false).then (o) ->
... | describe("Tag autocomplete tests", function() {
var buffer, editor, languageMode;
[editor, buffer, languageMode] = [];
beforeEach(function() {
waitsForPromise(function() {
return atom.packages.activatePackage("react");
});
return waitsForPromise(function() {
return atom.workspace.open("foo... | CoffeeScript | JavaScript | orktes/atom-react | spec/autocomplete-spec.coffee | MIT | f045e1c6682360a2c74f3de522ce93a9ea4fcbfb | 473 | https://github.com/orktes/atom-react/blob/f045e1c6682360a2c74f3de522ce93a9ea4fcbfb/spec/autocomplete-spec.coffee | 1 | 50 |
orktes/atom-react:spec/autocomplete-spec.coffee:1:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
describe("Tag autocomplete tests", function() {
var buffer, editor, languageMode;
[editor, buffer, languageMode] = [];
beforeEach(function() {
waitsForPromise(function() {
return atom.packages.activatePackage("react");
});
return waitsForPro... | describe "Tag autocomplete tests", ->
[editor, buffer, languageMode] = []
beforeEach ->
waitsForPromise ->
atom.packages.activatePackage("react")
waitsForPromise ->
atom.workspace.open("foofoo", autoIndent: false).then (o) ->
editor = o
{buffer, languageMode} = editor
... | JavaScript | CoffeeScript | orktes/atom-react | spec/autocomplete-spec.coffee | MIT | f045e1c6682360a2c74f3de522ce93a9ea4fcbfb | 473 | https://github.com/orktes/atom-react/blob/f045e1c6682360a2c74f3de522ce93a9ea4fcbfb/spec/autocomplete-spec.coffee | 1 | 50 |
orktes/atom-react:spec/autocomplete-spec.coffee:1:completion | completion | describe "Tag autocomplete tests", ->
[editor, buffer, languageMode] = []
beforeEach ->
waitsForPromise ->
atom.packages.activatePackage("react")
waitsForPromise ->
atom.workspace.open("foofoo", autoIndent: false).then (o) ->
editor = o
{buffer, languageMode} = editor
... | it "should not autocomplete tag attributes", ->
editor.insertText('<p attr={ 1')
editor.insertText('>')
expect(editor.getText()).toBe('<p attr={ 1>')
it "should not autocomplete tag attributes with arrow functions", ->
editor.insertText('<p attr={number =')
editor.insertText('>')
... | CoffeeScript | CoffeeScript | orktes/atom-react | spec/autocomplete-spec.coffee | MIT | f045e1c6682360a2c74f3de522ce93a9ea4fcbfb | 473 | https://github.com/orktes/atom-react/blob/f045e1c6682360a2c74f3de522ce93a9ea4fcbfb/spec/autocomplete-spec.coffee | 1 | 50 |
orktes/atom-react:spec/autocomplete-spec.coffee:1:raw_corpus | raw_corpus | describe "Tag autocomplete tests", ->
[editor, buffer, languageMode] = []
beforeEach ->
waitsForPromise ->
atom.packages.activatePackage("react")
waitsForPromise ->
atom.workspace.open("foofoo", autoIndent: false).then (o) ->
editor = o
{buffer, languageMode} = editor
... | CoffeeScript | orktes/atom-react | spec/autocomplete-spec.coffee | MIT | 0cf18ad8797a1f353c45e872ca13d126f9911b4d | 473 | https://github.com/orktes/atom-react/blob/0cf18ad8797a1f353c45e872ca13d126f9911b4d/spec/autocomplete-spec.coffee | 1 | 50 | ||
orktes/atom-react:spec/autocomplete-spec.coffee:1:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
describe "Tag autocomplete tests", ->
[editor, buffer, languageMode] = []
beforeEach ->
waitsForPromise ->
atom.packages.activatePackage("react")
waitsForPromise ->
atom.workspace.open("foofoo", autoIndent: false).then (o) ->
... | describe("Tag autocomplete tests", function() {
var buffer, editor, languageMode;
[editor, buffer, languageMode] = [];
beforeEach(function() {
waitsForPromise(function() {
return atom.packages.activatePackage("react");
});
waitsForPromise(function() {
return atom.workspace.open("foofoo", {... | CoffeeScript | JavaScript | orktes/atom-react | spec/autocomplete-spec.coffee | MIT | 0cf18ad8797a1f353c45e872ca13d126f9911b4d | 473 | https://github.com/orktes/atom-react/blob/0cf18ad8797a1f353c45e872ca13d126f9911b4d/spec/autocomplete-spec.coffee | 1 | 50 |
orktes/atom-react:spec/autocomplete-spec.coffee:1:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
describe("Tag autocomplete tests", function() {
var buffer, editor, languageMode;
[editor, buffer, languageMode] = [];
beforeEach(function() {
waitsForPromise(function() {
return atom.packages.activatePackage("react");
});
waitsForPromise(fu... | describe "Tag autocomplete tests", ->
[editor, buffer, languageMode] = []
beforeEach ->
waitsForPromise ->
atom.packages.activatePackage("react")
waitsForPromise ->
atom.workspace.open("foofoo", autoIndent: false).then (o) ->
editor = o
{buffer, languageMode} = editor
... | JavaScript | CoffeeScript | orktes/atom-react | spec/autocomplete-spec.coffee | MIT | 0cf18ad8797a1f353c45e872ca13d126f9911b4d | 473 | https://github.com/orktes/atom-react/blob/0cf18ad8797a1f353c45e872ca13d126f9911b4d/spec/autocomplete-spec.coffee | 1 | 50 |
orktes/atom-react:spec/autocomplete-spec.coffee:1:completion | completion | describe "Tag autocomplete tests", ->
[editor, buffer, languageMode] = []
beforeEach ->
waitsForPromise ->
atom.packages.activatePackage("react")
waitsForPromise ->
atom.workspace.open("foofoo", autoIndent: false).then (o) ->
editor = o
{buffer, languageMode} = editor
... | editor.insertText('<p attr={ 1')
editor.insertText('>')
expect(editor.getText()).toBe('<p attr={ 1>')
it "should not autocomplete tag attributes with arrow functions", ->
editor.insertText('<p attr={number =')
editor.insertText('>')
expect(editor.getText()).toBe('<p attr={number =>')
... | CoffeeScript | CoffeeScript | orktes/atom-react | spec/autocomplete-spec.coffee | MIT | 0cf18ad8797a1f353c45e872ca13d126f9911b4d | 473 | https://github.com/orktes/atom-react/blob/0cf18ad8797a1f353c45e872ca13d126f9911b4d/spec/autocomplete-spec.coffee | 1 | 50 |
orktes/atom-react:spec/autocomplete-spec.coffee:1:raw_corpus | raw_corpus | describe "Tag autocomplete tests", ->
[editor, buffer, languageMode] = []
beforeEach ->
waitsForPromise ->
atom.packages.activatePackage("react")
waitsForPromise ->
atom.workspace.open("foofoo", autoIndent: false).then (o) ->
editor = o
{buffer, languageMode} = editor
... | CoffeeScript | orktes/atom-react | spec/autocomplete-spec.coffee | MIT | 66ff8deb7f4ff10ccb0db94b45b875f6bfdd21c3 | 473 | https://github.com/orktes/atom-react/blob/66ff8deb7f4ff10ccb0db94b45b875f6bfdd21c3/spec/autocomplete-spec.coffee | 1 | 45 | ||
orktes/atom-react:spec/autocomplete-spec.coffee:1:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
describe "Tag autocomplete tests", ->
[editor, buffer, languageMode] = []
beforeEach ->
waitsForPromise ->
atom.packages.activatePackage("react")
waitsForPromise ->
atom.workspace.open("foofoo", autoIndent: false).then (o) ->
... | describe("Tag autocomplete tests", function() {
var buffer, editor, languageMode;
[editor, buffer, languageMode] = [];
beforeEach(function() {
waitsForPromise(function() {
return atom.packages.activatePackage("react");
});
waitsForPromise(function() {
return atom.workspace.open("foofoo", {... | CoffeeScript | JavaScript | orktes/atom-react | spec/autocomplete-spec.coffee | MIT | 66ff8deb7f4ff10ccb0db94b45b875f6bfdd21c3 | 473 | https://github.com/orktes/atom-react/blob/66ff8deb7f4ff10ccb0db94b45b875f6bfdd21c3/spec/autocomplete-spec.coffee | 1 | 45 |
orktes/atom-react:spec/autocomplete-spec.coffee:1:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
describe("Tag autocomplete tests", function() {
var buffer, editor, languageMode;
[editor, buffer, languageMode] = [];
beforeEach(function() {
waitsForPromise(function() {
return atom.packages.activatePackage("react");
});
waitsForPromise(fu... | describe "Tag autocomplete tests", ->
[editor, buffer, languageMode] = []
beforeEach ->
waitsForPromise ->
atom.packages.activatePackage("react")
waitsForPromise ->
atom.workspace.open("foofoo", autoIndent: false).then (o) ->
editor = o
{buffer, languageMode} = editor
... | JavaScript | CoffeeScript | orktes/atom-react | spec/autocomplete-spec.coffee | MIT | 66ff8deb7f4ff10ccb0db94b45b875f6bfdd21c3 | 473 | https://github.com/orktes/atom-react/blob/66ff8deb7f4ff10ccb0db94b45b875f6bfdd21c3/spec/autocomplete-spec.coffee | 1 | 45 |
orktes/atom-react:spec/autocomplete-spec.coffee:1:completion | completion | describe "Tag autocomplete tests", ->
[editor, buffer, languageMode] = []
beforeEach ->
waitsForPromise ->
atom.packages.activatePackage("react")
waitsForPromise ->
atom.workspace.open("foofoo", autoIndent: false).then (o) ->
editor = o
{buffer, languageMode} = editor
... | expect(editor.getText()).toBe('<p></p>')
it "should remove closing tag", ->
editor.insertText('<p')
editor.insertText('>')
expect(editor.getText()).toBe('<p></p>')
editor.backspace()
expect(editor.getText()).toBe('<p')
it "should add extra line break when new line added between o... | CoffeeScript | CoffeeScript | orktes/atom-react | spec/autocomplete-spec.coffee | MIT | 66ff8deb7f4ff10ccb0db94b45b875f6bfdd21c3 | 473 | https://github.com/orktes/atom-react/blob/66ff8deb7f4ff10ccb0db94b45b875f6bfdd21c3/spec/autocomplete-spec.coffee | 1 | 45 |
orktes/atom-react:spec/autocomplete-spec.coffee:1:raw_corpus | raw_corpus | describe "Tag autocomplete tests", ->
[editor, buffer, languageMode] = []
beforeEach ->
waitsForPromise ->
atom.packages.activatePackage("react")
waitsForPromise ->
atom.workspace.open("foofoo", autoIndent: false).then (o) ->
editor = o
{buffer, languageMode} = editor
... | CoffeeScript | orktes/atom-react | spec/autocomplete-spec.coffee | MIT | 4e2d107fccbd2298cb17ec64d6cc489860629880 | 473 | https://github.com/orktes/atom-react/blob/4e2d107fccbd2298cb17ec64d6cc489860629880/spec/autocomplete-spec.coffee | 1 | 43 | ||
orktes/atom-react:spec/autocomplete-spec.coffee:1:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
describe "Tag autocomplete tests", ->
[editor, buffer, languageMode] = []
beforeEach ->
waitsForPromise ->
atom.packages.activatePackage("react")
waitsForPromise ->
atom.workspace.open("foofoo", autoIndent: false).then (o) ->
... | describe("Tag autocomplete tests", function() {
var buffer, editor, languageMode;
[editor, buffer, languageMode] = [];
beforeEach(function() {
waitsForPromise(function() {
return atom.packages.activatePackage("react");
});
waitsForPromise(function() {
return atom.workspace.open("foofoo", {... | CoffeeScript | JavaScript | orktes/atom-react | spec/autocomplete-spec.coffee | MIT | 4e2d107fccbd2298cb17ec64d6cc489860629880 | 473 | https://github.com/orktes/atom-react/blob/4e2d107fccbd2298cb17ec64d6cc489860629880/spec/autocomplete-spec.coffee | 1 | 43 |
orktes/atom-react:spec/autocomplete-spec.coffee:1:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
describe("Tag autocomplete tests", function() {
var buffer, editor, languageMode;
[editor, buffer, languageMode] = [];
beforeEach(function() {
waitsForPromise(function() {
return atom.packages.activatePackage("react");
});
waitsForPromise(fu... | describe "Tag autocomplete tests", ->
[editor, buffer, languageMode] = []
beforeEach ->
waitsForPromise ->
atom.packages.activatePackage("react")
waitsForPromise ->
atom.workspace.open("foofoo", autoIndent: false).then (o) ->
editor = o
{buffer, languageMode} = editor
... | JavaScript | CoffeeScript | orktes/atom-react | spec/autocomplete-spec.coffee | MIT | 4e2d107fccbd2298cb17ec64d6cc489860629880 | 473 | https://github.com/orktes/atom-react/blob/4e2d107fccbd2298cb17ec64d6cc489860629880/spec/autocomplete-spec.coffee | 1 | 43 |
orktes/atom-react:spec/autocomplete-spec.coffee:1:completion | completion | describe "Tag autocomplete tests", ->
[editor, buffer, languageMode] = []
beforeEach ->
waitsForPromise ->
atom.packages.activatePackage("react")
waitsForPromise ->
atom.workspace.open("foofoo", autoIndent: false).then (o) ->
editor = o
{buffer, languageMode} = editor
... | expect(editor.getText()).toBe('<p></p>')
it "should remove closing tag", ->
editor.insertText('<p>')
expect(editor.getText()).toBe('<p></p>')
editor.backspace()
expect(editor.getText()).toBe('<p')
it "should add extra line break when new line added between open and close tag", ->
... | CoffeeScript | CoffeeScript | orktes/atom-react | spec/autocomplete-spec.coffee | MIT | 4e2d107fccbd2298cb17ec64d6cc489860629880 | 473 | https://github.com/orktes/atom-react/blob/4e2d107fccbd2298cb17ec64d6cc489860629880/spec/autocomplete-spec.coffee | 1 | 43 |
orktes/atom-react:spec/autocomplete-spec.coffee:1:raw_corpus | raw_corpus | describe "Tag autocomplete tests", ->
[editor, buffer, languageMode] = []
beforeEach ->
waitsForPromise ->
atom.packages.activatePackage("react")
waitsForPromise ->
atom.workspace.open("foofoo", autoIndent: false).then (o) ->
editor = o
{buffer, languageMode} = editor
... | CoffeeScript | orktes/atom-react | spec/autocomplete-spec.coffee | MIT | 937b65b36d0c076d44a12e7fb61ff1a0e8a8e95a | 473 | https://github.com/orktes/atom-react/blob/937b65b36d0c076d44a12e7fb61ff1a0e8a8e95a/spec/autocomplete-spec.coffee | 1 | 35 | ||
orktes/atom-react:spec/autocomplete-spec.coffee:1:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
describe "Tag autocomplete tests", ->
[editor, buffer, languageMode] = []
beforeEach ->
waitsForPromise ->
atom.packages.activatePackage("react")
waitsForPromise ->
atom.workspace.open("foofoo", autoIndent: false).then (o) ->
... | describe("Tag autocomplete tests", function() {
var buffer, editor, languageMode;
[editor, buffer, languageMode] = [];
beforeEach(function() {
waitsForPromise(function() {
return atom.packages.activatePackage("react");
});
waitsForPromise(function() {
return atom.workspace.open("foofoo", {... | CoffeeScript | JavaScript | orktes/atom-react | spec/autocomplete-spec.coffee | MIT | 937b65b36d0c076d44a12e7fb61ff1a0e8a8e95a | 473 | https://github.com/orktes/atom-react/blob/937b65b36d0c076d44a12e7fb61ff1a0e8a8e95a/spec/autocomplete-spec.coffee | 1 | 35 |
orktes/atom-react:spec/autocomplete-spec.coffee:1:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
describe("Tag autocomplete tests", function() {
var buffer, editor, languageMode;
[editor, buffer, languageMode] = [];
beforeEach(function() {
waitsForPromise(function() {
return atom.packages.activatePackage("react");
});
waitsForPromise(fu... | describe "Tag autocomplete tests", ->
[editor, buffer, languageMode] = []
beforeEach ->
waitsForPromise ->
atom.packages.activatePackage("react")
waitsForPromise ->
atom.workspace.open("foofoo", autoIndent: false).then (o) ->
editor = o
{buffer, languageMode} = editor
... | JavaScript | CoffeeScript | orktes/atom-react | spec/autocomplete-spec.coffee | MIT | 937b65b36d0c076d44a12e7fb61ff1a0e8a8e95a | 473 | https://github.com/orktes/atom-react/blob/937b65b36d0c076d44a12e7fb61ff1a0e8a8e95a/spec/autocomplete-spec.coffee | 1 | 35 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.