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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
elving/swag:src/swag.miscellaneous.coffee:1:completion | completion | Handlebars.registerHelper 'default', (value, defaultValue) ->
newValue = value ? defaultValue
if newValue then newValue else defaultValue | Handlebars.registerHelper 'partial', (name, data) ->
partial = exports.Config.partialsPath + name
data = if Utils.isUndefined(data) then {} else data
Handlebars.registerPartial(name, require partial) unless Handlebars.partials[name]?
Utils.safeString Handlebars.partials[name](data) | CoffeeScript | CoffeeScript | elving/swag | src/swag.miscellaneous.coffee | MIT | 163af3a070eefe79a32c8239884929e0cae1f589 | 675 | https://github.com/elving/swag/blob/163af3a070eefe79a32c8239884929e0cae1f589/src/swag.miscellaneous.coffee | 1 | 9 |
soyjavi/QuoJS:src/quo.constants.coffee:1:raw_corpus | raw_corpus | ###
QuoJS 2.0
(c) 2011, 2012 Javi Jiménez Villar (@soyjavi)
http://quojs.tapquo.com
### | CoffeeScript | soyjavi/QuoJS | src/quo.constants.coffee | MIT | b4ba2781f3b6d7b57861b7217260136dbdd7d8eb | 2,055 | https://github.com/soyjavi/QuoJS/blob/b4ba2781f3b6d7b57861b7217260136dbdd7d8eb/src/quo.constants.coffee | 1 | 5 | ||
soyjavi/QuoJS:src/quo.constants.coffee:1:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
###
QuoJS 2.0
(c) 2011, 2012 Javi Jiménez Villar (@soyjavi)
http://quojs.tapquo.com
###
``` | /*
QuoJS 2.0
(c) 2011, 2012 Javi Jiménez Villar (@soyjavi)
http://quojs.tapquo.com
*/ | CoffeeScript | JavaScript | soyjavi/QuoJS | src/quo.constants.coffee | MIT | b4ba2781f3b6d7b57861b7217260136dbdd7d8eb | 2,055 | https://github.com/soyjavi/QuoJS/blob/b4ba2781f3b6d7b57861b7217260136dbdd7d8eb/src/quo.constants.coffee | 1 | 5 |
soyjavi/QuoJS:src/quo.constants.coffee:1:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
/*
QuoJS 2.0
(c) 2011, 2012 Javi Jiménez Villar (@soyjavi)
http://quojs.tapquo.com
*/
``` | ###
QuoJS 2.0
(c) 2011, 2012 Javi Jiménez Villar (@soyjavi)
http://quojs.tapquo.com
### | JavaScript | CoffeeScript | soyjavi/QuoJS | src/quo.constants.coffee | MIT | b4ba2781f3b6d7b57861b7217260136dbdd7d8eb | 2,055 | https://github.com/soyjavi/QuoJS/blob/b4ba2781f3b6d7b57861b7217260136dbdd7d8eb/src/quo.constants.coffee | 1 | 5 |
JoelBesada/activate-power-mode:lib/effect-registry.coffee:1:raw_corpus | raw_corpus | {CompositeDisposable} = require "atom"
module.exports =
subscriptions: null
effects: []
effect: null
key: "activate-power-mode.particles.effect"
enable: ->
@subscriptions = new CompositeDisposable
@observeEffect()
@initList()
disable: ->
@subscriptions?.dispose()
@effectList?.dispose(... | CoffeeScript | JoelBesada/activate-power-mode | lib/effect-registry.coffee | MIT | ac060c2476ba8b323ca932eda97da9bc0c051b34 | 3,570 | https://github.com/JoelBesada/activate-power-mode/blob/ac060c2476ba8b323ca932eda97da9bc0c051b34/lib/effect-registry.coffee | 1 | 50 | ||
JoelBesada/activate-power-mode:lib/effect-registry.coffee:1:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
{CompositeDisposable} = require "atom"
module.exports =
subscriptions: null
effects: []
effect: null
key: "activate-power-mode.particles.effect"
enable: ->
@subscriptions = new CompositeDisposable
@observeEffect()
@initList()
disable: -... | var CompositeDisposable;
({CompositeDisposable} = require("atom"));
module.exports = {
subscriptions: null,
effects: [],
effect: null,
key: "activate-power-mode.particles.effect",
enable: function() {
this.subscriptions = new CompositeDisposable();
this.observeEffect();
return this.initList();
... | CoffeeScript | JavaScript | JoelBesada/activate-power-mode | lib/effect-registry.coffee | MIT | ac060c2476ba8b323ca932eda97da9bc0c051b34 | 3,570 | https://github.com/JoelBesada/activate-power-mode/blob/ac060c2476ba8b323ca932eda97da9bc0c051b34/lib/effect-registry.coffee | 1 | 50 |
JoelBesada/activate-power-mode:lib/effect-registry.coffee:1:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
var CompositeDisposable;
({CompositeDisposable} = require("atom"));
module.exports = {
subscriptions: null,
effects: [],
effect: null,
key: "activate-power-mode.particles.effect",
enable: function() {
this.subscriptions = new CompositeDisposable();
... | {CompositeDisposable} = require "atom"
module.exports =
subscriptions: null
effects: []
effect: null
key: "activate-power-mode.particles.effect"
enable: ->
@subscriptions = new CompositeDisposable
@observeEffect()
@initList()
disable: ->
@subscriptions?.dispose()
@effectList?.dispose(... | JavaScript | CoffeeScript | JoelBesada/activate-power-mode | lib/effect-registry.coffee | MIT | ac060c2476ba8b323ca932eda97da9bc0c051b34 | 3,570 | https://github.com/JoelBesada/activate-power-mode/blob/ac060c2476ba8b323ca932eda97da9bc0c051b34/lib/effect-registry.coffee | 1 | 50 |
JoelBesada/activate-power-mode:lib/effect-registry.coffee:1:completion | completion | {CompositeDisposable} = require "atom"
module.exports =
subscriptions: null
effects: []
effect: null
key: "activate-power-mode.particles.effect"
enable: ->
@subscriptions = new CompositeDisposable
@observeEffect()
@initList()
disable: ->
@subscriptions?.dispose()
@effectList?.dispose(... | if atom.config.get(@key) is code
@effect = effect
removeEffect: (code) ->
if atom.config.get(@key) is code
@effect.disable()
@effect = @effects['default']
@effect.init()
delete @effects[code]
observeEffect: ->
@subscriptions.add atom.config.observe(
@key, (code) =>
... | CoffeeScript | CoffeeScript | JoelBesada/activate-power-mode | lib/effect-registry.coffee | MIT | ac060c2476ba8b323ca932eda97da9bc0c051b34 | 3,570 | https://github.com/JoelBesada/activate-power-mode/blob/ac060c2476ba8b323ca932eda97da9bc0c051b34/lib/effect-registry.coffee | 1 | 50 |
JoelBesada/activate-power-mode:lib/effect-registry.coffee:2:raw_corpus | raw_corpus | initList: ->
return if @effectList?
@effectList = require "./effect-list"
@effectList.init this
@subscriptions.add atom.commands.add "atom-workspace",
"activate-power-mode:select-effect": =>
@effectList.toggle() | CoffeeScript | JoelBesada/activate-power-mode | lib/effect-registry.coffee | MIT | ac060c2476ba8b323ca932eda97da9bc0c051b34 | 3,570 | https://github.com/JoelBesada/activate-power-mode/blob/ac060c2476ba8b323ca932eda97da9bc0c051b34/lib/effect-registry.coffee | 51 | 60 | ||
JoelBesada/activate-power-mode:lib/effect-registry.coffee:2:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
initList: ->
return if @effectList?
@effectList = require "./effect-list"
@effectList.init this
@subscriptions.add atom.commands.add "atom-workspace",
"activate-power-mode:select-effect": =>
@effectList.toggle()
``` | ({
initList: function() {
if (this.effectList != null) {
return;
}
this.effectList = require("./effect-list");
this.effectList.init(this);
return this.subscriptions.add(atom.commands.add("atom-workspace", {
"activate-power-mode:select-effect": () => {
return this.effectList.tog... | CoffeeScript | JavaScript | JoelBesada/activate-power-mode | lib/effect-registry.coffee | MIT | ac060c2476ba8b323ca932eda97da9bc0c051b34 | 3,570 | https://github.com/JoelBesada/activate-power-mode/blob/ac060c2476ba8b323ca932eda97da9bc0c051b34/lib/effect-registry.coffee | 51 | 60 |
JoelBesada/activate-power-mode:lib/effect-registry.coffee:2:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
({
initList: function() {
if (this.effectList != null) {
return;
}
this.effectList = require("./effect-list");
this.effectList.init(this);
return this.subscriptions.add(atom.commands.add("atom-workspace", {
"activate-power-mode:sel... | initList: ->
return if @effectList?
@effectList = require "./effect-list"
@effectList.init this
@subscriptions.add atom.commands.add "atom-workspace",
"activate-power-mode:select-effect": =>
@effectList.toggle() | JavaScript | CoffeeScript | JoelBesada/activate-power-mode | lib/effect-registry.coffee | MIT | ac060c2476ba8b323ca932eda97da9bc0c051b34 | 3,570 | https://github.com/JoelBesada/activate-power-mode/blob/ac060c2476ba8b323ca932eda97da9bc0c051b34/lib/effect-registry.coffee | 51 | 60 |
JoelBesada/activate-power-mode:lib/effect-registry.coffee:2:completion | completion | initList: ->
return if @effectList?
@effectList = require "./effect-list" | @effectList.init this
@subscriptions.add atom.commands.add "atom-workspace",
"activate-power-mode:select-effect": =>
@effectList.toggle() | CoffeeScript | CoffeeScript | JoelBesada/activate-power-mode | lib/effect-registry.coffee | MIT | ac060c2476ba8b323ca932eda97da9bc0c051b34 | 3,570 | https://github.com/JoelBesada/activate-power-mode/blob/ac060c2476ba8b323ca932eda97da9bc0c051b34/lib/effect-registry.coffee | 51 | 60 |
JoelBesada/activate-power-mode:lib/effect-registry.coffee:1:raw_corpus | raw_corpus | {CompositeDisposable} = require "atom"
module.exports =
subscriptions: null
effects: []
effect: null
key: "activate-power-mode.particles.effect"
enable: ->
@subscriptions = new CompositeDisposable
@observeEffect()
@initList()
disable: ->
@subscriptions?.dispose()
@effectList?.dispose(... | CoffeeScript | JoelBesada/activate-power-mode | lib/effect-registry.coffee | MIT | fdf2e0a4c9f642422411591b1ff9f59ea8443f6a | 3,570 | https://github.com/JoelBesada/activate-power-mode/blob/fdf2e0a4c9f642422411591b1ff9f59ea8443f6a/lib/effect-registry.coffee | 1 | 50 | ||
JoelBesada/activate-power-mode:lib/effect-registry.coffee:1:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
{CompositeDisposable} = require "atom"
module.exports =
subscriptions: null
effects: []
effect: null
key: "activate-power-mode.particles.effect"
enable: ->
@subscriptions = new CompositeDisposable
@observeEffect()
@initList()
disable: -... | var CompositeDisposable;
({CompositeDisposable} = require("atom"));
module.exports = {
subscriptions: null,
effects: [],
effect: null,
key: "activate-power-mode.particles.effect",
enable: function() {
this.subscriptions = new CompositeDisposable();
this.observeEffect();
return this.initList();
... | CoffeeScript | JavaScript | JoelBesada/activate-power-mode | lib/effect-registry.coffee | MIT | fdf2e0a4c9f642422411591b1ff9f59ea8443f6a | 3,570 | https://github.com/JoelBesada/activate-power-mode/blob/fdf2e0a4c9f642422411591b1ff9f59ea8443f6a/lib/effect-registry.coffee | 1 | 50 |
JoelBesada/activate-power-mode:lib/effect-registry.coffee:1:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
var CompositeDisposable;
({CompositeDisposable} = require("atom"));
module.exports = {
subscriptions: null,
effects: [],
effect: null,
key: "activate-power-mode.particles.effect",
enable: function() {
this.subscriptions = new CompositeDisposable();
... | {CompositeDisposable} = require "atom"
module.exports =
subscriptions: null
effects: []
effect: null
key: "activate-power-mode.particles.effect"
enable: ->
@subscriptions = new CompositeDisposable
@observeEffect()
@initList()
disable: ->
@subscriptions?.dispose()
@effectList?.dispose(... | JavaScript | CoffeeScript | JoelBesada/activate-power-mode | lib/effect-registry.coffee | MIT | fdf2e0a4c9f642422411591b1ff9f59ea8443f6a | 3,570 | https://github.com/JoelBesada/activate-power-mode/blob/fdf2e0a4c9f642422411591b1ff9f59ea8443f6a/lib/effect-registry.coffee | 1 | 50 |
JoelBesada/activate-power-mode:lib/effect-registry.coffee:1:completion | completion | {CompositeDisposable} = require "atom"
module.exports =
subscriptions: null
effects: []
effect: null
key: "activate-power-mode.particles.effect"
enable: ->
@subscriptions = new CompositeDisposable
@observeEffect()
@initList()
disable: ->
@subscriptions?.dispose()
@effectList?.dispose(... | if atom.config.get(@key) is code
@effect = effect
observeEffect: ->
@subscriptions.add atom.config.observe(
@key, (code) =>
if @effects[code]?
effect = @effects[code]
else
effect = @effects['default']
@effect.disable()
@effect = effect
@effe... | CoffeeScript | CoffeeScript | JoelBesada/activate-power-mode | lib/effect-registry.coffee | MIT | fdf2e0a4c9f642422411591b1ff9f59ea8443f6a | 3,570 | https://github.com/JoelBesada/activate-power-mode/blob/fdf2e0a4c9f642422411591b1ff9f59ea8443f6a/lib/effect-registry.coffee | 1 | 50 |
JoelBesada/activate-power-mode:lib/effect-registry.coffee:1:raw_corpus | raw_corpus | {CompositeDisposable} = require "atom"
module.exports =
subscriptions: null
effects: []
effect: null
key: "activate-power-mode.particles.effect"
enable: ->
@subscriptions = new CompositeDisposable
@observeEffect()
@initList()
disable: ->
@subscriptions?.dispose()
@effectList?.dispose(... | CoffeeScript | JoelBesada/activate-power-mode | lib/effect-registry.coffee | MIT | 70cdc43d6acba3bde34121da4c0984bf0bf272fa | 3,570 | https://github.com/JoelBesada/activate-power-mode/blob/70cdc43d6acba3bde34121da4c0984bf0bf272fa/lib/effect-registry.coffee | 1 | 49 | ||
JoelBesada/activate-power-mode:lib/effect-registry.coffee:1:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
{CompositeDisposable} = require "atom"
module.exports =
subscriptions: null
effects: []
effect: null
key: "activate-power-mode.particles.effect"
enable: ->
@subscriptions = new CompositeDisposable
@observeEffect()
@initList()
disable: -... | var CompositeDisposable;
({CompositeDisposable} = require("atom"));
module.exports = {
subscriptions: null,
effects: [],
effect: null,
key: "activate-power-mode.particles.effect",
enable: function() {
this.subscriptions = new CompositeDisposable();
this.observeEffect();
return this.initList();
... | CoffeeScript | JavaScript | JoelBesada/activate-power-mode | lib/effect-registry.coffee | MIT | 70cdc43d6acba3bde34121da4c0984bf0bf272fa | 3,570 | https://github.com/JoelBesada/activate-power-mode/blob/70cdc43d6acba3bde34121da4c0984bf0bf272fa/lib/effect-registry.coffee | 1 | 49 |
JoelBesada/activate-power-mode:lib/effect-registry.coffee:1:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
var CompositeDisposable;
({CompositeDisposable} = require("atom"));
module.exports = {
subscriptions: null,
effects: [],
effect: null,
key: "activate-power-mode.particles.effect",
enable: function() {
this.subscriptions = new CompositeDisposable();
... | {CompositeDisposable} = require "atom"
module.exports =
subscriptions: null
effects: []
effect: null
key: "activate-power-mode.particles.effect"
enable: ->
@subscriptions = new CompositeDisposable
@observeEffect()
@initList()
disable: ->
@subscriptions?.dispose()
@effectList?.dispose(... | JavaScript | CoffeeScript | JoelBesada/activate-power-mode | lib/effect-registry.coffee | MIT | 70cdc43d6acba3bde34121da4c0984bf0bf272fa | 3,570 | https://github.com/JoelBesada/activate-power-mode/blob/70cdc43d6acba3bde34121da4c0984bf0bf272fa/lib/effect-registry.coffee | 1 | 49 |
JoelBesada/activate-power-mode:lib/effect-registry.coffee:1:completion | completion | {CompositeDisposable} = require "atom"
module.exports =
subscriptions: null
effects: []
effect: null
key: "activate-power-mode.particles.effect"
enable: ->
@subscriptions = new CompositeDisposable
@observeEffect()
@initList()
disable: ->
@subscriptions?.dispose()
@effectList?.dispose(... | if atom.config.get(@key) is code
@effect = effect
observeEffect: ->
@subscriptions.add atom.config.observe(
@key, (code) =>
if @effects[code]?
@effect = @effects[code]
else
@effect = @effects['default']
)
selectEffect: (code) ->
atom.config.set(@key, cod... | CoffeeScript | CoffeeScript | JoelBesada/activate-power-mode | lib/effect-registry.coffee | MIT | 70cdc43d6acba3bde34121da4c0984bf0bf272fa | 3,570 | https://github.com/JoelBesada/activate-power-mode/blob/70cdc43d6acba3bde34121da4c0984bf0bf272fa/lib/effect-registry.coffee | 1 | 49 |
mojotech/pioneer:test/integration/widgets/list_item.coffee:1:raw_corpus | raw_corpus | module.exports = ->
this.Widgets = this.Widgets || {}
return this.Widgets.ListItem = this.Widget.extend
getIdentity: ->
@getText().then (val) ->
'Iron Man' if val is 'Tony Stark' | CoffeeScript | mojotech/pioneer | test/integration/widgets/list_item.coffee | MIT | 2d3ade85e18e3ea1dfff2545bad4142aa9c496e4 | 523 | https://github.com/mojotech/pioneer/blob/2d3ade85e18e3ea1dfff2545bad4142aa9c496e4/test/integration/widgets/list_item.coffee | 1 | 8 | ||
mojotech/pioneer:test/integration/widgets/list_item.coffee:1:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
module.exports = ->
this.Widgets = this.Widgets || {}
return this.Widgets.ListItem = this.Widget.extend
getIdentity: ->
@getText().then (val) ->
'Iron Man' if val is 'Tony Stark'
``` | module.exports = function() {
this.Widgets = this.Widgets || {};
return this.Widgets.ListItem = this.Widget.extend({
getIdentity: function() {
return this.getText().then(function(val) {
if (val === 'Tony Stark') {
return 'Iron Man';
}
});
}
});
}; | CoffeeScript | JavaScript | mojotech/pioneer | test/integration/widgets/list_item.coffee | MIT | 2d3ade85e18e3ea1dfff2545bad4142aa9c496e4 | 523 | https://github.com/mojotech/pioneer/blob/2d3ade85e18e3ea1dfff2545bad4142aa9c496e4/test/integration/widgets/list_item.coffee | 1 | 8 |
mojotech/pioneer:test/integration/widgets/list_item.coffee:1:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
module.exports = function() {
this.Widgets = this.Widgets || {};
return this.Widgets.ListItem = this.Widget.extend({
getIdentity: function() {
return this.getText().then(function(val) {
if (val === 'Tony Stark') {
return 'Iron Man';
... | module.exports = ->
this.Widgets = this.Widgets || {}
return this.Widgets.ListItem = this.Widget.extend
getIdentity: ->
@getText().then (val) ->
'Iron Man' if val is 'Tony Stark' | JavaScript | CoffeeScript | mojotech/pioneer | test/integration/widgets/list_item.coffee | MIT | 2d3ade85e18e3ea1dfff2545bad4142aa9c496e4 | 523 | https://github.com/mojotech/pioneer/blob/2d3ade85e18e3ea1dfff2545bad4142aa9c496e4/test/integration/widgets/list_item.coffee | 1 | 8 |
mojotech/pioneer:test/integration/widgets/list_item.coffee:1:completion | completion | module.exports = ->
this.Widgets = this.Widgets || {}
return this.Widgets.ListItem = this.Widget.extend | getIdentity: ->
@getText().then (val) ->
'Iron Man' if val is 'Tony Stark' | CoffeeScript | CoffeeScript | mojotech/pioneer | test/integration/widgets/list_item.coffee | MIT | 2d3ade85e18e3ea1dfff2545bad4142aa9c496e4 | 523 | https://github.com/mojotech/pioneer/blob/2d3ade85e18e3ea1dfff2545bad4142aa9c496e4/test/integration/widgets/list_item.coffee | 1 | 8 |
jianliaoim/talk-os:talk-account/client/app/forcebind-mobile.coffee:1:raw_corpus | raw_corpus | React = require 'react'
Immutable = require 'immutable'
ajax = require '../ajax'
locales = require '../locales'
controllers = require '../controllers'
Space = React.createFactory require 'react-lite-space'
{div, button, span, a} = React.DOM
module.exports = React.createClass
displayName: 'forcebind-mobile'
pro... | CoffeeScript | jianliaoim/talk-os | talk-account/client/app/forcebind-mobile.coffee | MIT | 2545c4497865779a55762e03963a39237df9046b | 2,703 | https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-account/client/app/forcebind-mobile.coffee | 1 | 50 | ||
jianliaoim/talk-os:talk-account/client/app/forcebind-mobile.coffee:1:completion | completion | React = require 'react'
Immutable = require 'immutable'
ajax = require '../ajax'
locales = require '../locales'
controllers = require '../controllers'
Space = React.createFactory require 'react-lite-space'
{div, button, span, a} = React.DOM
module.exports = React.createClass
displayName: 'forcebind-mobile'
pro... | bindCode: @props.bindCode
success: (resp) =>
controllers.signInRedirect()
error: (err) =>
error = JSON.parse err.response
@setState error: error.message
onCancel: ->
controllers.signInRedirect()
render: ->
guideText = locales.get('mobileAlreayBoundWhetherForceBind', @pr... | CoffeeScript | CoffeeScript | jianliaoim/talk-os | talk-account/client/app/forcebind-mobile.coffee | MIT | 2545c4497865779a55762e03963a39237df9046b | 2,703 | https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-account/client/app/forcebind-mobile.coffee | 1 | 50 |
jianliaoim/talk-os:talk-account/client/app/forcebind-mobile.coffee:2:raw_corpus | raw_corpus | div className: 'as-line',
span className: 'hint-error', @state.error
Space height: 15
button className: 'button is-default', onClick: @onCancel,
locales.get('cancel', @props.language) | CoffeeScript | jianliaoim/talk-os | talk-account/client/app/forcebind-mobile.coffee | MIT | 2545c4497865779a55762e03963a39237df9046b | 2,703 | https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-account/client/app/forcebind-mobile.coffee | 51 | 55 | ||
jianliaoim/talk-os:talk-account/client/app/forcebind-mobile.coffee:2:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
div className: 'as-line',
span className: 'hint-error', @state.error
Space height: 15
button className: 'button is-default', onClick: @onCancel,
locales.get('cancel', @props.language)
``` | div({
className: 'as-line'
}, span({
className: 'hint-error'
}, this.state.error), Space({
height: 15
}));
button({
className: 'button is-default',
onClick: this.onCancel
}, locales.get('cancel', this.props.language)); | CoffeeScript | JavaScript | jianliaoim/talk-os | talk-account/client/app/forcebind-mobile.coffee | MIT | 2545c4497865779a55762e03963a39237df9046b | 2,703 | https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-account/client/app/forcebind-mobile.coffee | 51 | 55 |
jianliaoim/talk-os:talk-account/client/app/forcebind-mobile.coffee:2:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
div({
className: 'as-line'
}, span({
className: 'hint-error'
}, this.state.error), Space({
height: 15
}));
button({
className: 'button is-default',
onClick: this.onCancel
}, locales.get('cancel', this.props.language));
``` | div className: 'as-line',
span className: 'hint-error', @state.error
Space height: 15
button className: 'button is-default', onClick: @onCancel,
locales.get('cancel', @props.language) | JavaScript | CoffeeScript | jianliaoim/talk-os | talk-account/client/app/forcebind-mobile.coffee | MIT | 2545c4497865779a55762e03963a39237df9046b | 2,703 | https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-account/client/app/forcebind-mobile.coffee | 51 | 55 |
jianliaoim/talk-os:talk-account/client/app/forcebind-mobile.coffee:2:completion | completion | div className: 'as-line',
span className: 'hint-error', @state.error | Space height: 15
button className: 'button is-default', onClick: @onCancel,
locales.get('cancel', @props.language) | CoffeeScript | CoffeeScript | jianliaoim/talk-os | talk-account/client/app/forcebind-mobile.coffee | MIT | 2545c4497865779a55762e03963a39237df9046b | 2,703 | https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-account/client/app/forcebind-mobile.coffee | 51 | 55 |
cdglabs/apparatus:test/Link.test.coffee:1:raw_corpus | raw_corpus | test = require "tape"
Node = require "../src/Model/Node"
Link = require "../src/Model/Link"
test "Links point analogously", (t) ->
a = Node.createVariant()
b = Node.createVariant()
c = Node.createVariant()
a.addChild(b)
a.addChild(c)
a2 = a.createVariant()
[b2, c2] = a.children()
l = Link.createVari... | CoffeeScript | cdglabs/apparatus | test/Link.test.coffee | MIT | 107e0c2db5a0adf0f1c3b49f16f7625cff4e523b | 1,052 | https://github.com/cdglabs/apparatus/blob/107e0c2db5a0adf0f1c3b49f16f7625cff4e523b/test/Link.test.coffee | 1 | 32 | ||
cdglabs/apparatus:test/Link.test.coffee:1:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
test = require "tape"
Node = require "../src/Model/Node"
Link = require "../src/Model/Link"
test "Links point analogously", (t) ->
a = Node.createVariant()
b = Node.createVariant()
c = Node.createVariant()
a.addChild(b)
a.addChild(c)
a2 = a.createV... | var Link, Node, test;
test = require("tape");
Node = require("../src/Model/Node");
Link = require("../src/Model/Link");
test("Links point analogously", function(t) {
var a, a2, b, b2, c, c2, l, l2;
a = Node.createVariant();
b = Node.createVariant();
c = Node.createVariant();
a.addChild(b);
a.addChild(c)... | CoffeeScript | JavaScript | cdglabs/apparatus | test/Link.test.coffee | MIT | 107e0c2db5a0adf0f1c3b49f16f7625cff4e523b | 1,052 | https://github.com/cdglabs/apparatus/blob/107e0c2db5a0adf0f1c3b49f16f7625cff4e523b/test/Link.test.coffee | 1 | 32 |
cdglabs/apparatus:test/Link.test.coffee:1:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
var Link, Node, test;
test = require("tape");
Node = require("../src/Model/Node");
Link = require("../src/Model/Link");
test("Links point analogously", function(t) {
var a, a2, b, b2, c, c2, l, l2;
a = Node.createVariant();
b = Node.createVariant();
c =... | test = require "tape"
Node = require "../src/Model/Node"
Link = require "../src/Model/Link"
test "Links point analogously", (t) ->
a = Node.createVariant()
b = Node.createVariant()
c = Node.createVariant()
a.addChild(b)
a.addChild(c)
a2 = a.createVariant()
[b2, c2] = a.children()
l = Link.createVari... | JavaScript | CoffeeScript | cdglabs/apparatus | test/Link.test.coffee | MIT | 107e0c2db5a0adf0f1c3b49f16f7625cff4e523b | 1,052 | https://github.com/cdglabs/apparatus/blob/107e0c2db5a0adf0f1c3b49f16f7625cff4e523b/test/Link.test.coffee | 1 | 32 |
cdglabs/apparatus:test/Link.test.coffee:1:completion | completion | test = require "tape"
Node = require "../src/Model/Node"
Link = require "../src/Model/Link"
test "Links point analogously", (t) ->
a = Node.createVariant()
b = Node.createVariant()
c = Node.createVariant()
a.addChild(b)
a.addChild(c)
a2 = a.createVariant()
[b2, c2] = a.children()
l = Link.createVari... | b.addChild(l)
l.setTarget(c)
l2 = b2.children()[0]
t.equal(l2.target(), c2)
t.end()
###
TODO:
Test longer chains of variants (e.g. make a3)
### | CoffeeScript | CoffeeScript | cdglabs/apparatus | test/Link.test.coffee | MIT | 107e0c2db5a0adf0f1c3b49f16f7625cff4e523b | 1,052 | https://github.com/cdglabs/apparatus/blob/107e0c2db5a0adf0f1c3b49f16f7625cff4e523b/test/Link.test.coffee | 1 | 32 |
rs/pushd:tests/payload.coffee:1:raw_corpus | raw_corpus | should = require 'should'
Payload = require('../lib/payload').Payload
describe 'Payload', ->
describe 'when empty', =>
it 'should throw an error', =>
(=> new Payload({})).should.throw('Empty payload')
(=> new Payload('var.test': 'value')).should.throw('Empty payload')
(=... | CoffeeScript | rs/pushd | tests/payload.coffee | MIT | 9dc56de9da2a64903cad510d22d4d0e078a8ba0a | 1,157 | https://github.com/rs/pushd/blob/9dc56de9da2a64903cad510d22d4d0e078a8ba0a/tests/payload.coffee | 1 | 50 | ||
rs/pushd:tests/payload.coffee:1:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
should = require 'should'
Payload = require('../lib/payload').Payload
describe 'Payload', ->
describe 'when empty', =>
it 'should throw an error', =>
(=> new Payload({})).should.throw('Empty payload')
(=> new Payload('var.test... | var Payload, should;
should = require('should');
Payload = require('../lib/payload').Payload;
describe('Payload', function() {
describe('when empty', () => {
return it('should throw an error', () => {
(() => {
return new Payload({});
}).should.throw('Empty payload');
(() => {
... | CoffeeScript | JavaScript | rs/pushd | tests/payload.coffee | MIT | 9dc56de9da2a64903cad510d22d4d0e078a8ba0a | 1,157 | https://github.com/rs/pushd/blob/9dc56de9da2a64903cad510d22d4d0e078a8ba0a/tests/payload.coffee | 1 | 50 |
rs/pushd:tests/payload.coffee:1:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
var Payload, should;
should = require('should');
Payload = require('../lib/payload').Payload;
describe('Payload', function() {
describe('when empty', () => {
return it('should throw an error', () => {
(() => {
return new Payload({});
})... | should = require 'should'
Payload = require('../lib/payload').Payload
describe 'Payload', ->
describe 'when empty', =>
it 'should throw an error', =>
(=> new Payload({})).should.throw('Empty payload')
(=> new Payload('var.test': 'value')).should.throw('Empty payload')
(=... | JavaScript | CoffeeScript | rs/pushd | tests/payload.coffee | MIT | 9dc56de9da2a64903cad510d22d4d0e078a8ba0a | 1,157 | https://github.com/rs/pushd/blob/9dc56de9da2a64903cad510d22d4d0e078a8ba0a/tests/payload.coffee | 1 | 50 |
rs/pushd:tests/payload.coffee:1:completion | completion | should = require 'should'
Payload = require('../lib/payload').Payload
describe 'Payload', ->
describe 'when empty', =>
it 'should throw an error', =>
(=> new Payload({})).should.throw('Empty payload')
(=> new Payload('var.test': 'value')).should.throw('Empty payload')
(=... | payload = new Payload
title: 'my title'
'title.fr': 'mon titre'
'title.en_GB': 'my british title'
msg: 'my message'
'msg.fr': 'mon message'
'msg.fr_CA': 'mon message canadien'
it 'should fallback to default if no localization requested', =... | CoffeeScript | CoffeeScript | rs/pushd | tests/payload.coffee | MIT | 9dc56de9da2a64903cad510d22d4d0e078a8ba0a | 1,157 | https://github.com/rs/pushd/blob/9dc56de9da2a64903cad510d22d4d0e078a8ba0a/tests/payload.coffee | 1 | 50 |
rs/pushd:tests/payload.coffee:2:raw_corpus | raw_corpus | payload = new Payload('title.fr': 'hello ${var.name}')
(-> payload.compile()).should.throw 'The ${var.name} does not exist'
it 'should throw an error with invalid variable name', =>
payload = new Payload(title: 'hello ${name}', 'var.name': 'world')
(-> payload.compile()).sho... | CoffeeScript | rs/pushd | tests/payload.coffee | MIT | 9dc56de9da2a64903cad510d22d4d0e078a8ba0a | 1,157 | https://github.com/rs/pushd/blob/9dc56de9da2a64903cad510d22d4d0e078a8ba0a/tests/payload.coffee | 51 | 68 | ||
rs/pushd:tests/payload.coffee:2:completion | completion | payload = new Payload('title.fr': 'hello ${var.name}')
(-> payload.compile()).should.throw 'The ${var.name} does not exist'
it 'should throw an error with invalid variable name', =>
payload = new Payload(title: 'hello ${name}', 'var.name': 'world')
(-> payload.compile()).sho... | title: 'hello ${var.name}'
'var.name': 'world'
payload.localizedTitle().should.equal 'hello world'
it 'should resolve (data) variable correctly', =>
payload = new Payload
title: 'hello ${data.name}'
'data.name': 'world'
payload... | CoffeeScript | CoffeeScript | rs/pushd | tests/payload.coffee | MIT | 9dc56de9da2a64903cad510d22d4d0e078a8ba0a | 1,157 | https://github.com/rs/pushd/blob/9dc56de9da2a64903cad510d22d4d0e078a8ba0a/tests/payload.coffee | 51 | 68 |
rs/pushd:tests/payload.coffee:1:raw_corpus | raw_corpus | should = require 'should'
Payload = require('../lib/payload').Payload
describe 'Payload', ->
describe 'when empty', =>
it 'should throw an error', =>
(=> new Payload({})).should.throw('Empty payload')
(=> new Payload('var.test': 'value')).should.throw('Empty payload')
(=... | CoffeeScript | rs/pushd | tests/payload.coffee | MIT | e6124dc3cd21fb1a67702e92c169ca1ccc757469 | 1,157 | https://github.com/rs/pushd/blob/e6124dc3cd21fb1a67702e92c169ca1ccc757469/tests/payload.coffee | 1 | 50 | ||
rs/pushd:tests/payload.coffee:1:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
should = require 'should'
Payload = require('../lib/payload').Payload
describe 'Payload', ->
describe 'when empty', =>
it 'should throw an error', =>
(=> new Payload({})).should.throw('Empty payload')
(=> new Payload('var.test... | var Payload, should;
should = require('should');
Payload = require('../lib/payload').Payload;
describe('Payload', function() {
describe('when empty', () => {
return it('should throw an error', () => {
(() => {
return new Payload({});
}).should.throw('Empty payload');
(() => {
... | CoffeeScript | JavaScript | rs/pushd | tests/payload.coffee | MIT | e6124dc3cd21fb1a67702e92c169ca1ccc757469 | 1,157 | https://github.com/rs/pushd/blob/e6124dc3cd21fb1a67702e92c169ca1ccc757469/tests/payload.coffee | 1 | 50 |
rs/pushd:tests/payload.coffee:1:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
var Payload, should;
should = require('should');
Payload = require('../lib/payload').Payload;
describe('Payload', function() {
describe('when empty', () => {
return it('should throw an error', () => {
(() => {
return new Payload({});
})... | should = require 'should'
Payload = require('../lib/payload').Payload
describe 'Payload', ->
describe 'when empty', =>
it 'should throw an error', =>
(=> new Payload({})).should.throw('Empty payload')
(=> new Payload('var.test': 'value')).should.throw('Empty payload')
(=... | JavaScript | CoffeeScript | rs/pushd | tests/payload.coffee | MIT | e6124dc3cd21fb1a67702e92c169ca1ccc757469 | 1,157 | https://github.com/rs/pushd/blob/e6124dc3cd21fb1a67702e92c169ca1ccc757469/tests/payload.coffee | 1 | 50 |
rs/pushd:tests/payload.coffee:1:completion | completion | should = require 'should'
Payload = require('../lib/payload').Payload
describe 'Payload', ->
describe 'when empty', =>
it 'should throw an error', =>
(=> new Payload({})).should.throw('Empty payload')
(=> new Payload('var.test': 'value')).should.throw('Empty payload')
(=... | payload = new Payload
title: 'my title'
'title.fr': 'mon titre'
'title.en_GB': 'my british title'
msg: 'my message'
'msg.fr': 'mon message'
'msg.fr_CA': 'mon message canadien'
it 'should fallback to default if no localization requested', =... | CoffeeScript | CoffeeScript | rs/pushd | tests/payload.coffee | MIT | e6124dc3cd21fb1a67702e92c169ca1ccc757469 | 1,157 | https://github.com/rs/pushd/blob/e6124dc3cd21fb1a67702e92c169ca1ccc757469/tests/payload.coffee | 1 | 50 |
rs/pushd:tests/payload.coffee:1:raw_corpus | raw_corpus | should = require 'should'
Payload = require('../lib/payload').Payload
describe 'Payload', ->
describe 'when empty', =>
it 'should throw an error', =>
(=> new Payload({})).should.throw('Empty payload')
(=> new Payload('var.test': 'value')).should.throw('Empty payload')
(=... | CoffeeScript | rs/pushd | tests/payload.coffee | MIT | 8a1e841313d3b941bbc6ad8eabc58b80c55d3622 | 1,157 | https://github.com/rs/pushd/blob/8a1e841313d3b941bbc6ad8eabc58b80c55d3622/tests/payload.coffee | 1 | 50 | ||
rs/pushd:tests/payload.coffee:1:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
should = require 'should'
Payload = require('../lib/payload').Payload
describe 'Payload', ->
describe 'when empty', =>
it 'should throw an error', =>
(=> new Payload({})).should.throw('Empty payload')
(=> new Payload('var.test... | var Payload, should;
should = require('should');
Payload = require('../lib/payload').Payload;
describe('Payload', function() {
describe('when empty', () => {
return it('should throw an error', () => {
(() => {
return new Payload({});
}).should.throw('Empty payload');
(() => {
... | CoffeeScript | JavaScript | rs/pushd | tests/payload.coffee | MIT | 8a1e841313d3b941bbc6ad8eabc58b80c55d3622 | 1,157 | https://github.com/rs/pushd/blob/8a1e841313d3b941bbc6ad8eabc58b80c55d3622/tests/payload.coffee | 1 | 50 |
rs/pushd:tests/payload.coffee:1:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
var Payload, should;
should = require('should');
Payload = require('../lib/payload').Payload;
describe('Payload', function() {
describe('when empty', () => {
return it('should throw an error', () => {
(() => {
return new Payload({});
})... | should = require 'should'
Payload = require('../lib/payload').Payload
describe 'Payload', ->
describe 'when empty', =>
it 'should throw an error', =>
(=> new Payload({})).should.throw('Empty payload')
(=> new Payload('var.test': 'value')).should.throw('Empty payload')
(=... | JavaScript | CoffeeScript | rs/pushd | tests/payload.coffee | MIT | 8a1e841313d3b941bbc6ad8eabc58b80c55d3622 | 1,157 | https://github.com/rs/pushd/blob/8a1e841313d3b941bbc6ad8eabc58b80c55d3622/tests/payload.coffee | 1 | 50 |
rs/pushd:tests/payload.coffee:1:completion | completion | should = require 'should'
Payload = require('../lib/payload').Payload
describe 'Payload', ->
describe 'when empty', =>
it 'should throw an error', =>
(=> new Payload({})).should.throw('Empty payload')
(=> new Payload('var.test': 'value')).should.throw('Empty payload')
(=... | 'title.fr': 'mon titre'
'title.en_GB': 'my british title'
msg: 'my message'
'msg.fr': 'mon message'
'msg.fr_CA': 'mon message canadien'
it 'should fallback to default if no localization requested', =>
payload.localizedTitle().should.equal 'my title'
... | CoffeeScript | CoffeeScript | rs/pushd | tests/payload.coffee | MIT | 8a1e841313d3b941bbc6ad8eabc58b80c55d3622 | 1,157 | https://github.com/rs/pushd/blob/8a1e841313d3b941bbc6ad8eabc58b80c55d3622/tests/payload.coffee | 1 | 50 |
rs/pushd:tests/payload.coffee:2:raw_corpus | raw_corpus | it 'should throw an error with invalid variable name', =>
payload = new Payload(title: 'hello ${name}', 'var.name': 'world')
(-> payload.compile()).should.throw 'Invalid variable type for ${name}'
it 'should resolve (var) variable correctly', =>
payload = new Payload
... | CoffeeScript | rs/pushd | tests/payload.coffee | MIT | 8a1e841313d3b941bbc6ad8eabc58b80c55d3622 | 1,157 | https://github.com/rs/pushd/blob/8a1e841313d3b941bbc6ad8eabc58b80c55d3622/tests/payload.coffee | 51 | 66 | ||
rs/pushd:tests/payload.coffee:2:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
it 'should throw an error with invalid variable name', =>
payload = new Payload(title: 'hello ${name}', 'var.name': 'world')
(-> payload.compile()).should.throw 'Invalid variable type for ${name}'
it 'should resolve (var) variable... | it('should throw an error with invalid variable name', () => {
var payload;
payload = new Payload({
title: 'hello ${name}',
'var.name': 'world'
});
return (function() {
return payload.compile();
}).should.throw('Invalid variable type for ${name}');
});
it('should resolve (var) variable correctly'... | CoffeeScript | JavaScript | rs/pushd | tests/payload.coffee | MIT | 8a1e841313d3b941bbc6ad8eabc58b80c55d3622 | 1,157 | https://github.com/rs/pushd/blob/8a1e841313d3b941bbc6ad8eabc58b80c55d3622/tests/payload.coffee | 51 | 66 |
rs/pushd:tests/payload.coffee:2:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
it('should throw an error with invalid variable name', () => {
var payload;
payload = new Payload({
title: 'hello ${name}',
'var.name': 'world'
});
return (function() {
return payload.compile();
}).should.throw('Invalid variable type for ${nam... | it 'should throw an error with invalid variable name', =>
payload = new Payload(title: 'hello ${name}', 'var.name': 'world')
(-> payload.compile()).should.throw 'Invalid variable type for ${name}'
it 'should resolve (var) variable correctly', =>
payload = new Payload
... | JavaScript | CoffeeScript | rs/pushd | tests/payload.coffee | MIT | 8a1e841313d3b941bbc6ad8eabc58b80c55d3622 | 1,157 | https://github.com/rs/pushd/blob/8a1e841313d3b941bbc6ad8eabc58b80c55d3622/tests/payload.coffee | 51 | 66 |
rs/pushd:tests/payload.coffee:2:completion | completion | it 'should throw an error with invalid variable name', =>
payload = new Payload(title: 'hello ${name}', 'var.name': 'world')
(-> payload.compile()).should.throw 'Invalid variable type for ${name}'
it 'should resolve (var) variable correctly', =>
payload = new Payload
... | 'var.name': 'world'
payload.localizedTitle().should.equal 'hello world'
it 'should resolve (data) variable correctly', =>
payload = new Payload
title: 'hello ${data.name}'
'data.name': 'world'
payload.localizedTitle().should.equal 'hello world... | CoffeeScript | CoffeeScript | rs/pushd | tests/payload.coffee | MIT | 8a1e841313d3b941bbc6ad8eabc58b80c55d3622 | 1,157 | https://github.com/rs/pushd/blob/8a1e841313d3b941bbc6ad8eabc58b80c55d3622/tests/payload.coffee | 51 | 66 |
rs/pushd:tests/payload.coffee:2:raw_corpus | raw_corpus | it 'should throw an error with invalid variable name', =>
payload = new Payload(title: 'hello ${name}', 'var.name': 'world')
(-> payload.compile()).should.throw 'Invalid variable ${name}'
it 'should resolve (var) variable correctly', =>
payload = new Payload
... | CoffeeScript | rs/pushd | tests/payload.coffee | MIT | a00ee14233b2798b03dc085cdce78a86076a9be8 | 1,157 | https://github.com/rs/pushd/blob/a00ee14233b2798b03dc085cdce78a86076a9be8/tests/payload.coffee | 51 | 66 | ||
rs/pushd:tests/payload.coffee:2:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
it 'should throw an error with invalid variable name', =>
payload = new Payload(title: 'hello ${name}', 'var.name': 'world')
(-> payload.compile()).should.throw 'Invalid variable ${name}'
it 'should resolve (var) variable correctl... | it('should throw an error with invalid variable name', () => {
var payload;
payload = new Payload({
title: 'hello ${name}',
'var.name': 'world'
});
return (function() {
return payload.compile();
}).should.throw('Invalid variable ${name}');
});
it('should resolve (var) variable correctly', () => {... | CoffeeScript | JavaScript | rs/pushd | tests/payload.coffee | MIT | a00ee14233b2798b03dc085cdce78a86076a9be8 | 1,157 | https://github.com/rs/pushd/blob/a00ee14233b2798b03dc085cdce78a86076a9be8/tests/payload.coffee | 51 | 66 |
rs/pushd:tests/payload.coffee:2:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
it('should throw an error with invalid variable name', () => {
var payload;
payload = new Payload({
title: 'hello ${name}',
'var.name': 'world'
});
return (function() {
return payload.compile();
}).should.throw('Invalid variable ${name}');
});... | it 'should throw an error with invalid variable name', =>
payload = new Payload(title: 'hello ${name}', 'var.name': 'world')
(-> payload.compile()).should.throw 'Invalid variable ${name}'
it 'should resolve (var) variable correctly', =>
payload = new Payload
... | JavaScript | CoffeeScript | rs/pushd | tests/payload.coffee | MIT | a00ee14233b2798b03dc085cdce78a86076a9be8 | 1,157 | https://github.com/rs/pushd/blob/a00ee14233b2798b03dc085cdce78a86076a9be8/tests/payload.coffee | 51 | 66 |
rs/pushd:tests/payload.coffee:2:completion | completion | it 'should throw an error with invalid variable name', =>
payload = new Payload(title: 'hello ${name}', 'var.name': 'world')
(-> payload.compile()).should.throw 'Invalid variable ${name}'
it 'should resolve (var) variable correctly', =>
payload = new Payload
... | 'var.name': 'world'
payload.localizedTitle().should.equal 'hello world'
it 'should resolve (data) variable correctly', =>
payload = new Payload
title: 'hello ${data.name}'
'data.name': 'world'
payload.localizedTitle().should.equal 'hello world... | CoffeeScript | CoffeeScript | rs/pushd | tests/payload.coffee | MIT | a00ee14233b2798b03dc085cdce78a86076a9be8 | 1,157 | https://github.com/rs/pushd/blob/a00ee14233b2798b03dc085cdce78a86076a9be8/tests/payload.coffee | 51 | 66 |
rs/pushd:tests/payload.coffee:1:raw_corpus | raw_corpus | Payload = require('../lib/payload').Payload
exports.testEmptyPayload = (test) ->
test.expect(3)
test.throws =>
payload = new Payload({})
, Error, 'No keys is empty'
test.throws =>
payload = new Payload('var.test': 'value')
, Error, 'Only vars means empty'
test.throws =>
... | CoffeeScript | rs/pushd | tests/payload.coffee | MIT | 92fe686c4bb2787ebc2ddb533e55f548c406c291 | 1,157 | https://github.com/rs/pushd/blob/92fe686c4bb2787ebc2ddb533e55f548c406c291/tests/payload.coffee | 1 | 50 | ||
rs/pushd:tests/payload.coffee:1:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
Payload = require('../lib/payload').Payload
exports.testEmptyPayload = (test) ->
test.expect(3)
test.throws =>
payload = new Payload({})
, Error, 'No keys is empty'
test.throws =>
payload = new Payload('var.test': 'value')
, E... | var Payload;
Payload = require('../lib/payload').Payload;
exports.testEmptyPayload = function(test) {
test.expect(3);
test.throws(() => {
var payload;
return payload = new Payload({});
}, Error, 'No keys is empty');
test.throws(() => {
var payload;
return payload = new Payload({
'var.tes... | CoffeeScript | JavaScript | rs/pushd | tests/payload.coffee | MIT | 92fe686c4bb2787ebc2ddb533e55f548c406c291 | 1,157 | https://github.com/rs/pushd/blob/92fe686c4bb2787ebc2ddb533e55f548c406c291/tests/payload.coffee | 1 | 50 |
rs/pushd:tests/payload.coffee:1:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
var Payload;
Payload = require('../lib/payload').Payload;
exports.testEmptyPayload = function(test) {
test.expect(3);
test.throws(() => {
var payload;
return payload = new Payload({});
}, Error, 'No keys is empty');
test.throws(() => {
var pay... | Payload = require('../lib/payload').Payload
exports.testEmptyPayload = (test) ->
test.expect(3)
test.throws =>
payload = new Payload({})
, Error, 'No keys is empty'
test.throws =>
payload = new Payload('var.test': 'value')
, Error, 'Only vars means empty'
test.throws =>
... | JavaScript | CoffeeScript | rs/pushd | tests/payload.coffee | MIT | 92fe686c4bb2787ebc2ddb533e55f548c406c291 | 1,157 | https://github.com/rs/pushd/blob/92fe686c4bb2787ebc2ddb533e55f548c406c291/tests/payload.coffee | 1 | 50 |
rs/pushd:tests/payload.coffee:1:completion | completion | Payload = require('../lib/payload').Payload
exports.testEmptyPayload = (test) ->
test.expect(3)
test.throws =>
payload = new Payload({})
, Error, 'No keys is empty'
test.throws =>
payload = new Payload('var.test': 'value')
, Error, 'Only vars means empty'
test.throws =>
... | payload = new Payload(title: 'my title', msg: 'my message')
test.equal payload.localizedTitle('fr'), 'my title', 'Localized title fallback to default msg'
test.equal payload.localizedMessage('fr'), 'my message', 'Localized message fallback to default msg'
test.done()
exports.testLocalizedMessage = (test) -... | CoffeeScript | CoffeeScript | rs/pushd | tests/payload.coffee | MIT | 92fe686c4bb2787ebc2ddb533e55f548c406c291 | 1,157 | https://github.com/rs/pushd/blob/92fe686c4bb2787ebc2ddb533e55f548c406c291/tests/payload.coffee | 1 | 50 |
rs/pushd:tests/payload.coffee:2:raw_corpus | raw_corpus | payload = new Payload('title.fr': 'hello ${var.name}')
test.throws (=> payload.compile()), Error, 'Use undefined variable in a localized title'
payload = new Payload(title: 'hello ${name}', 'var.name': 'world')
test.throws (=> payload.compile()), Error, 'Invalid variable name'
payload = new Payload
... | CoffeeScript | rs/pushd | tests/payload.coffee | MIT | 92fe686c4bb2787ebc2ddb533e55f548c406c291 | 1,157 | https://github.com/rs/pushd/blob/92fe686c4bb2787ebc2ddb533e55f548c406c291/tests/payload.coffee | 51 | 68 | ||
rs/pushd:tests/payload.coffee:2:completion | completion | payload = new Payload('title.fr': 'hello ${var.name}')
test.throws (=> payload.compile()), Error, 'Use undefined variable in a localized title'
payload = new Payload(title: 'hello ${name}', 'var.name': 'world')
test.throws (=> payload.compile()), Error, 'Invalid variable name'
payload = new Payload
... | 'var.name': 'world'
test.equal payload.localizedTitle(), 'hello world', 'Variable in (var) resolves correctly'
payload = new Payload
title: 'hello ${data.name}'
'data.name': 'world'
test.equal payload.localizedTitle(), 'hello world', 'Variable in (data) resolves correctly'
test.done() | CoffeeScript | CoffeeScript | rs/pushd | tests/payload.coffee | MIT | 92fe686c4bb2787ebc2ddb533e55f548c406c291 | 1,157 | https://github.com/rs/pushd/blob/92fe686c4bb2787ebc2ddb533e55f548c406c291/tests/payload.coffee | 51 | 68 |
jnordberg/wintersmith:src/templates.coffee:1:raw_corpus | raw_corpus | async = require 'async'
path = require 'path'
glob = require 'glob'
{logger, extend} = require './common'
templatePlugins = []
registerTemplatePlugin = (pattern, plugin) ->
### add a template *plugin*, all files in the template directory matching the
glob *pattern* will be passed to the plugins fromFile funct... | CoffeeScript | jnordberg/wintersmith | src/templates.coffee | MIT | b1cf60766da8770e11761777c87afaa72388ca5c | 3,484 | https://github.com/jnordberg/wintersmith/blob/b1cf60766da8770e11761777c87afaa72388ca5c/src/templates.coffee | 1 | 50 | ||
jnordberg/wintersmith:src/templates.coffee:1:completion | completion | async = require 'async'
path = require 'path'
glob = require 'glob'
{logger, extend} = require './common'
templatePlugins = []
registerTemplatePlugin = (pattern, plugin) ->
### add a template *plugin*, all files in the template directory matching the
glob *pattern* will be passed to the plugins fromFile funct... | loadTemplates = (location, callback) ->
### load and compile all templates found in *location*
returns map of templates {name: <TemplatePlugin> instance} ###
rv = {}
# glob options
opts =
cwd: location
nosort: true
loadPluginTemplates = (plugin, callback) ->
### scans *location* and loads a... | CoffeeScript | CoffeeScript | jnordberg/wintersmith | src/templates.coffee | MIT | b1cf60766da8770e11761777c87afaa72388ca5c | 3,484 | https://github.com/jnordberg/wintersmith/blob/b1cf60766da8770e11761777c87afaa72388ca5c/src/templates.coffee | 1 | 50 |
jnordberg/wintersmith:src/templates.coffee:2:raw_corpus | raw_corpus | async.apply async.map, templatePlugins, loadPluginTemplates
(result, callback) ->
templates = {}
extend templates, t for t in result
callback null, templates
], callback
module.exports.loadTemplates = loadTemplates
module.exports.TemplatePlugin = TemplatePlugin
module.exports.registerTemplatePl... | CoffeeScript | jnordberg/wintersmith | src/templates.coffee | MIT | b1cf60766da8770e11761777c87afaa72388ca5c | 3,484 | https://github.com/jnordberg/wintersmith/blob/b1cf60766da8770e11761777c87afaa72388ca5c/src/templates.coffee | 51 | 60 | ||
jnordberg/wintersmith:src/templates.coffee:2:completion | completion | async.apply async.map, templatePlugins, loadPluginTemplates
(result, callback) ->
templates = {}
extend templates, t for t in result
callback null, templates | ], callback
module.exports.loadTemplates = loadTemplates
module.exports.TemplatePlugin = TemplatePlugin
module.exports.registerTemplatePlugin = registerTemplatePlugin | CoffeeScript | CoffeeScript | jnordberg/wintersmith | src/templates.coffee | MIT | b1cf60766da8770e11761777c87afaa72388ca5c | 3,484 | https://github.com/jnordberg/wintersmith/blob/b1cf60766da8770e11761777c87afaa72388ca5c/src/templates.coffee | 51 | 60 |
jnordberg/wintersmith:src/templates.coffee:1:raw_corpus | raw_corpus | async = require 'async'
path = require 'path'
glob = require 'glob'
{logger, extend} = require './common'
templatePlugins = []
registerTemplatePlugin = (pattern, plugin) ->
### add a template *plugin*, all files in the template directory matching the
glob *pattern* will be passed to the plugins fromFile funct... | CoffeeScript | jnordberg/wintersmith | src/templates.coffee | MIT | e7103a13959793d8cf6299c3118c4647ec9c6c45 | 3,484 | https://github.com/jnordberg/wintersmith/blob/e7103a13959793d8cf6299c3118c4647ec9c6c45/src/templates.coffee | 1 | 50 | ||
jnordberg/wintersmith:src/templates.coffee:1:completion | completion | async = require 'async'
path = require 'path'
glob = require 'glob'
{logger, extend} = require './common'
templatePlugins = []
registerTemplatePlugin = (pattern, plugin) ->
### add a template *plugin*, all files in the template directory matching the
glob *pattern* will be passed to the plugins fromFile funct... | loadTemplates = (location, callback) ->
### load and compile all templates found in *location*
returns map of templates {name: <TemplatePlugin> instance} ###
rv = {}
# glob options
opts =
cwd: location
nosort: true
loadPluginTemplates = (plugin, callback) ->
async.waterfall [
async.ap... | CoffeeScript | CoffeeScript | jnordberg/wintersmith | src/templates.coffee | MIT | e7103a13959793d8cf6299c3118c4647ec9c6c45 | 3,484 | https://github.com/jnordberg/wintersmith/blob/e7103a13959793d8cf6299c3118c4647ec9c6c45/src/templates.coffee | 1 | 50 |
jnordberg/wintersmith:src/templates.coffee:2:raw_corpus | raw_corpus | (result, callback) ->
templates = {}
extend templates, t for t in result
callback null, templates
], callback
module.exports.loadTemplates = loadTemplates
module.exports.TemplatePlugin = TemplatePlugin
module.exports.registerTemplatePlugin = registerTemplatePlugin | CoffeeScript | jnordberg/wintersmith | src/templates.coffee | MIT | e7103a13959793d8cf6299c3118c4647ec9c6c45 | 3,484 | https://github.com/jnordberg/wintersmith/blob/e7103a13959793d8cf6299c3118c4647ec9c6c45/src/templates.coffee | 51 | 59 | ||
jnordberg/wintersmith:src/templates.coffee:2:completion | completion | (result, callback) ->
templates = {}
extend templates, t for t in result
callback null, templates | ], callback
module.exports.loadTemplates = loadTemplates
module.exports.TemplatePlugin = TemplatePlugin
module.exports.registerTemplatePlugin = registerTemplatePlugin | CoffeeScript | CoffeeScript | jnordberg/wintersmith | src/templates.coffee | MIT | e7103a13959793d8cf6299c3118c4647ec9c6c45 | 3,484 | https://github.com/jnordberg/wintersmith/blob/e7103a13959793d8cf6299c3118c4647ec9c6c45/src/templates.coffee | 51 | 59 |
jnordberg/wintersmith:src/templates.coffee:1:raw_corpus | raw_corpus | async = require 'async'
path = require 'path'
glob = require 'glob'
{logger, extend} = require './common'
templatePlugins = []
registerTemplatePlugin = (pattern, plugin) ->
### add a template *plugin*, all files in the template directory matching the
glob *pattern* will be passed to the plugins fromFile funct... | CoffeeScript | jnordberg/wintersmith | src/templates.coffee | MIT | 98712ce0ad2b01ae2c5fa855d0e41d8b82c45f64 | 3,484 | https://github.com/jnordberg/wintersmith/blob/98712ce0ad2b01ae2c5fa855d0e41d8b82c45f64/src/templates.coffee | 1 | 50 | ||
jnordberg/wintersmith:src/templates.coffee:1:completion | completion | async = require 'async'
path = require 'path'
glob = require 'glob'
{logger, extend} = require './common'
templatePlugins = []
registerTemplatePlugin = (pattern, plugin) ->
### add a template *plugin*, all files in the template directory matching the
glob *pattern* will be passed to the plugins fromFile funct... | loadTemplates = (location, callback) ->
### load and compile all templates found in *location*
returns map of templates {name: <TemplatePlugin> instance} ###
rv = {}
# glob options
opts =
cwd: location
nosort: true
loadPluginTemplates = (plugin, callback) ->
async.waterfall [
async.ap... | CoffeeScript | CoffeeScript | jnordberg/wintersmith | src/templates.coffee | MIT | 98712ce0ad2b01ae2c5fa855d0e41d8b82c45f64 | 3,484 | https://github.com/jnordberg/wintersmith/blob/98712ce0ad2b01ae2c5fa855d0e41d8b82c45f64/src/templates.coffee | 1 | 50 |
jnordberg/wintersmith:src/templates.coffee:1:raw_corpus | raw_corpus | fs = require 'fs'
jade = require 'jade'
async = require 'async'
path = require 'path'
glob = require 'glob'
{logger} = require './common'
compileTemplate = (filename, callback) ->
### read template from disk and compile
returns compiled template ###
async.waterfall [
(callback) ->
fs.readFile file... | CoffeeScript | jnordberg/wintersmith | src/templates.coffee | MIT | e667052259e523500a81ff104ea46f132acb1e04 | 3,484 | https://github.com/jnordberg/wintersmith/blob/e667052259e523500a81ff104ea46f132acb1e04/src/templates.coffee | 1 | 50 | ||
jnordberg/wintersmith:src/templates.coffee:1:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
fs = require 'fs'
jade = require 'jade'
async = require 'async'
path = require 'path'
glob = require 'glob'
{logger} = require './common'
compileTemplate = (filename, callback) ->
### read template from disk and compile
returns compiled template ###
a... | var async, compileTemplate, fs, glob, jade, loadTemplates, logger, path;
fs = require('fs');
jade = require('jade');
async = require('async');
path = require('path');
glob = require('glob');
({logger} = require('./common'));
compileTemplate = function(filename, callback) {
/* read template from disk and compil... | CoffeeScript | JavaScript | jnordberg/wintersmith | src/templates.coffee | MIT | e667052259e523500a81ff104ea46f132acb1e04 | 3,484 | https://github.com/jnordberg/wintersmith/blob/e667052259e523500a81ff104ea46f132acb1e04/src/templates.coffee | 1 | 50 |
jnordberg/wintersmith:src/templates.coffee:1:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
var async, compileTemplate, fs, glob, jade, loadTemplates, logger, path;
fs = require('fs');
jade = require('jade');
async = require('async');
path = require('path');
glob = require('glob');
({logger} = require('./common'));
compileTemplate = function(filena... | fs = require 'fs'
jade = require 'jade'
async = require 'async'
path = require 'path'
glob = require 'glob'
{logger} = require './common'
compileTemplate = (filename, callback) ->
### read template from disk and compile
returns compiled template ###
async.waterfall [
(callback) ->
fs.readFile file... | JavaScript | CoffeeScript | jnordberg/wintersmith | src/templates.coffee | MIT | e667052259e523500a81ff104ea46f132acb1e04 | 3,484 | https://github.com/jnordberg/wintersmith/blob/e667052259e523500a81ff104ea46f132acb1e04/src/templates.coffee | 1 | 50 |
jnordberg/wintersmith:src/templates.coffee:1:completion | completion | fs = require 'fs'
jade = require 'jade'
async = require 'async'
path = require 'path'
glob = require 'glob'
{logger} = require './common'
compileTemplate = (filename, callback) ->
### read template from disk and compile
returns compiled template ###
async.waterfall [
(callback) ->
fs.readFile file... | ### load and compile all templates found in *location*
returns map of templates {name: fn} ###
rv = {}
# glob options
opts =
cwd: location
nosort: true
async.waterfall [
async.apply glob, '**/*.jade', opts
(files, callback) ->
async.filter files, (filename, callback) ->
# exc... | CoffeeScript | CoffeeScript | jnordberg/wintersmith | src/templates.coffee | MIT | e667052259e523500a81ff104ea46f132acb1e04 | 3,484 | https://github.com/jnordberg/wintersmith/blob/e667052259e523500a81ff104ea46f132acb1e04/src/templates.coffee | 1 | 50 |
jianliaoim/talk-os:talk-api2x/server/controllers/mail.coffee:1:raw_corpus | raw_corpus | module.exports = mailController = app.controller 'mail', ->
@ensure '_teamId', only: 'invite dm'
@ensure '_toId', only: 'dm'
@ensure '_roomId', only: 'rm'
@action 'render', (req, res, callback) ->
{type} = req.get()
if @[type] then @[type].apply(this, arguments) else callback(new Err('NO_PERMISSION'))... | CoffeeScript | jianliaoim/talk-os | talk-api2x/server/controllers/mail.coffee | MIT | 2545c4497865779a55762e03963a39237df9046b | 2,703 | https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-api2x/server/controllers/mail.coffee | 19 | 68 | ||
jianliaoim/talk-os:talk-api2x/server/controllers/mail.coffee:1:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
module.exports = mailController = app.controller 'mail', ->
@ensure '_teamId', only: 'invite dm'
@ensure '_toId', only: 'dm'
@ensure '_roomId', only: 'rm'
@action 'render', (req, res, callback) ->
{type} = req.get()
if @[type] then @[type].apply... | var mailController;
module.exports = mailController = app.controller('mail', function() {
this.ensure('_teamId', {
only: 'invite dm'
});
this.ensure('_toId', {
only: 'dm'
});
this.ensure('_roomId', {
only: 'rm'
});
this.action('render', function(req, res, callback) {
var type;
({type}... | CoffeeScript | JavaScript | jianliaoim/talk-os | talk-api2x/server/controllers/mail.coffee | MIT | 2545c4497865779a55762e03963a39237df9046b | 2,703 | https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-api2x/server/controllers/mail.coffee | 19 | 68 |
jianliaoim/talk-os:talk-api2x/server/controllers/mail.coffee:1:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
var mailController;
module.exports = mailController = app.controller('mail', function() {
this.ensure('_teamId', {
only: 'invite dm'
});
this.ensure('_toId', {
only: 'dm'
});
this.ensure('_roomId', {
only: 'rm'
});
this.action('render', f... | module.exports = mailController = app.controller 'mail', ->
@ensure '_teamId', only: 'invite dm'
@ensure '_toId', only: 'dm'
@ensure '_roomId', only: 'rm'
@action 'render', (req, res, callback) ->
{type} = req.get()
if @[type] then @[type].apply(this, arguments) else callback(new Err('NO_PERMISSION'))... | JavaScript | CoffeeScript | jianliaoim/talk-os | talk-api2x/server/controllers/mail.coffee | MIT | 2545c4497865779a55762e03963a39237df9046b | 2,703 | https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-api2x/server/controllers/mail.coffee | 19 | 68 |
jianliaoim/talk-os:talk-api2x/server/controllers/mail.coffee:1:completion | completion | module.exports = mailController = app.controller 'mail', ->
@ensure '_teamId', only: 'invite dm'
@ensure '_toId', only: 'dm'
@ensure '_roomId', only: 'rm'
@action 'render', (req, res, callback) ->
{type} = req.get()
if @[type] then @[type].apply(this, arguments) else callback(new Err('NO_PERMISSION'))... | Promise.all [userPromise, senderPromise, teamPromise, messagePromise]
.then ([user, sender, team, messages]) ->
messages = messages.map (message) ->
message.formatedDate = moment(new Date(message.createdAt)).format('HH:mm')
message
email.messages = messages
email.user = user
... | CoffeeScript | CoffeeScript | jianliaoim/talk-os | talk-api2x/server/controllers/mail.coffee | MIT | 2545c4497865779a55762e03963a39237df9046b | 2,703 | https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-api2x/server/controllers/mail.coffee | 19 | 68 |
jianliaoim/talk-os:talk-api2x/server/controllers/mail.coffee:2:raw_corpus | raw_corpus | {_sessionUserId, _roomId} = req.get()
email = {}
userPromise = UserModel.findOneAsync _id: _sessionUserId
messagePromise = MessageModel.findMessagesFromRoomAsync _roomId, { isSystem: false, limit: 20 }
roomPromise = RoomModel.findOneAsync _id: _roomId
Promise.all [userPromise, roomPromise, message... | CoffeeScript | jianliaoim/talk-os | talk-api2x/server/controllers/mail.coffee | MIT | 2545c4497865779a55762e03963a39237df9046b | 2,703 | https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-api2x/server/controllers/mail.coffee | 69 | 118 | ||
jianliaoim/talk-os:talk-api2x/server/controllers/mail.coffee:2:completion | completion | {_sessionUserId, _roomId} = req.get()
email = {}
userPromise = UserModel.findOneAsync _id: _sessionUserId
messagePromise = MessageModel.findMessagesFromRoomAsync _roomId, { isSystem: false, limit: 20 }
roomPromise = RoomModel.findOneAsync _id: _roomId
Promise.all [userPromise, roomPromise, message... | * Guest message
* @param {[type]} req [description]
* @param {[type]} res [description]
* @return {[type]} [description]
###
@action 'gm', (req, res, callback) ->
{_sessionUserId, _roomId} = req.get()
email = {}
userPromise = UserModel.findOneAsync _id: _sessionUserId
messagePromise ... | CoffeeScript | CoffeeScript | jianliaoim/talk-os | talk-api2x/server/controllers/mail.coffee | MIT | 2545c4497865779a55762e03963a39237df9046b | 2,703 | https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-api2x/server/controllers/mail.coffee | 69 | 118 |
jianliaoim/talk-os:talk-api2x/server/controllers/mail.coffee:3:raw_corpus | raw_corpus | mailers.gmMailer._render email
.then (email) -> res.end email.html
@action 'invite', (req, res, callback) ->
{_sessionUserId, _teamId} = req.get()
userPromise = UserModel.findOneAsync _id: _sessionUserId
teamPromise = TeamModel.findOneAsync _id: _teamId
email = {}
Promise.all [userPromise... | CoffeeScript | jianliaoim/talk-os | talk-api2x/server/controllers/mail.coffee | MIT | 2545c4497865779a55762e03963a39237df9046b | 2,703 | https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-api2x/server/controllers/mail.coffee | 119 | 157 | ||
jianliaoim/talk-os:talk-api2x/server/controllers/mail.coffee:3:completion | completion | mailers.gmMailer._render email
.then (email) -> res.end email.html
@action 'invite', (req, res, callback) ->
{_sessionUserId, _teamId} = req.get()
userPromise = UserModel.findOneAsync _id: _sessionUserId
teamPromise = TeamModel.findOneAsync _id: _teamId
email = {}
Promise.all [userPromise... | mailers.inviteMailer._render email
.then (email) -> res.end email.html
@action 'login', (req, res, callback) ->
{_sessionUserId} = req.get()
userPromise = UserModel.findOneAsync _id: _sessionUserId
email = {}
Promise.all [userPromise]
.then ([user]) ->
email.user = user
email.... | CoffeeScript | CoffeeScript | jianliaoim/talk-os | talk-api2x/server/controllers/mail.coffee | MIT | 2545c4497865779a55762e03963a39237df9046b | 2,703 | https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-api2x/server/controllers/mail.coffee | 119 | 157 |
mojs/mojs:src/shapes/circle.coffee:1:raw_corpus | raw_corpus | # ignore coffescript sudo code
Bit = require('./bit').default
class Circle extends Bit
_declareDefaults: ->
super()
@_defaults.shape = 'ellipse'
_draw:->
rx = if @_props.radiusX? then @_props.radiusX else @_props.radius
ry = if @_props.radiusY? then @_props.radiusY else @_props.radius
@_setAt... | CoffeeScript | mojs/mojs | src/shapes/circle.coffee | MIT | 0a9cf9a87dd5637e6fa770755e79048489bcf817 | 18,698 | https://github.com/mojs/mojs/blob/0a9cf9a87dd5637e6fa770755e79048489bcf817/src/shapes/circle.coffee | 1 | 28 | ||
mojs/mojs:src/shapes/circle.coffee:1:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
# ignore coffescript sudo code
Bit = require('./bit').default
class Circle extends Bit
_declareDefaults: ->
super()
@_defaults.shape = 'ellipse'
_draw:->
rx = if @_props.radiusX? then @_props.radiusX else @_props.radius
ry = if @_props.radi... | // ignore coffescript sudo code
var Bit, Circle;
Bit = require('./bit').default;
Circle = class Circle extends Bit {
_declareDefaults() {
super._declareDefaults();
return this._defaults.shape = 'ellipse';
}
_draw() {
var rx, ry;
rx = this._props.radiusX != null ? this._props.radiusX : this._pro... | CoffeeScript | JavaScript | mojs/mojs | src/shapes/circle.coffee | MIT | 0a9cf9a87dd5637e6fa770755e79048489bcf817 | 18,698 | https://github.com/mojs/mojs/blob/0a9cf9a87dd5637e6fa770755e79048489bcf817/src/shapes/circle.coffee | 1 | 28 |
mojs/mojs:src/shapes/circle.coffee:1:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
// ignore coffescript sudo code
var Bit, Circle;
Bit = require('./bit').default;
Circle = class Circle extends Bit {
_declareDefaults() {
super._declareDefaults();
return this._defaults.shape = 'ellipse';
}
_draw() {
var rx, ry;
rx = this._... | # ignore coffescript sudo code
Bit = require('./bit').default
class Circle extends Bit
_declareDefaults: ->
super()
@_defaults.shape = 'ellipse'
_draw:->
rx = if @_props.radiusX? then @_props.radiusX else @_props.radius
ry = if @_props.radiusY? then @_props.radiusY else @_props.radius
@_setAt... | JavaScript | CoffeeScript | mojs/mojs | src/shapes/circle.coffee | MIT | 0a9cf9a87dd5637e6fa770755e79048489bcf817 | 18,698 | https://github.com/mojs/mojs/blob/0a9cf9a87dd5637e6fa770755e79048489bcf817/src/shapes/circle.coffee | 1 | 28 |
mojs/mojs:src/shapes/circle.coffee:1:completion | completion | # ignore coffescript sudo code
Bit = require('./bit').default
class Circle extends Bit
_declareDefaults: ->
super()
@_defaults.shape = 'ellipse'
_draw:->
rx = if @_props.radiusX? then @_props.radiusX else @_props.radius
ry = if @_props.radiusY? then @_props.radiusY else @_props.radius
@_setAt... | @_setAttrIfChanged 'cx', @_props.width/2
@_setAttrIfChanged 'cy', @_props.height/2
# @_setAttrIfChanged 'cx', @_props.width/2
# @_setAttrIfChanged 'cy', @_props.height/2
# @setAttrsIfChanged rx: rx, ry: ry, cx: @_props.x, cy: @_props.y
super()
_getLength:->
radiusX = if @_props.radiusX? then @... | CoffeeScript | CoffeeScript | mojs/mojs | src/shapes/circle.coffee | MIT | 0a9cf9a87dd5637e6fa770755e79048489bcf817 | 18,698 | https://github.com/mojs/mojs/blob/0a9cf9a87dd5637e6fa770755e79048489bcf817/src/shapes/circle.coffee | 1 | 28 |
mojs/mojs:src/shapes/circle.coffee:1:raw_corpus | raw_corpus | # ignore coffescript sudo code
Bit = require('./bit').default
class Circle extends Bit
_declareDefaults: ->
super
@_defaults.shape = 'ellipse'
_draw:->
rx = if @_props.radiusX? then @_props.radiusX else @_props.radius
ry = if @_props.radiusY? then @_props.radiusY else @_props.radius
@_setAttr... | CoffeeScript | mojs/mojs | src/shapes/circle.coffee | MIT | 7c34e766d9b361898a59adbc753862fa95de182a | 18,698 | https://github.com/mojs/mojs/blob/7c34e766d9b361898a59adbc753862fa95de182a/src/shapes/circle.coffee | 1 | 28 | ||
mojs/mojs:src/shapes/circle.coffee:1:completion | completion | # ignore coffescript sudo code
Bit = require('./bit').default
class Circle extends Bit
_declareDefaults: ->
super
@_defaults.shape = 'ellipse'
_draw:->
rx = if @_props.radiusX? then @_props.radiusX else @_props.radius
ry = if @_props.radiusY? then @_props.radiusY else @_props.radius
@_setAttr... | @_setAttrIfChanged 'cx', @_props.width/2
@_setAttrIfChanged 'cy', @_props.height/2
# @_setAttrIfChanged 'cx', @_props.width/2
# @_setAttrIfChanged 'cy', @_props.height/2
# @setAttrsIfChanged rx: rx, ry: ry, cx: @_props.x, cy: @_props.y
super
_getLength:->
radiusX = if @_props.radiusX? then @_p... | CoffeeScript | CoffeeScript | mojs/mojs | src/shapes/circle.coffee | MIT | 7c34e766d9b361898a59adbc753862fa95de182a | 18,698 | https://github.com/mojs/mojs/blob/7c34e766d9b361898a59adbc753862fa95de182a/src/shapes/circle.coffee | 1 | 28 |
mojs/mojs:src/shapes/circle.coffee:1:raw_corpus | raw_corpus | # ignore coffescript sudo code
Bit = require('./bit').default or require('./bit');
class Circle extends Bit
_declareDefaults: ->
super
@_defaults.shape = 'ellipse'
_draw:->
rx = if @_props.radiusX? then @_props.radiusX else @_props.radius
ry = if @_props.radiusY? then @_props.radiusY else @_props... | CoffeeScript | mojs/mojs | src/shapes/circle.coffee | MIT | 768850a20165488e3098a3003b153e905266dac8 | 18,698 | https://github.com/mojs/mojs/blob/768850a20165488e3098a3003b153e905266dac8/src/shapes/circle.coffee | 1 | 28 | ||
mojs/mojs:src/shapes/circle.coffee:1:completion | completion | # ignore coffescript sudo code
Bit = require('./bit').default or require('./bit');
class Circle extends Bit
_declareDefaults: ->
super
@_defaults.shape = 'ellipse'
_draw:->
rx = if @_props.radiusX? then @_props.radiusX else @_props.radius
ry = if @_props.radiusY? then @_props.radiusY else @_props... | @_setAttrIfChanged 'cx', @_props.width/2
@_setAttrIfChanged 'cy', @_props.height/2
# @_setAttrIfChanged 'cx', @_props.width/2
# @_setAttrIfChanged 'cy', @_props.height/2
# @setAttrsIfChanged rx: rx, ry: ry, cx: @_props.x, cy: @_props.y
super
_getLength:->
radiusX = if @_props.radiusX? then @_p... | CoffeeScript | CoffeeScript | mojs/mojs | src/shapes/circle.coffee | MIT | 768850a20165488e3098a3003b153e905266dac8 | 18,698 | https://github.com/mojs/mojs/blob/768850a20165488e3098a3003b153e905266dac8/src/shapes/circle.coffee | 1 | 28 |
octoblu/meshblu:lib/doMessageHooks.coffee:1:raw_corpus | raw_corpus | _ = require 'lodash'
async = require 'async'
debug = require('debug')('meshblu:doMessageHooks')
module.exports = (device, hooks, message, callback=_.noop, dependencies={}) ->
MessageWebhook = dependencies.MessageWebhook ? require './MessageWebhook'
hooks ?= []
async.map hooks, (hook, cb=->) =>
options =
... | CoffeeScript | octoblu/meshblu | lib/doMessageHooks.coffee | MIT | 0b4a5f0233ed1ad2bd0447db99ef92ca89866069 | 815 | https://github.com/octoblu/meshblu/blob/0b4a5f0233ed1ad2bd0447db99ef92ca89866069/lib/doMessageHooks.coffee | 1 | 20 | ||
octoblu/meshblu:lib/doMessageHooks.coffee:1:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
_ = require 'lodash'
async = require 'async'
debug = require('debug')('meshblu:doMessageHooks')
module.exports = (device, hooks, message, callback=_.noop, dependencies={}) ->
MessageWebhook = dependencies.MessageWebhook ? require './MessageWebhook'
hooks ?= ... | var _, async, debug;
_ = require('lodash');
async = require('async');
debug = require('debug')('meshblu:doMessageHooks');
module.exports = function(device, hooks, message, callback = _.noop, dependencies = {}) {
var MessageWebhook, ref;
MessageWebhook = (ref = dependencies.MessageWebhook) != null ? ref : requir... | CoffeeScript | JavaScript | octoblu/meshblu | lib/doMessageHooks.coffee | MIT | 0b4a5f0233ed1ad2bd0447db99ef92ca89866069 | 815 | https://github.com/octoblu/meshblu/blob/0b4a5f0233ed1ad2bd0447db99ef92ca89866069/lib/doMessageHooks.coffee | 1 | 20 |
octoblu/meshblu:lib/doMessageHooks.coffee:1:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
var _, async, debug;
_ = require('lodash');
async = require('async');
debug = require('debug')('meshblu:doMessageHooks');
module.exports = function(device, hooks, message, callback = _.noop, dependencies = {}) {
var MessageWebhook, ref;
MessageWebhook = (re... | _ = require 'lodash'
async = require 'async'
debug = require('debug')('meshblu:doMessageHooks')
module.exports = (device, hooks, message, callback=_.noop, dependencies={}) ->
MessageWebhook = dependencies.MessageWebhook ? require './MessageWebhook'
hooks ?= []
async.map hooks, (hook, cb=->) =>
options =
... | JavaScript | CoffeeScript | octoblu/meshblu | lib/doMessageHooks.coffee | MIT | 0b4a5f0233ed1ad2bd0447db99ef92ca89866069 | 815 | https://github.com/octoblu/meshblu/blob/0b4a5f0233ed1ad2bd0447db99ef92ca89866069/lib/doMessageHooks.coffee | 1 | 20 |
octoblu/meshblu:lib/doMessageHooks.coffee:1:completion | completion | _ = require 'lodash'
async = require 'async'
debug = require('debug')('meshblu:doMessageHooks')
module.exports = (device, hooks, message, callback=_.noop, dependencies={}) ->
MessageWebhook = dependencies.MessageWebhook ? require './MessageWebhook'
hooks ?= []
async.map hooks, (hook, cb=->) =>
options = | uuid: device.uuid
options: hook
debug('messageHook', options)
messageWebhook = new MessageWebhook options
messageWebhook.send message, (error) =>
cb null, error
, (error, errors) =>
callback errors | CoffeeScript | CoffeeScript | octoblu/meshblu | lib/doMessageHooks.coffee | MIT | 0b4a5f0233ed1ad2bd0447db99ef92ca89866069 | 815 | https://github.com/octoblu/meshblu/blob/0b4a5f0233ed1ad2bd0447db99ef92ca89866069/lib/doMessageHooks.coffee | 1 | 20 |
octoblu/meshblu:lib/doMessageHooks.coffee:1:raw_corpus | raw_corpus | _ = require 'lodash'
async = require 'async'
module.exports = (device, hooks, message, callback=_.noop, dependencies={}) ->
MessageWebhook = dependencies.MessageWebhook ? require './MessageWebhook'
hooks ?= []
async.map hooks, (hook, cb=->) =>
options =
uuid: device.uuid
options: hook
messa... | CoffeeScript | octoblu/meshblu | lib/doMessageHooks.coffee | MIT | 398c56b5cc548bb75654e7e9072b88d5417bb18b | 815 | https://github.com/octoblu/meshblu/blob/398c56b5cc548bb75654e7e9072b88d5417bb18b/lib/doMessageHooks.coffee | 1 | 17 | ||
octoblu/meshblu:lib/doMessageHooks.coffee:1:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
_ = require 'lodash'
async = require 'async'
module.exports = (device, hooks, message, callback=_.noop, dependencies={}) ->
MessageWebhook = dependencies.MessageWebhook ? require './MessageWebhook'
hooks ?= []
async.map hooks, (hook, cb=->) =>
options... | var _, async;
_ = require('lodash');
async = require('async');
module.exports = function(device, hooks, message, callback = _.noop, dependencies = {}) {
var MessageWebhook, ref;
MessageWebhook = (ref = dependencies.MessageWebhook) != null ? ref : require('./MessageWebhook');
if (hooks == null) {
hooks = []... | CoffeeScript | JavaScript | octoblu/meshblu | lib/doMessageHooks.coffee | MIT | 398c56b5cc548bb75654e7e9072b88d5417bb18b | 815 | https://github.com/octoblu/meshblu/blob/398c56b5cc548bb75654e7e9072b88d5417bb18b/lib/doMessageHooks.coffee | 1 | 17 |
octoblu/meshblu:lib/doMessageHooks.coffee:1:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
var _, async;
_ = require('lodash');
async = require('async');
module.exports = function(device, hooks, message, callback = _.noop, dependencies = {}) {
var MessageWebhook, ref;
MessageWebhook = (ref = dependencies.MessageWebhook) != null ? ref : require('./... | _ = require 'lodash'
async = require 'async'
module.exports = (device, hooks, message, callback=_.noop, dependencies={}) ->
MessageWebhook = dependencies.MessageWebhook ? require './MessageWebhook'
hooks ?= []
async.map hooks, (hook, cb=->) =>
options =
uuid: device.uuid
options: hook
messa... | JavaScript | CoffeeScript | octoblu/meshblu | lib/doMessageHooks.coffee | MIT | 398c56b5cc548bb75654e7e9072b88d5417bb18b | 815 | https://github.com/octoblu/meshblu/blob/398c56b5cc548bb75654e7e9072b88d5417bb18b/lib/doMessageHooks.coffee | 1 | 17 |
octoblu/meshblu:lib/doMessageHooks.coffee:1:completion | completion | _ = require 'lodash'
async = require 'async'
module.exports = (device, hooks, message, callback=_.noop, dependencies={}) ->
MessageWebhook = dependencies.MessageWebhook ? require './MessageWebhook'
hooks ?= []
async.map hooks, (hook, cb=->) => | options =
uuid: device.uuid
options: hook
messageWebhook = new MessageWebhook options
messageWebhook.send message, (error) =>
cb null, error
, (error, errors) =>
callback errors | CoffeeScript | CoffeeScript | octoblu/meshblu | lib/doMessageHooks.coffee | MIT | 398c56b5cc548bb75654e7e9072b88d5417bb18b | 815 | https://github.com/octoblu/meshblu/blob/398c56b5cc548bb75654e7e9072b88d5417bb18b/lib/doMessageHooks.coffee | 1 | 17 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.