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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
buttercoin/buttercoin:test/transactionlog.coffee:1:completion | completion | chai = require 'chai'
chai.should()
expect = chai.expect
assert = chai.assert
Q = require('q')
fs = require 'fs'
TLog = require '../lib/transactionlog'
Ops = require '../lib/operations'
kTestFilename = 'test.log'
describe 'TransactionLog', ->
it 'should initialize', (finish) ->
trans_log = new TLog null, kTest... | it 'should record a message correctly', (finish) ->
# Make sure the state is clean
if fs.existsSync kTestFilename
fs.unlinkSync kTestFilename
trans_log = new TLog null, kTestFilename
trans_log.start().then =>
raw_msg = [ Ops.ADD_DEPOSIT, "fake" ]
msg = JSON.stringify(raw_msg)
tr... | CoffeeScript | CoffeeScript | buttercoin/buttercoin | test/transactionlog.coffee | MIT | 0e61ced53f96d1c50b7c3ffad03962c49fde3a7d | 663 | https://github.com/buttercoin/buttercoin/blob/0e61ced53f96d1c50b7c3ffad03962c49fde3a7d/test/transactionlog.coffee | 1 | 41 |
gss/engine:src/types/Primitive.coffee:1:raw_corpus | raw_corpus | Command = require('../Command')
class Primitive extends Command
# Decimal value (e.g. line-height: 1.0)
class Primitive.Number extends Primitive
type: 'Number'
constructor: (obj) ->
parsed = parseFloat(obj)
if parsed == obj
return parsed
@formatNumber: (number) ->
return number
class Primiti... | CoffeeScript | gss/engine | src/types/Primitive.coffee | MIT | e0d31eda3ebf8554204221731fbcfaa35d711a39 | 2,854 | https://github.com/gss/engine/blob/e0d31eda3ebf8554204221731fbcfaa35d711a39/src/types/Primitive.coffee | 1 | 50 | ||
gss/engine:src/types/Primitive.coffee:1:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
Command = require('../Command')
class Primitive extends Command
# Decimal value (e.g. line-height: 1.0)
class Primitive.Number extends Primitive
type: 'Number'
constructor: (obj) ->
parsed = parseFloat(obj)
if parsed == obj
return parsed
@f... | var Command, Primitive;
Command = require('../Command');
Primitive = class Primitive extends Command {};
Primitive.Number = (function() {
// Decimal value (e.g. line-height: 1.0)
class Number extends Primitive {
constructor(obj) {
var parsed;
parsed = parseFloat(obj);
if (parsed === obj) {
... | CoffeeScript | JavaScript | gss/engine | src/types/Primitive.coffee | MIT | e0d31eda3ebf8554204221731fbcfaa35d711a39 | 2,854 | https://github.com/gss/engine/blob/e0d31eda3ebf8554204221731fbcfaa35d711a39/src/types/Primitive.coffee | 1 | 50 |
gss/engine:src/types/Primitive.coffee:1:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
var Command, Primitive;
Command = require('../Command');
Primitive = class Primitive extends Command {};
Primitive.Number = (function() {
// Decimal value (e.g. line-height: 1.0)
class Number extends Primitive {
constructor(obj) {
var parsed;
... | Command = require('../Command')
class Primitive extends Command
# Decimal value (e.g. line-height: 1.0)
class Primitive.Number extends Primitive
type: 'Number'
constructor: (obj) ->
parsed = parseFloat(obj)
if parsed == obj
return parsed
@formatNumber: (number) ->
return number
class Primiti... | JavaScript | CoffeeScript | gss/engine | src/types/Primitive.coffee | MIT | e0d31eda3ebf8554204221731fbcfaa35d711a39 | 2,854 | https://github.com/gss/engine/blob/e0d31eda3ebf8554204221731fbcfaa35d711a39/src/types/Primitive.coffee | 1 | 50 |
gss/engine:src/types/Primitive.coffee:1:completion | completion | Command = require('../Command')
class Primitive extends Command
# Decimal value (e.g. line-height: 1.0)
class Primitive.Number extends Primitive
type: 'Number'
constructor: (obj) ->
parsed = parseFloat(obj)
if parsed == obj
return parsed
@formatNumber: (number) ->
return number
class Primiti... | constructor: (obj) ->
if typeof obj == 'string'
return obj
# Array of strings (e.g. font-family)
class Primitive.Strings extends Primitive
type: 'Strings'
constructor: (obj) ->
if typeof obj == 'string' || obj instanceof Array
return obj
class Primitive.Size extends Primitive
type: 'Size'
... | CoffeeScript | CoffeeScript | gss/engine | src/types/Primitive.coffee | MIT | e0d31eda3ebf8554204221731fbcfaa35d711a39 | 2,854 | https://github.com/gss/engine/blob/e0d31eda3ebf8554204221731fbcfaa35d711a39/src/types/Primitive.coffee | 1 | 50 |
gss/engine:src/types/Primitive.coffee:1:raw_corpus | raw_corpus | Command = require('../Command')
class Primitive extends Command
@condition: (obj) ->
if typeof obj == 'string' && @Keywords?[obj]
return obj
# Decimal value (e.g. line-height: 1.0)
class Primitive.Number extends Primitive
type: 'Number'
@condition: (obj) ->
parsed = parseFloat(obj)
if parsed =... | CoffeeScript | gss/engine | src/types/Primitive.coffee | MIT | d3a6c74b85e6d12a9ec02c24fef87d4c22bd9cb0 | 2,854 | https://github.com/gss/engine/blob/d3a6c74b85e6d12a9ec02c24fef87d4c22bd9cb0/src/types/Primitive.coffee | 1 | 50 | ||
gss/engine:src/types/Primitive.coffee:1:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
Command = require('../Command')
class Primitive extends Command
@condition: (obj) ->
if typeof obj == 'string' && @Keywords?[obj]
return obj
# Decimal value (e.g. line-height: 1.0)
class Primitive.Number extends Primitive
type: 'Number'
@conditi... | var Command, Primitive;
Command = require('../Command');
Primitive = class Primitive extends Command {
static condition(obj) {
var ref;
if (typeof obj === 'string' && ((ref = this.Keywords) != null ? ref[obj] : void 0)) {
return obj;
}
}
};
Primitive.Number = (function() {
// Decimal value (... | CoffeeScript | JavaScript | gss/engine | src/types/Primitive.coffee | MIT | d3a6c74b85e6d12a9ec02c24fef87d4c22bd9cb0 | 2,854 | https://github.com/gss/engine/blob/d3a6c74b85e6d12a9ec02c24fef87d4c22bd9cb0/src/types/Primitive.coffee | 1 | 50 |
gss/engine:src/types/Primitive.coffee:1:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
var Command, Primitive;
Command = require('../Command');
Primitive = class Primitive extends Command {
static condition(obj) {
var ref;
if (typeof obj === 'string' && ((ref = this.Keywords) != null ? ref[obj] : void 0)) {
return obj;
}
}
};... | Command = require('../Command')
class Primitive extends Command
@condition: (obj) ->
if typeof obj == 'string' && @Keywords?[obj]
return obj
# Decimal value (e.g. line-height: 1.0)
class Primitive.Number extends Primitive
type: 'Number'
@condition: (obj) ->
parsed = parseFloat(obj)
if parsed =... | JavaScript | CoffeeScript | gss/engine | src/types/Primitive.coffee | MIT | d3a6c74b85e6d12a9ec02c24fef87d4c22bd9cb0 | 2,854 | https://github.com/gss/engine/blob/d3a6c74b85e6d12a9ec02c24fef87d4c22bd9cb0/src/types/Primitive.coffee | 1 | 50 |
gss/engine:src/types/Primitive.coffee:1:completion | completion | Command = require('../Command')
class Primitive extends Command
@condition: (obj) ->
if typeof obj == 'string' && @Keywords?[obj]
return obj
# Decimal value (e.g. line-height: 1.0)
class Primitive.Number extends Primitive
type: 'Number'
@condition: (obj) ->
parsed = parseFloat(obj)
if parsed =... | @condition: (obj) ->
if typeof obj == 'string'
return obj
# Array of strings (e.g. font-family)
class Primitive.Strings extends Primitive
type: 'Strings'
@condition: (obj) ->
if typeof obj == 'string' || obj instanceof Array
return obj
class Primitive.Size extends Primitive
type: 'Size'
... | CoffeeScript | CoffeeScript | gss/engine | src/types/Primitive.coffee | MIT | d3a6c74b85e6d12a9ec02c24fef87d4c22bd9cb0 | 2,854 | https://github.com/gss/engine/blob/d3a6c74b85e6d12a9ec02c24fef87d4c22bd9cb0/src/types/Primitive.coffee | 1 | 50 |
gterrono/houston:client/zma_helpers.coffee:1:raw_corpus | raw_corpus | if Handlebars?
Handlebars.registerHelper('onHoustonPage', ->
throw "Can't find root route" unless Houston._ROOT_ROUTE?
window.location.pathname.indexOf(Houston._ROOT_ROUTE) == 0)
Houston._collections ?= {}
# regardless of what version of meteor we are using,
# get the right LocalCollection
Houston._get_coll... | CoffeeScript | gterrono/houston | client/zma_helpers.coffee | MIT | 3f9d71d3b19f7770abaaef85e8d836d9122d71b7 | 802 | https://github.com/gterrono/houston/blob/3f9d71d3b19f7770abaaef85e8d836d9122d71b7/client/zma_helpers.coffee | 1 | 50 | ||
gterrono/houston:client/zma_helpers.coffee:1:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
if Handlebars?
Handlebars.registerHelper('onHoustonPage', ->
throw "Can't find root route" unless Houston._ROOT_ROUTE?
window.location.pathname.indexOf(Houston._ROOT_ROUTE) == 0)
Houston._collections ?= {}
# regardless of what version of meteor we are... | if (typeof Handlebars !== "undefined" && Handlebars !== null) {
Handlebars.registerHelper('onHoustonPage', function() {
if (Houston._ROOT_ROUTE == null) {
throw "Can't find root route";
}
return window.location.pathname.indexOf(Houston._ROOT_ROUTE) === 0;
});
}
if (Houston._collections == null) {... | CoffeeScript | JavaScript | gterrono/houston | client/zma_helpers.coffee | MIT | 3f9d71d3b19f7770abaaef85e8d836d9122d71b7 | 802 | https://github.com/gterrono/houston/blob/3f9d71d3b19f7770abaaef85e8d836d9122d71b7/client/zma_helpers.coffee | 1 | 50 |
gterrono/houston:client/zma_helpers.coffee:1:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
if (typeof Handlebars !== "undefined" && Handlebars !== null) {
Handlebars.registerHelper('onHoustonPage', function() {
if (Houston._ROOT_ROUTE == null) {
throw "Can't find root route";
}
return window.location.pathname.indexOf(Houston._ROOT_ROU... | if Handlebars?
Handlebars.registerHelper('onHoustonPage', ->
throw "Can't find root route" unless Houston._ROOT_ROUTE?
window.location.pathname.indexOf(Houston._ROOT_ROUTE) == 0)
Houston._collections ?= {}
# regardless of what version of meteor we are using,
# get the right LocalCollection
Houston._get_coll... | JavaScript | CoffeeScript | gterrono/houston | client/zma_helpers.coffee | MIT | 3f9d71d3b19f7770abaaef85e8d836d9122d71b7 | 802 | https://github.com/gterrono/houston/blob/3f9d71d3b19f7770abaaef85e8d836d9122d71b7/client/zma_helpers.coffee | 1 | 50 |
gterrono/houston:client/zma_helpers.coffee:1:completion | completion | if Handlebars?
Handlebars.registerHelper('onHoustonPage', ->
throw "Can't find root route" unless Houston._ROOT_ROUTE?
window.location.pathname.indexOf(Houston._ROOT_ROUTE) == 0)
Houston._collections ?= {}
# regardless of what version of meteor we are using,
# get the right LocalCollection
Houston._get_coll... | Houston._session = () ->
key = Houston._houstonize(arguments[0])
if arguments.length == 1
return Session.get(key)
else if arguments.length == 2
Session.set(key, arguments[1])
Houston._call = (name, args...) ->
Meteor.call(Houston._houstonize(name), args...)
Houston._nested_field_lookup = (object, path... | CoffeeScript | CoffeeScript | gterrono/houston | client/zma_helpers.coffee | MIT | 3f9d71d3b19f7770abaaef85e8d836d9122d71b7 | 802 | https://github.com/gterrono/houston/blob/3f9d71d3b19f7770abaaef85e8d836d9122d71b7/client/zma_helpers.coffee | 1 | 50 |
gterrono/houston:client/zma_helpers.coffee:2:raw_corpus | raw_corpus | Houston._convert_to_correct_type = (field, val, collection) ->
find_obj = {}
find_obj[field] = $exists: true
sample_val = Houston._nested_field_lookup(collection.findOne(find_obj), field)
constructor = sample_val.constructor
if typeof sample_val == 'object'
new constructor(val)
else
constructor(val) | CoffeeScript | gterrono/houston | client/zma_helpers.coffee | MIT | a2b3a39371b08a101fed368b0e13e62ebd1a8fb4 | 802 | https://github.com/gterrono/houston/blob/a2b3a39371b08a101fed368b0e13e62ebd1a8fb4/client/zma_helpers.coffee | 51 | 60 | ||
gterrono/houston:client/zma_helpers.coffee:2:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
Houston._convert_to_correct_type = (field, val, collection) ->
find_obj = {}
find_obj[field] = $exists: true
sample_val = Houston._nested_field_lookup(collection.findOne(find_obj), field)
constructor = sample_val.constructor
if typeof sample_val == 'obj... | Houston._convert_to_correct_type = function(field, val, collection) {
var constructor, find_obj, sample_val;
find_obj = {};
find_obj[field] = {
$exists: true
};
sample_val = Houston._nested_field_lookup(collection.findOne(find_obj), field);
constructor = sample_val.constructor;
if (typeof sample_val =... | CoffeeScript | JavaScript | gterrono/houston | client/zma_helpers.coffee | MIT | a2b3a39371b08a101fed368b0e13e62ebd1a8fb4 | 802 | https://github.com/gterrono/houston/blob/a2b3a39371b08a101fed368b0e13e62ebd1a8fb4/client/zma_helpers.coffee | 51 | 60 |
gterrono/houston:client/zma_helpers.coffee:2:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
Houston._convert_to_correct_type = function(field, val, collection) {
var constructor, find_obj, sample_val;
find_obj = {};
find_obj[field] = {
$exists: true
};
sample_val = Houston._nested_field_lookup(collection.findOne(find_obj), field);
construc... | Houston._convert_to_correct_type = (field, val, collection) ->
find_obj = {}
find_obj[field] = $exists: true
sample_val = Houston._nested_field_lookup(collection.findOne(find_obj), field)
constructor = sample_val.constructor
if typeof sample_val == 'object'
new constructor(val)
else
constructor(val) | JavaScript | CoffeeScript | gterrono/houston | client/zma_helpers.coffee | MIT | a2b3a39371b08a101fed368b0e13e62ebd1a8fb4 | 802 | https://github.com/gterrono/houston/blob/a2b3a39371b08a101fed368b0e13e62ebd1a8fb4/client/zma_helpers.coffee | 51 | 60 |
gterrono/houston:client/zma_helpers.coffee:2:completion | completion | Houston._convert_to_correct_type = (field, val, collection) ->
find_obj = {}
find_obj[field] = $exists: true
sample_val = Houston._nested_field_lookup(collection.findOne(find_obj), field) | constructor = sample_val.constructor
if typeof sample_val == 'object'
new constructor(val)
else
constructor(val) | CoffeeScript | CoffeeScript | gterrono/houston | client/zma_helpers.coffee | MIT | a2b3a39371b08a101fed368b0e13e62ebd1a8fb4 | 802 | https://github.com/gterrono/houston/blob/a2b3a39371b08a101fed368b0e13e62ebd1a8fb4/client/zma_helpers.coffee | 51 | 60 |
gterrono/houston:client/zma_helpers.coffee:1:raw_corpus | raw_corpus | if Handlebars?
Handlebars.registerHelper('onHoustonPage', ->
window.location.pathname.indexOf('/admin') == 0)
Houston._collections ?= {}
# regardless of what version of meteor we are using,
# get the right LocalCollection
Houston._get_collection = (collection_name) ->
unless Houston._collections[collection_na... | CoffeeScript | gterrono/houston | client/zma_helpers.coffee | MIT | 91d8fb0d012edf4f987be454abbca03630d8e5b1 | 802 | https://github.com/gterrono/houston/blob/91d8fb0d012edf4f987be454abbca03630d8e5b1/client/zma_helpers.coffee | 1 | 50 | ||
gterrono/houston:client/zma_helpers.coffee:1:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
if Handlebars?
Handlebars.registerHelper('onHoustonPage', ->
window.location.pathname.indexOf('/admin') == 0)
Houston._collections ?= {}
# regardless of what version of meteor we are using,
# get the right LocalCollection
Houston._get_collection = (collec... | if (typeof Handlebars !== "undefined" && Handlebars !== null) {
Handlebars.registerHelper('onHoustonPage', function() {
return window.location.pathname.indexOf('/admin') === 0;
});
}
if (Houston._collections == null) {
Houston._collections = {};
}
// regardless of what version of meteor we are using,
// get... | CoffeeScript | JavaScript | gterrono/houston | client/zma_helpers.coffee | MIT | 91d8fb0d012edf4f987be454abbca03630d8e5b1 | 802 | https://github.com/gterrono/houston/blob/91d8fb0d012edf4f987be454abbca03630d8e5b1/client/zma_helpers.coffee | 1 | 50 |
gterrono/houston:client/zma_helpers.coffee:1:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
if (typeof Handlebars !== "undefined" && Handlebars !== null) {
Handlebars.registerHelper('onHoustonPage', function() {
return window.location.pathname.indexOf('/admin') === 0;
});
}
if (Houston._collections == null) {
Houston._collections = {};
}
// re... | if Handlebars?
Handlebars.registerHelper('onHoustonPage', ->
window.location.pathname.indexOf('/admin') == 0)
Houston._collections ?= {}
# regardless of what version of meteor we are using,
# get the right LocalCollection
Houston._get_collection = (collection_name) ->
unless Houston._collections[collection_na... | JavaScript | CoffeeScript | gterrono/houston | client/zma_helpers.coffee | MIT | 91d8fb0d012edf4f987be454abbca03630d8e5b1 | 802 | https://github.com/gterrono/houston/blob/91d8fb0d012edf4f987be454abbca03630d8e5b1/client/zma_helpers.coffee | 1 | 50 |
gterrono/houston:client/zma_helpers.coffee:1:completion | completion | if Handlebars?
Handlebars.registerHelper('onHoustonPage', ->
window.location.pathname.indexOf('/admin') == 0)
Houston._collections ?= {}
# regardless of what version of meteor we are using,
# get the right LocalCollection
Houston._get_collection = (collection_name) ->
unless Houston._collections[collection_na... | Houston._session = () ->
key = Houston._houstonize(arguments[0])
if arguments.length == 1
return Session.get(key)
else if arguments.length == 2
Session.set(key, arguments[1])
Houston._call = (name, args...) ->
Meteor.call(Houston._houstonize(name), args...)
Houston._nested_field_lookup = (object, path... | CoffeeScript | CoffeeScript | gterrono/houston | client/zma_helpers.coffee | MIT | 91d8fb0d012edf4f987be454abbca03630d8e5b1 | 802 | https://github.com/gterrono/houston/blob/91d8fb0d012edf4f987be454abbca03630d8e5b1/client/zma_helpers.coffee | 1 | 50 |
gterrono/houston:client/zma_helpers.coffee:1:raw_corpus | raw_corpus | if Handlebars?
Handlebars.registerHelper('onHoustonPage', ->
window.location.pathname.indexOf('/admin') == 0)
Houston._collections ?= {}
# regardless of what version of meteor we are using,
# get the right LocalCollection
Houston._get_collection = (collection_name) ->
unless Houston._collections[collection_na... | CoffeeScript | gterrono/houston | client/zma_helpers.coffee | MIT | 3fc550b941fe11f0d650bf533cec02f8224ebd04 | 802 | https://github.com/gterrono/houston/blob/3fc550b941fe11f0d650bf533cec02f8224ebd04/client/zma_helpers.coffee | 1 | 50 | ||
gterrono/houston:client/zma_helpers.coffee:1:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
if Handlebars?
Handlebars.registerHelper('onHoustonPage', ->
window.location.pathname.indexOf('/admin') == 0)
Houston._collections ?= {}
# regardless of what version of meteor we are using,
# get the right LocalCollection
Houston._get_collection = (collec... | if (typeof Handlebars !== "undefined" && Handlebars !== null) {
Handlebars.registerHelper('onHoustonPage', function() {
return window.location.pathname.indexOf('/admin') === 0;
});
}
if (Houston._collections == null) {
Houston._collections = {};
}
// regardless of what version of meteor we are using,
// get... | CoffeeScript | JavaScript | gterrono/houston | client/zma_helpers.coffee | MIT | 3fc550b941fe11f0d650bf533cec02f8224ebd04 | 802 | https://github.com/gterrono/houston/blob/3fc550b941fe11f0d650bf533cec02f8224ebd04/client/zma_helpers.coffee | 1 | 50 |
gterrono/houston:client/zma_helpers.coffee:1:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
if (typeof Handlebars !== "undefined" && Handlebars !== null) {
Handlebars.registerHelper('onHoustonPage', function() {
return window.location.pathname.indexOf('/admin') === 0;
});
}
if (Houston._collections == null) {
Houston._collections = {};
}
// re... | if Handlebars?
Handlebars.registerHelper('onHoustonPage', ->
window.location.pathname.indexOf('/admin') == 0)
Houston._collections ?= {}
# regardless of what version of meteor we are using,
# get the right LocalCollection
Houston._get_collection = (collection_name) ->
unless Houston._collections[collection_na... | JavaScript | CoffeeScript | gterrono/houston | client/zma_helpers.coffee | MIT | 3fc550b941fe11f0d650bf533cec02f8224ebd04 | 802 | https://github.com/gterrono/houston/blob/3fc550b941fe11f0d650bf533cec02f8224ebd04/client/zma_helpers.coffee | 1 | 50 |
gterrono/houston:client/zma_helpers.coffee:1:completion | completion | if Handlebars?
Handlebars.registerHelper('onHoustonPage', ->
window.location.pathname.indexOf('/admin') == 0)
Houston._collections ?= {}
# regardless of what version of meteor we are using,
# get the right LocalCollection
Houston._get_collection = (collection_name) ->
unless Houston._collections[collection_na... | Houston._session = () ->
key = Houston._houstonize(arguments[0])
if arguments.length == 1
return Session.get(key)
else if arguments.length == 2
Session.set(key, arguments[1])
Houston._call = (name, args...) ->
Meteor.call(Houston._houstonize(name), args...)
Houston._nested_field_lookup = (object, path... | CoffeeScript | CoffeeScript | gterrono/houston | client/zma_helpers.coffee | MIT | 3fc550b941fe11f0d650bf533cec02f8224ebd04 | 802 | https://github.com/gterrono/houston/blob/3fc550b941fe11f0d650bf533cec02f8224ebd04/client/zma_helpers.coffee | 1 | 50 |
gterrono/houston:client/zma_helpers.coffee:1:raw_corpus | raw_corpus | if Handlebars?
Handlebars.registerHelper('onHoustonPage', ->
window.location.pathname.indexOf('/admin') == 0)
Houston._collections ?= {}
# regardless of what version of meteor we are using,
# get the right LocalCollection
Houston._get_collection = (collection_name) ->
unless Houston._collections[collection_na... | CoffeeScript | gterrono/houston | client/zma_helpers.coffee | MIT | f96653728988480759a8edbe980efa67c6bfffce | 802 | https://github.com/gterrono/houston/blob/f96653728988480759a8edbe980efa67c6bfffce/client/zma_helpers.coffee | 1 | 47 | ||
gterrono/houston:client/zma_helpers.coffee:1:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
if Handlebars?
Handlebars.registerHelper('onHoustonPage', ->
window.location.pathname.indexOf('/admin') == 0)
Houston._collections ?= {}
# regardless of what version of meteor we are using,
# get the right LocalCollection
Houston._get_collection = (collec... | if (typeof Handlebars !== "undefined" && Handlebars !== null) {
Handlebars.registerHelper('onHoustonPage', function() {
return window.location.pathname.indexOf('/admin') === 0;
});
}
if (Houston._collections == null) {
Houston._collections = {};
}
// regardless of what version of meteor we are using,
// get... | CoffeeScript | JavaScript | gterrono/houston | client/zma_helpers.coffee | MIT | f96653728988480759a8edbe980efa67c6bfffce | 802 | https://github.com/gterrono/houston/blob/f96653728988480759a8edbe980efa67c6bfffce/client/zma_helpers.coffee | 1 | 47 |
gterrono/houston:client/zma_helpers.coffee:1:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
if (typeof Handlebars !== "undefined" && Handlebars !== null) {
Handlebars.registerHelper('onHoustonPage', function() {
return window.location.pathname.indexOf('/admin') === 0;
});
}
if (Houston._collections == null) {
Houston._collections = {};
}
// re... | if Handlebars?
Handlebars.registerHelper('onHoustonPage', ->
window.location.pathname.indexOf('/admin') == 0)
Houston._collections ?= {}
# regardless of what version of meteor we are using,
# get the right LocalCollection
Houston._get_collection = (collection_name) ->
unless Houston._collections[collection_na... | JavaScript | CoffeeScript | gterrono/houston | client/zma_helpers.coffee | MIT | f96653728988480759a8edbe980efa67c6bfffce | 802 | https://github.com/gterrono/houston/blob/f96653728988480759a8edbe980efa67c6bfffce/client/zma_helpers.coffee | 1 | 47 |
gterrono/houston:client/zma_helpers.coffee:1:completion | completion | if Handlebars?
Handlebars.registerHelper('onHoustonPage', ->
window.location.pathname.indexOf('/admin') == 0)
Houston._collections ?= {}
# regardless of what version of meteor we are using,
# get the right LocalCollection
Houston._get_collection = (collection_name) ->
unless Houston._collections[collection_na... | return Houston._collections[collection_name]
Houston._session = () ->
key = Houston._houstonize(arguments[0])
if arguments.length == 1
return Session.get(key)
else if arguments.length == 2
Session.set(key, arguments[1])
Houston._call = (name, args...) ->
Meteor.call(Houston._houstonize(name), args...)... | CoffeeScript | CoffeeScript | gterrono/houston | client/zma_helpers.coffee | MIT | f96653728988480759a8edbe980efa67c6bfffce | 802 | https://github.com/gterrono/houston/blob/f96653728988480759a8edbe980efa67c6bfffce/client/zma_helpers.coffee | 1 | 47 |
gterrono/houston:client/zma_helpers.coffee:1:raw_corpus | raw_corpus | if Handlebars?
Handlebars.registerHelper('onHoustonPage', ->
window.location.pathname.indexOf('/admin') == 0)
Houston._collections ?= {}
# regardless of what version of meteor we are using,
# get the right LocalCollection
Houston._get_collection = (collection_name) ->
unless Houston._collections[collection_na... | CoffeeScript | gterrono/houston | client/zma_helpers.coffee | MIT | 0580b15b70205092c8e78f81e2229130481e649d | 802 | https://github.com/gterrono/houston/blob/0580b15b70205092c8e78f81e2229130481e649d/client/zma_helpers.coffee | 1 | 45 | ||
gterrono/houston:client/zma_helpers.coffee:1:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
if Handlebars?
Handlebars.registerHelper('onHoustonPage', ->
window.location.pathname.indexOf('/admin') == 0)
Houston._collections ?= {}
# regardless of what version of meteor we are using,
# get the right LocalCollection
Houston._get_collection = (collec... | if (typeof Handlebars !== "undefined" && Handlebars !== null) {
Handlebars.registerHelper('onHoustonPage', function() {
return window.location.pathname.indexOf('/admin') === 0;
});
}
if (Houston._collections == null) {
Houston._collections = {};
}
// regardless of what version of meteor we are using,
// get... | CoffeeScript | JavaScript | gterrono/houston | client/zma_helpers.coffee | MIT | 0580b15b70205092c8e78f81e2229130481e649d | 802 | https://github.com/gterrono/houston/blob/0580b15b70205092c8e78f81e2229130481e649d/client/zma_helpers.coffee | 1 | 45 |
gterrono/houston:client/zma_helpers.coffee:1:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
if (typeof Handlebars !== "undefined" && Handlebars !== null) {
Handlebars.registerHelper('onHoustonPage', function() {
return window.location.pathname.indexOf('/admin') === 0;
});
}
if (Houston._collections == null) {
Houston._collections = {};
}
// re... | if Handlebars?
Handlebars.registerHelper('onHoustonPage', ->
window.location.pathname.indexOf('/admin') == 0)
Houston._collections ?= {}
# regardless of what version of meteor we are using,
# get the right LocalCollection
Houston._get_collection = (collection_name) ->
unless Houston._collections[collection_na... | JavaScript | CoffeeScript | gterrono/houston | client/zma_helpers.coffee | MIT | 0580b15b70205092c8e78f81e2229130481e649d | 802 | https://github.com/gterrono/houston/blob/0580b15b70205092c8e78f81e2229130481e649d/client/zma_helpers.coffee | 1 | 45 |
gterrono/houston:client/zma_helpers.coffee:1:completion | completion | if Handlebars?
Handlebars.registerHelper('onHoustonPage', ->
window.location.pathname.indexOf('/admin') == 0)
Houston._collections ?= {}
# regardless of what version of meteor we are using,
# get the right LocalCollection
Houston._get_collection = (collection_name) ->
unless Houston._collections[collection_na... | return Houston._collections[collection_name]
Houston._session = () ->
key = Houston._houstonize(arguments[0])
if arguments.length == 1
return Session.get(key)
else if arguments.length == 2
Session.set(key, arguments[1])
Houston._call = (name, args...) ->
Meteor.call(Houston._houstonize(name), args...)... | CoffeeScript | CoffeeScript | gterrono/houston | client/zma_helpers.coffee | MIT | 0580b15b70205092c8e78f81e2229130481e649d | 802 | https://github.com/gterrono/houston/blob/0580b15b70205092c8e78f81e2229130481e649d/client/zma_helpers.coffee | 1 | 45 |
gterrono/houston:client/zma_helpers.coffee:1:raw_corpus | raw_corpus | if Handlebars?
Handlebars.registerHelper('onHoustonPage', ->
window.location.pathname.indexOf('/admin') == 0)
Houston._collections ?= {}
# regardless of what version of meteor we are using,
# get the right LocalCollection
Houston._get_collection = (collection_name) ->
unless Houston._collections[collection_na... | CoffeeScript | gterrono/houston | client/zma_helpers.coffee | MIT | 4b18561921e57c866348c671e76597b67f4ea52e | 802 | https://github.com/gterrono/houston/blob/4b18561921e57c866348c671e76597b67f4ea52e/client/zma_helpers.coffee | 1 | 43 | ||
gterrono/houston:client/zma_helpers.coffee:1:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
if Handlebars?
Handlebars.registerHelper('onHoustonPage', ->
window.location.pathname.indexOf('/admin') == 0)
Houston._collections ?= {}
# regardless of what version of meteor we are using,
# get the right LocalCollection
Houston._get_collection = (collec... | if (typeof Handlebars !== "undefined" && Handlebars !== null) {
Handlebars.registerHelper('onHoustonPage', function() {
return window.location.pathname.indexOf('/admin') === 0;
});
}
if (Houston._collections == null) {
Houston._collections = {};
}
// regardless of what version of meteor we are using,
// get... | CoffeeScript | JavaScript | gterrono/houston | client/zma_helpers.coffee | MIT | 4b18561921e57c866348c671e76597b67f4ea52e | 802 | https://github.com/gterrono/houston/blob/4b18561921e57c866348c671e76597b67f4ea52e/client/zma_helpers.coffee | 1 | 43 |
gterrono/houston:client/zma_helpers.coffee:1:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
if (typeof Handlebars !== "undefined" && Handlebars !== null) {
Handlebars.registerHelper('onHoustonPage', function() {
return window.location.pathname.indexOf('/admin') === 0;
});
}
if (Houston._collections == null) {
Houston._collections = {};
}
// re... | if Handlebars?
Handlebars.registerHelper('onHoustonPage', ->
window.location.pathname.indexOf('/admin') == 0)
Houston._collections ?= {}
# regardless of what version of meteor we are using,
# get the right LocalCollection
Houston._get_collection = (collection_name) ->
unless Houston._collections[collection_na... | JavaScript | CoffeeScript | gterrono/houston | client/zma_helpers.coffee | MIT | 4b18561921e57c866348c671e76597b67f4ea52e | 802 | https://github.com/gterrono/houston/blob/4b18561921e57c866348c671e76597b67f4ea52e/client/zma_helpers.coffee | 1 | 43 |
gterrono/houston:client/zma_helpers.coffee:1:completion | completion | if Handlebars?
Handlebars.registerHelper('onHoustonPage', ->
window.location.pathname.indexOf('/admin') == 0)
Houston._collections ?= {}
# regardless of what version of meteor we are using,
# get the right LocalCollection
Houston._get_collection = (collection_name) ->
unless Houston._collections[collection_na... | Meteor._LocalCollectionDriver.collections[collection_name]
return Houston._collections[collection_name]
Houston._session = () ->
key = Houston._houstonize(arguments[0])
if arguments.length == 1
return Session.get(key)
else if arguments.length == 2
Session.set(key, arguments[1])
Houston._call = (name,... | CoffeeScript | CoffeeScript | gterrono/houston | client/zma_helpers.coffee | MIT | 4b18561921e57c866348c671e76597b67f4ea52e | 802 | https://github.com/gterrono/houston/blob/4b18561921e57c866348c671e76597b67f4ea52e/client/zma_helpers.coffee | 1 | 43 |
gterrono/houston:client/zma_helpers.coffee:1:raw_corpus | raw_corpus | if Handlebars?
Handlebars.registerHelper('onHoustonPage', ->
window.location.pathname.indexOf('/admin') == 0)
Houston._collections ?= {}
# regardless of what version of meteor we are using,
# get the right LocalCollection
Houston._get_collection = (collection_name) ->
unless Houston._collections[collection_na... | CoffeeScript | gterrono/houston | client/zma_helpers.coffee | MIT | ac73043990093b2ecd87e947bd30c1fe3dba1de6 | 802 | https://github.com/gterrono/houston/blob/ac73043990093b2ecd87e947bd30c1fe3dba1de6/client/zma_helpers.coffee | 1 | 43 | ||
gterrono/houston:client/zma_helpers.coffee:1:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
if Handlebars?
Handlebars.registerHelper('onHoustonPage', ->
window.location.pathname.indexOf('/admin') == 0)
Houston._collections ?= {}
# regardless of what version of meteor we are using,
# get the right LocalCollection
Houston._get_collection = (collec... | if (typeof Handlebars !== "undefined" && Handlebars !== null) {
Handlebars.registerHelper('onHoustonPage', function() {
return window.location.pathname.indexOf('/admin') === 0;
});
}
if (Houston._collections == null) {
Houston._collections = {};
}
// regardless of what version of meteor we are using,
// get... | CoffeeScript | JavaScript | gterrono/houston | client/zma_helpers.coffee | MIT | ac73043990093b2ecd87e947bd30c1fe3dba1de6 | 802 | https://github.com/gterrono/houston/blob/ac73043990093b2ecd87e947bd30c1fe3dba1de6/client/zma_helpers.coffee | 1 | 43 |
gterrono/houston:client/zma_helpers.coffee:1:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
if (typeof Handlebars !== "undefined" && Handlebars !== null) {
Handlebars.registerHelper('onHoustonPage', function() {
return window.location.pathname.indexOf('/admin') === 0;
});
}
if (Houston._collections == null) {
Houston._collections = {};
}
// re... | if Handlebars?
Handlebars.registerHelper('onHoustonPage', ->
window.location.pathname.indexOf('/admin') == 0)
Houston._collections ?= {}
# regardless of what version of meteor we are using,
# get the right LocalCollection
Houston._get_collection = (collection_name) ->
unless Houston._collections[collection_na... | JavaScript | CoffeeScript | gterrono/houston | client/zma_helpers.coffee | MIT | ac73043990093b2ecd87e947bd30c1fe3dba1de6 | 802 | https://github.com/gterrono/houston/blob/ac73043990093b2ecd87e947bd30c1fe3dba1de6/client/zma_helpers.coffee | 1 | 43 |
gterrono/houston:client/zma_helpers.coffee:1:completion | completion | if Handlebars?
Handlebars.registerHelper('onHoustonPage', ->
window.location.pathname.indexOf('/admin') == 0)
Houston._collections ?= {}
# regardless of what version of meteor we are using,
# get the right LocalCollection
Houston._get_collection = (collection_name) ->
unless Houston._collections[collection_na... | Meteor._LocalCollectionDriver.collections[collection_name]
return Houston._collections[collection_name]
Houston._session = () ->
key = Houston._houstonize(arguments[0])
if arguments.length == 1
return Session.get(key)
else if arguments.length == 2
Session.set(key, arguments[1])
Houston._call = (name,... | CoffeeScript | CoffeeScript | gterrono/houston | client/zma_helpers.coffee | MIT | ac73043990093b2ecd87e947bd30c1fe3dba1de6 | 802 | https://github.com/gterrono/houston/blob/ac73043990093b2ecd87e947bd30c1fe3dba1de6/client/zma_helpers.coffee | 1 | 43 |
gterrono/houston:client/zma_helpers.coffee:1:raw_corpus | raw_corpus | if Handlebars?
Handlebars.registerHelper('onHoustonPage', ->
window.location.pathname.indexOf('/admin') == 0)
Houston._collections ?= {}
# regardless of what version of meteor we are using,
# get the right LocalCollection
Houston._get_collection = (collection_name) ->
unless Houston._collections[collection_na... | CoffeeScript | gterrono/houston | client/zma_helpers.coffee | MIT | 3fa4b927aee4e23c39e194ee4e97fadbf627c39c | 802 | https://github.com/gterrono/houston/blob/3fa4b927aee4e23c39e194ee4e97fadbf627c39c/client/zma_helpers.coffee | 1 | 29 | ||
gterrono/houston:client/zma_helpers.coffee:1:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
if Handlebars?
Handlebars.registerHelper('onHoustonPage', ->
window.location.pathname.indexOf('/admin') == 0)
Houston._collections ?= {}
# regardless of what version of meteor we are using,
# get the right LocalCollection
Houston._get_collection = (collec... | if (typeof Handlebars !== "undefined" && Handlebars !== null) {
Handlebars.registerHelper('onHoustonPage', function() {
return window.location.pathname.indexOf('/admin') === 0;
});
}
if (Houston._collections == null) {
Houston._collections = {};
}
// regardless of what version of meteor we are using,
// get... | CoffeeScript | JavaScript | gterrono/houston | client/zma_helpers.coffee | MIT | 3fa4b927aee4e23c39e194ee4e97fadbf627c39c | 802 | https://github.com/gterrono/houston/blob/3fa4b927aee4e23c39e194ee4e97fadbf627c39c/client/zma_helpers.coffee | 1 | 29 |
gterrono/houston:client/zma_helpers.coffee:1:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
if (typeof Handlebars !== "undefined" && Handlebars !== null) {
Handlebars.registerHelper('onHoustonPage', function() {
return window.location.pathname.indexOf('/admin') === 0;
});
}
if (Houston._collections == null) {
Houston._collections = {};
}
// re... | if Handlebars?
Handlebars.registerHelper('onHoustonPage', ->
window.location.pathname.indexOf('/admin') == 0)
Houston._collections ?= {}
# regardless of what version of meteor we are using,
# get the right LocalCollection
Houston._get_collection = (collection_name) ->
unless Houston._collections[collection_na... | JavaScript | CoffeeScript | gterrono/houston | client/zma_helpers.coffee | MIT | 3fa4b927aee4e23c39e194ee4e97fadbf627c39c | 802 | https://github.com/gterrono/houston/blob/3fa4b927aee4e23c39e194ee4e97fadbf627c39c/client/zma_helpers.coffee | 1 | 29 |
gterrono/houston:client/zma_helpers.coffee:1:completion | completion | if Handlebars?
Handlebars.registerHelper('onHoustonPage', ->
window.location.pathname.indexOf('/admin') == 0)
Houston._collections ?= {}
# regardless of what version of meteor we are using,
# get the right LocalCollection
Houston._get_collection = (collection_name) ->
unless Houston._collections[collection_na... | try
# works for 0.6.6.2+
Houston._collections[collection_name] = \
Meteor.connection._mongo_livedata_collections[collection_name]
catch e
# old versions of meteor (older than 0.6.6.2)
Houston._collections[collection_name] =
Meteor._LocalCollectionDriver.collecti... | CoffeeScript | CoffeeScript | gterrono/houston | client/zma_helpers.coffee | MIT | 3fa4b927aee4e23c39e194ee4e97fadbf627c39c | 802 | https://github.com/gterrono/houston/blob/3fa4b927aee4e23c39e194ee4e97fadbf627c39c/client/zma_helpers.coffee | 1 | 29 |
gterrono/houston:client/zma_helpers.coffee:1:raw_corpus | raw_corpus | if Handlebars?
Handlebars.registerHelper('onHoustonPage', ->
window.location.pathname.indexOf('/admin') == 0)
# regardless of what version of meteor we are using,
# get the right LocalCollection
Houston._get_collection = (collection_name) ->
unless Houston[collection_name]
try
# you can only instanti... | CoffeeScript | gterrono/houston | client/zma_helpers.coffee | MIT | 16ea359dbf8dfec50191fb5cf8c98d6c81120457 | 802 | https://github.com/gterrono/houston/blob/16ea359dbf8dfec50191fb5cf8c98d6c81120457/client/zma_helpers.coffee | 1 | 27 | ||
gterrono/houston:client/zma_helpers.coffee:1:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
if Handlebars?
Handlebars.registerHelper('onHoustonPage', ->
window.location.pathname.indexOf('/admin') == 0)
# regardless of what version of meteor we are using,
# get the right LocalCollection
Houston._get_collection = (collection_name) ->
unless Houst... | if (typeof Handlebars !== "undefined" && Handlebars !== null) {
Handlebars.registerHelper('onHoustonPage', function() {
return window.location.pathname.indexOf('/admin') === 0;
});
}
// regardless of what version of meteor we are using,
// get the right LocalCollection
Houston._get_collection = function(collec... | CoffeeScript | JavaScript | gterrono/houston | client/zma_helpers.coffee | MIT | 16ea359dbf8dfec50191fb5cf8c98d6c81120457 | 802 | https://github.com/gterrono/houston/blob/16ea359dbf8dfec50191fb5cf8c98d6c81120457/client/zma_helpers.coffee | 1 | 27 |
gterrono/houston:client/zma_helpers.coffee:1:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
if (typeof Handlebars !== "undefined" && Handlebars !== null) {
Handlebars.registerHelper('onHoustonPage', function() {
return window.location.pathname.indexOf('/admin') === 0;
});
}
// regardless of what version of meteor we are using,
// get the right Lo... | if Handlebars?
Handlebars.registerHelper('onHoustonPage', ->
window.location.pathname.indexOf('/admin') == 0)
# regardless of what version of meteor we are using,
# get the right LocalCollection
Houston._get_collection = (collection_name) ->
unless Houston[collection_name]
try
# you can only instanti... | JavaScript | CoffeeScript | gterrono/houston | client/zma_helpers.coffee | MIT | 16ea359dbf8dfec50191fb5cf8c98d6c81120457 | 802 | https://github.com/gterrono/houston/blob/16ea359dbf8dfec50191fb5cf8c98d6c81120457/client/zma_helpers.coffee | 1 | 27 |
gterrono/houston:client/zma_helpers.coffee:1:completion | completion | if Handlebars?
Handlebars.registerHelper('onHoustonPage', ->
window.location.pathname.indexOf('/admin') == 0)
# regardless of what version of meteor we are using,
# get the right LocalCollection
Houston._get_collection = (collection_name) ->
unless Houston[collection_name]
try
# you can only instanti... | # works for 0.6.6.2+
Houston[collection_name] = \
Meteor.connection._mongo_livedata_collections[collection_name]
catch e
# old versions of meteor (older than 0.6.6.2)
Houston[collection_name] =
Meteor._LocalCollectionDriver.collections[collection_name]
return Houston... | CoffeeScript | CoffeeScript | gterrono/houston | client/zma_helpers.coffee | MIT | 16ea359dbf8dfec50191fb5cf8c98d6c81120457 | 802 | https://github.com/gterrono/houston/blob/16ea359dbf8dfec50191fb5cf8c98d6c81120457/client/zma_helpers.coffee | 1 | 27 |
gterrono/houston:client/zma_helpers.coffee:1:raw_corpus | raw_corpus | if Handlebars?
Handlebars.registerHelper('onHoustonPage', ->
window.location.pathname.indexOf('/houston') == 0)
# regardless of what version of meteor we are using,
# get the right LocalCollection
Houston._get_collection = (collection_name) ->
unless Houston[collection_name]
try
# you can only instan... | CoffeeScript | gterrono/houston | client/zma_helpers.coffee | MIT | 93e06a251afa99843d47e26f6bfde1ba3c93c47e | 802 | https://github.com/gterrono/houston/blob/93e06a251afa99843d47e26f6bfde1ba3c93c47e/client/zma_helpers.coffee | 1 | 22 | ||
gterrono/houston:client/zma_helpers.coffee:1:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
if Handlebars?
Handlebars.registerHelper('onHoustonPage', ->
window.location.pathname.indexOf('/houston') == 0)
# regardless of what version of meteor we are using,
# get the right LocalCollection
Houston._get_collection = (collection_name) ->
unless Hou... | if (typeof Handlebars !== "undefined" && Handlebars !== null) {
Handlebars.registerHelper('onHoustonPage', function() {
return window.location.pathname.indexOf('/houston') === 0;
});
}
// regardless of what version of meteor we are using,
// get the right LocalCollection
Houston._get_collection = function(coll... | CoffeeScript | JavaScript | gterrono/houston | client/zma_helpers.coffee | MIT | 93e06a251afa99843d47e26f6bfde1ba3c93c47e | 802 | https://github.com/gterrono/houston/blob/93e06a251afa99843d47e26f6bfde1ba3c93c47e/client/zma_helpers.coffee | 1 | 22 |
gterrono/houston:client/zma_helpers.coffee:1:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
if (typeof Handlebars !== "undefined" && Handlebars !== null) {
Handlebars.registerHelper('onHoustonPage', function() {
return window.location.pathname.indexOf('/houston') === 0;
});
}
// regardless of what version of meteor we are using,
// get the right ... | if Handlebars?
Handlebars.registerHelper('onHoustonPage', ->
window.location.pathname.indexOf('/houston') == 0)
# regardless of what version of meteor we are using,
# get the right LocalCollection
Houston._get_collection = (collection_name) ->
unless Houston[collection_name]
try
# you can only instan... | JavaScript | CoffeeScript | gterrono/houston | client/zma_helpers.coffee | MIT | 93e06a251afa99843d47e26f6bfde1ba3c93c47e | 802 | https://github.com/gterrono/houston/blob/93e06a251afa99843d47e26f6bfde1ba3c93c47e/client/zma_helpers.coffee | 1 | 22 |
gterrono/houston:client/zma_helpers.coffee:1:completion | completion | if Handlebars?
Handlebars.registerHelper('onHoustonPage', ->
window.location.pathname.indexOf('/houston') == 0)
# regardless of what version of meteor we are using,
# get the right LocalCollection
Houston._get_collection = (collection_name) ->
unless Houston[collection_name]
try
# you can only instan... | catch e
try
# works for 0.6.6.2+
Houston[collection_name] = \
Meteor.connection._mongo_livedata_collections[collection_name]
catch e
# old versions of meteor (older than 0.6.6.2)
Houston[collection_name] =
Meteor._LocalCollectionDriver.collections[collecti... | CoffeeScript | CoffeeScript | gterrono/houston | client/zma_helpers.coffee | MIT | 93e06a251afa99843d47e26f6bfde1ba3c93c47e | 802 | https://github.com/gterrono/houston/blob/93e06a251afa99843d47e26f6bfde1ba3c93c47e/client/zma_helpers.coffee | 1 | 22 |
gterrono/houston:client/zma_helpers.coffee:1:raw_corpus | raw_corpus | if Handlebars?
Handlebars.registerHelper('isAdminPage', ->
window.location.pathname.indexOf('/admin') == 0)
# regardless of what version of meteor we are using,
# get the right LocalCollection
window.get_collection = (collection_name) ->
COLLECTION_STORAGE = window # TODO find a better global object
inspecto... | CoffeeScript | gterrono/houston | client/zma_helpers.coffee | MIT | 807768bc0f427d33bc2cad8771293fcfa4722c13 | 802 | https://github.com/gterrono/houston/blob/807768bc0f427d33bc2cad8771293fcfa4722c13/client/zma_helpers.coffee | 1 | 25 | ||
gterrono/houston:client/zma_helpers.coffee:1:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
if Handlebars?
Handlebars.registerHelper('isAdminPage', ->
window.location.pathname.indexOf('/admin') == 0)
# regardless of what version of meteor we are using,
# get the right LocalCollection
window.get_collection = (collection_name) ->
COLLECTION_STORA... | if (typeof Handlebars !== "undefined" && Handlebars !== null) {
Handlebars.registerHelper('isAdminPage', function() {
return window.location.pathname.indexOf('/admin') === 0;
});
}
// regardless of what version of meteor we are using,
// get the right LocalCollection
window.get_collection = function(collection... | CoffeeScript | JavaScript | gterrono/houston | client/zma_helpers.coffee | MIT | 807768bc0f427d33bc2cad8771293fcfa4722c13 | 802 | https://github.com/gterrono/houston/blob/807768bc0f427d33bc2cad8771293fcfa4722c13/client/zma_helpers.coffee | 1 | 25 |
gterrono/houston:client/zma_helpers.coffee:1:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
if (typeof Handlebars !== "undefined" && Handlebars !== null) {
Handlebars.registerHelper('isAdminPage', function() {
return window.location.pathname.indexOf('/admin') === 0;
});
}
// regardless of what version of meteor we are using,
// get the right Loca... | if Handlebars?
Handlebars.registerHelper('isAdminPage', ->
window.location.pathname.indexOf('/admin') == 0)
# regardless of what version of meteor we are using,
# get the right LocalCollection
window.get_collection = (collection_name) ->
COLLECTION_STORAGE = window # TODO find a better global object
inspecto... | JavaScript | CoffeeScript | gterrono/houston | client/zma_helpers.coffee | MIT | 807768bc0f427d33bc2cad8771293fcfa4722c13 | 802 | https://github.com/gterrono/houston/blob/807768bc0f427d33bc2cad8771293fcfa4722c13/client/zma_helpers.coffee | 1 | 25 |
gterrono/houston:client/zma_helpers.coffee:1:completion | completion | if Handlebars?
Handlebars.registerHelper('isAdminPage', ->
window.location.pathname.indexOf('/admin') == 0)
# regardless of what version of meteor we are using,
# get the right LocalCollection
window.get_collection = (collection_name) ->
COLLECTION_STORAGE = window # TODO find a better global object
inspecto... | # you can only instantiate a collection once
COLLECTION_STORAGE[inspector_name] = new Meteor.Collection(collection_name)
catch e
try
# works for 0.6.6.2+
COLLECTION_STORAGE[inspector_name] = \
Meteor.connection._mongo_livedata_collections[collection_name]
catch e
... | CoffeeScript | CoffeeScript | gterrono/houston | client/zma_helpers.coffee | MIT | 807768bc0f427d33bc2cad8771293fcfa4722c13 | 802 | https://github.com/gterrono/houston/blob/807768bc0f427d33bc2cad8771293fcfa4722c13/client/zma_helpers.coffee | 1 | 25 |
gterrono/houston:client/zma_helpers.coffee:1:raw_corpus | raw_corpus | if Handlebars?
Handlebars.registerHelper('isAdminPage', ->
window.location.pathname.indexOf('/admin') == 0) | CoffeeScript | gterrono/houston | client/zma_helpers.coffee | MIT | 1ac1760676451b82abce50bfd1c492fb0ef15e5a | 802 | https://github.com/gterrono/houston/blob/1ac1760676451b82abce50bfd1c492fb0ef15e5a/client/zma_helpers.coffee | 1 | 3 | ||
gterrono/houston:client/zma_helpers.coffee:1:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
if Handlebars?
Handlebars.registerHelper('isAdminPage', ->
window.location.pathname.indexOf('/admin') == 0)
``` | if (typeof Handlebars !== "undefined" && Handlebars !== null) {
Handlebars.registerHelper('isAdminPage', function() {
return window.location.pathname.indexOf('/admin') === 0;
});
} | CoffeeScript | JavaScript | gterrono/houston | client/zma_helpers.coffee | MIT | 1ac1760676451b82abce50bfd1c492fb0ef15e5a | 802 | https://github.com/gterrono/houston/blob/1ac1760676451b82abce50bfd1c492fb0ef15e5a/client/zma_helpers.coffee | 1 | 3 |
gterrono/houston:client/zma_helpers.coffee:1:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
if (typeof Handlebars !== "undefined" && Handlebars !== null) {
Handlebars.registerHelper('isAdminPage', function() {
return window.location.pathname.indexOf('/admin') === 0;
});
}
``` | if Handlebars?
Handlebars.registerHelper('isAdminPage', ->
window.location.pathname.indexOf('/admin') == 0) | JavaScript | CoffeeScript | gterrono/houston | client/zma_helpers.coffee | MIT | 1ac1760676451b82abce50bfd1c492fb0ef15e5a | 802 | https://github.com/gterrono/houston/blob/1ac1760676451b82abce50bfd1c492fb0ef15e5a/client/zma_helpers.coffee | 1 | 3 |
jianliaoim/talk-os:talk-web/client/util/assemble.coffee:1:raw_corpus | raw_corpus | fillMessage = (content) ->
content.replace /\{\{__([\w-]+)\}\}/g, (raw, key) ->
text = lang.getText(key)
if text then text else raw | CoffeeScript | jianliaoim/talk-os | talk-web/client/util/assemble.coffee | MIT | 2545c4497865779a55762e03963a39237df9046b | 2,703 | https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-web/client/util/assemble.coffee | 6 | 9 | ||
jianliaoim/talk-os:talk-web/client/util/assemble.coffee:1:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
fillMessage = (content) ->
content.replace /\{\{__([\w-]+)\}\}/g, (raw, key) ->
text = lang.getText(key)
if text then text else raw
``` | var fillMessage;
fillMessage = function(content) {
return content.replace(/\{\{__([\w-]+)\}\}/g, function(raw, key) {
var text;
text = lang.getText(key);
if (text) {
return text;
} else {
return raw;
}
});
}; | CoffeeScript | JavaScript | jianliaoim/talk-os | talk-web/client/util/assemble.coffee | MIT | 2545c4497865779a55762e03963a39237df9046b | 2,703 | https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-web/client/util/assemble.coffee | 6 | 9 |
jianliaoim/talk-os:talk-web/client/util/assemble.coffee:1:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
var fillMessage;
fillMessage = function(content) {
return content.replace(/\{\{__([\w-]+)\}\}/g, function(raw, key) {
var text;
text = lang.getText(key);
if (text) {
return text;
} else {
return raw;
}
});
};
``` | fillMessage = (content) ->
content.replace /\{\{__([\w-]+)\}\}/g, (raw, key) ->
text = lang.getText(key)
if text then text else raw | JavaScript | CoffeeScript | jianliaoim/talk-os | talk-web/client/util/assemble.coffee | MIT | 2545c4497865779a55762e03963a39237df9046b | 2,703 | https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-web/client/util/assemble.coffee | 6 | 9 |
jianliaoim/talk-os:talk-web/client/util/assemble.coffee:1:completion | completion | fillMessage = (content) ->
content.replace /\{\{__([\w-]+)\}\}/g, (raw, key) -> | text = lang.getText(key)
if text then text else raw | CoffeeScript | CoffeeScript | jianliaoim/talk-os | talk-web/client/util/assemble.coffee | MIT | 2545c4497865779a55762e03963a39237df9046b | 2,703 | https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-web/client/util/assemble.coffee | 6 | 9 |
jianliaoim/talk-os:talk-web/client/util/assemble.coffee:2:raw_corpus | raw_corpus | exports.notification = (data, team) ->
contact = data.creator
body = msgDsl.flattern(msgDsl.read(fillMessage(data.body or '')))
if team?
body = "[#{team}]\n#{body}"
if data.attachments.length > 0
attachment = data.attachments[0]
switch attachment.category
when 'snippet'
type = 'catego... | CoffeeScript | jianliaoim/talk-os | talk-web/client/util/assemble.coffee | MIT | 2545c4497865779a55762e03963a39237df9046b | 2,703 | https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-web/client/util/assemble.coffee | 11 | 34 | ||
jianliaoim/talk-os:talk-web/client/util/assemble.coffee:2:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
exports.notification = (data, team) ->
contact = data.creator
body = msgDsl.flattern(msgDsl.read(fillMessage(data.body or '')))
if team?
body = "[#{team}]\n#{body}"
if data.attachments.length > 0
attachment = data.attachments[0]
switch attach... | exports.notification = function(data, team) {
var attachment, body, contact, type;
contact = data.creator;
body = msgDsl.flattern(msgDsl.read(fillMessage(data.body || '')));
if (team != null) {
body = `[${team}]\n${body}`;
}
if (data.attachments.length > 0) {
attachment = data.attachments[0];
sw... | CoffeeScript | JavaScript | jianliaoim/talk-os | talk-web/client/util/assemble.coffee | MIT | 2545c4497865779a55762e03963a39237df9046b | 2,703 | https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-web/client/util/assemble.coffee | 11 | 34 |
jianliaoim/talk-os:talk-web/client/util/assemble.coffee:2:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
exports.notification = function(data, team) {
var attachment, body, contact, type;
contact = data.creator;
body = msgDsl.flattern(msgDsl.read(fillMessage(data.body || '')));
if (team != null) {
body = `[${team}]\n${body}`;
}
if (data.attachments.len... | exports.notification = (data, team) ->
contact = data.creator
body = msgDsl.flattern(msgDsl.read(fillMessage(data.body or '')))
if team?
body = "[#{team}]\n#{body}"
if data.attachments.length > 0
attachment = data.attachments[0]
switch attachment.category
when 'snippet'
type = 'catego... | JavaScript | CoffeeScript | jianliaoim/talk-os | talk-web/client/util/assemble.coffee | MIT | 2545c4497865779a55762e03963a39237df9046b | 2,703 | https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-web/client/util/assemble.coffee | 11 | 34 |
jianliaoim/talk-os:talk-web/client/util/assemble.coffee:2:completion | completion | exports.notification = (data, team) ->
contact = data.creator
body = msgDsl.flattern(msgDsl.read(fillMessage(data.body or '')))
if team?
body = "[#{team}]\n#{body}"
if data.attachments.length > 0
attachment = data.attachments[0]
switch attachment.category
when 'snippet'
type = 'catego... | type = 'category-post'
when 'quote'
type = 'attachments'
when 'file'
type = 'category-file'
else
type = 'attachments'
body = "#{body}\n[#{lang.getText(type)}]"
title: contact?.name or ''
icon: contact?.avatarUrl or ''
body: body | CoffeeScript | CoffeeScript | jianliaoim/talk-os | talk-web/client/util/assemble.coffee | MIT | 2545c4497865779a55762e03963a39237df9046b | 2,703 | https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-web/client/util/assemble.coffee | 11 | 34 |
jianliaoim/talk-os:talk-web/client/util/assemble.coffee:3:raw_corpus | raw_corpus | exports.localMessage = ({_roomId, _storyId, _teamId, alias, receiver, sender, talkai}) ->
params = "&_userId=#{ receiver.get('_id') }"
receiverName = alias or receiver.get('name')
[text1, text2, text3, text4, text5] = lang.getText('you-may-invite').split('%s')
boldName = category: 'bold', model: '', view: " #{... | CoffeeScript | jianliaoim/talk-os | talk-web/client/util/assemble.coffee | MIT | 2545c4497865779a55762e03963a39237df9046b | 2,703 | https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-web/client/util/assemble.coffee | 36 | 52 | ||
jianliaoim/talk-os:talk-web/client/util/assemble.coffee:3:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
exports.localMessage = ({_roomId, _storyId, _teamId, alias, receiver, sender, talkai}) ->
params = "&_userId=#{ receiver.get('_id') }"
receiverName = alias or receiver.get('name')
[text1, text2, text3, text4, text5] = lang.getText('you-may-invite').split('%... | exports.localMessage = function({_roomId, _storyId, _teamId, alias, receiver, sender, talkai}) {
var boldName, content, linkText, localMessage, params, receiverName, text1, text2, text3, text4, text5;
params = `&_userId=${receiver.get('_id')}`;
receiverName = alias || receiver.get('name');
[text1, text2, text3,... | CoffeeScript | JavaScript | jianliaoim/talk-os | talk-web/client/util/assemble.coffee | MIT | 2545c4497865779a55762e03963a39237df9046b | 2,703 | https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-web/client/util/assemble.coffee | 36 | 52 |
jianliaoim/talk-os:talk-web/client/util/assemble.coffee:3:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
exports.localMessage = function({_roomId, _storyId, _teamId, alias, receiver, sender, talkai}) {
var boldName, content, linkText, localMessage, params, receiverName, text1, text2, text3, text4, text5;
params = `&_userId=${receiver.get('_id')}`;
receiverName =... | exports.localMessage = ({_roomId, _storyId, _teamId, alias, receiver, sender, talkai}) ->
params = "&_userId=#{ receiver.get('_id') }"
receiverName = alias or receiver.get('name')
[text1, text2, text3, text4, text5] = lang.getText('you-may-invite').split('%s')
boldName = category: 'bold', model: '', view: " #{... | JavaScript | CoffeeScript | jianliaoim/talk-os | talk-web/client/util/assemble.coffee | MIT | 2545c4497865779a55762e03963a39237df9046b | 2,703 | https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-web/client/util/assemble.coffee | 36 | 52 |
jianliaoim/talk-os:talk-web/client/util/assemble.coffee:3:completion | completion | exports.localMessage = ({_roomId, _storyId, _teamId, alias, receiver, sender, talkai}) ->
params = "&_userId=#{ receiver.get('_id') }"
receiverName = alias or receiver.get('name')
[text1, text2, text3, text4, text5] = lang.getText('you-may-invite').split('%s')
boldName = category: 'bold', model: '', view: " #{... | localMessage =
_roomId: _roomId
_teamId: _teamId
_storyId: _storyId
_creatorId: talkai.get('_id')
body: msgDsl.write content
creator: talkai
isEditable: false
isLocal: true | CoffeeScript | CoffeeScript | jianliaoim/talk-os | talk-web/client/util/assemble.coffee | MIT | 2545c4497865779a55762e03963a39237df9046b | 2,703 | https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-web/client/util/assemble.coffee | 36 | 52 |
jianliaoim/talk-os:talk-web/client/util/assemble.coffee:4:raw_corpus | raw_corpus | exports.localTalkMessage = ({body, talkai, _teamId, _roomId, _storyId}) ->
localMessage =
_teamId: _teamId
_roomId: _roomId
_storyId: _storyId
_creatorId: talkai.get '_id'
body: body
creator: talkai
isLocal: true
isEditable: false | CoffeeScript | jianliaoim/talk-os | talk-web/client/util/assemble.coffee | MIT | 2545c4497865779a55762e03963a39237df9046b | 2,703 | https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-web/client/util/assemble.coffee | 54 | 63 | ||
jianliaoim/talk-os:talk-web/client/util/assemble.coffee:4:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
exports.localTalkMessage = ({body, talkai, _teamId, _roomId, _storyId}) ->
localMessage =
_teamId: _teamId
_roomId: _roomId
_storyId: _storyId
_creatorId: talkai.get '_id'
body: body
creator: talkai
isLocal: true
isEditable: fals... | exports.localTalkMessage = function({body, talkai, _teamId, _roomId, _storyId}) {
var localMessage;
return localMessage = {
_teamId: _teamId,
_roomId: _roomId,
_storyId: _storyId,
_creatorId: talkai.get('_id'),
body: body,
creator: talkai,
isLocal: true,
isEditable: false
};
}; | CoffeeScript | JavaScript | jianliaoim/talk-os | talk-web/client/util/assemble.coffee | MIT | 2545c4497865779a55762e03963a39237df9046b | 2,703 | https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-web/client/util/assemble.coffee | 54 | 63 |
jianliaoim/talk-os:talk-web/client/util/assemble.coffee:4:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
exports.localTalkMessage = function({body, talkai, _teamId, _roomId, _storyId}) {
var localMessage;
return localMessage = {
_teamId: _teamId,
_roomId: _roomId,
_storyId: _storyId,
_creatorId: talkai.get('_id'),
body: body,
creator: talka... | exports.localTalkMessage = ({body, talkai, _teamId, _roomId, _storyId}) ->
localMessage =
_teamId: _teamId
_roomId: _roomId
_storyId: _storyId
_creatorId: talkai.get '_id'
body: body
creator: talkai
isLocal: true
isEditable: false | JavaScript | CoffeeScript | jianliaoim/talk-os | talk-web/client/util/assemble.coffee | MIT | 2545c4497865779a55762e03963a39237df9046b | 2,703 | https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-web/client/util/assemble.coffee | 54 | 63 |
jianliaoim/talk-os:talk-web/client/util/assemble.coffee:4:completion | completion | exports.localTalkMessage = ({body, talkai, _teamId, _roomId, _storyId}) ->
localMessage =
_teamId: _teamId
_roomId: _roomId
_storyId: _storyId | _creatorId: talkai.get '_id'
body: body
creator: talkai
isLocal: true
isEditable: false | CoffeeScript | CoffeeScript | jianliaoim/talk-os | talk-web/client/util/assemble.coffee | MIT | 2545c4497865779a55762e03963a39237df9046b | 2,703 | https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-web/client/util/assemble.coffee | 54 | 63 |
jianliaoim/talk-os:talk-web/client/util/assemble.coffee:5:raw_corpus | raw_corpus | exports.allMembers = ->
_id: 'all'
name: lang.getText('all-members')
pinyins: if lang.getLang() is 'zh' then ['suoyou'] else ['all']
avatarUrl: 'https://dn-talk.oss.aliyuncs.com/icons/all-members.png' | CoffeeScript | jianliaoim/talk-os | talk-web/client/util/assemble.coffee | MIT | 2545c4497865779a55762e03963a39237df9046b | 2,703 | https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-web/client/util/assemble.coffee | 65 | 69 | ||
jianliaoim/talk-os:talk-web/client/util/assemble.coffee:5:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
exports.allMembers = ->
_id: 'all'
name: lang.getText('all-members')
pinyins: if lang.getLang() is 'zh' then ['suoyou'] else ['all']
avatarUrl: 'https://dn-talk.oss.aliyuncs.com/icons/all-members.png'
``` | exports.allMembers = function() {
return {
_id: 'all',
name: lang.getText('all-members'),
pinyins: lang.getLang() === 'zh' ? ['suoyou'] : ['all'],
avatarUrl: 'https://dn-talk.oss.aliyuncs.com/icons/all-members.png'
};
}; | CoffeeScript | JavaScript | jianliaoim/talk-os | talk-web/client/util/assemble.coffee | MIT | 2545c4497865779a55762e03963a39237df9046b | 2,703 | https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-web/client/util/assemble.coffee | 65 | 69 |
jianliaoim/talk-os:talk-web/client/util/assemble.coffee:5:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
exports.allMembers = function() {
return {
_id: 'all',
name: lang.getText('all-members'),
pinyins: lang.getLang() === 'zh' ? ['suoyou'] : ['all'],
avatarUrl: 'https://dn-talk.oss.aliyuncs.com/icons/all-members.png'
};
};
``` | exports.allMembers = ->
_id: 'all'
name: lang.getText('all-members')
pinyins: if lang.getLang() is 'zh' then ['suoyou'] else ['all']
avatarUrl: 'https://dn-talk.oss.aliyuncs.com/icons/all-members.png' | JavaScript | CoffeeScript | jianliaoim/talk-os | talk-web/client/util/assemble.coffee | MIT | 2545c4497865779a55762e03963a39237df9046b | 2,703 | https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-web/client/util/assemble.coffee | 65 | 69 |
jianliaoim/talk-os:talk-web/client/util/assemble.coffee:5:completion | completion | exports.allMembers = ->
_id: 'all' | name: lang.getText('all-members')
pinyins: if lang.getLang() is 'zh' then ['suoyou'] else ['all']
avatarUrl: 'https://dn-talk.oss.aliyuncs.com/icons/all-members.png' | CoffeeScript | CoffeeScript | jianliaoim/talk-os | talk-web/client/util/assemble.coffee | MIT | 2545c4497865779a55762e03963a39237df9046b | 2,703 | https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-web/client/util/assemble.coffee | 65 | 69 |
jianliaoim/talk-os:talk-web/client/util/assemble.coffee:6:raw_corpus | raw_corpus | exports.storyFile = (data) ->
Immutable.fromJS
fileKey: data.fileKey or ''
fileName: data.fileName or ''
fileSize: data.fileSize or ''
fileType: data.fileType or ''
imageWidth: data.imageWidth or ''
previewUrl: data.previewUrl or ''
downloadUrl: data.downloadUrl or ''
imageHeight: data... | CoffeeScript | jianliaoim/talk-os | talk-web/client/util/assemble.coffee | MIT | 2545c4497865779a55762e03963a39237df9046b | 2,703 | https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-web/client/util/assemble.coffee | 71 | 83 | ||
jianliaoim/talk-os:talk-web/client/util/assemble.coffee:6:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
exports.storyFile = (data) ->
Immutable.fromJS
fileKey: data.fileKey or ''
fileName: data.fileName or ''
fileSize: data.fileSize or ''
fileType: data.fileType or ''
imageWidth: data.imageWidth or ''
previewUrl: data.previewUrl or ''
... | exports.storyFile = function(data) {
return Immutable.fromJS({
fileKey: data.fileKey || '',
fileName: data.fileName || '',
fileSize: data.fileSize || '',
fileType: data.fileType || '',
imageWidth: data.imageWidth || '',
previewUrl: data.previewUrl || '',
downloadUrl: data.downloadUrl || ''... | CoffeeScript | JavaScript | jianliaoim/talk-os | talk-web/client/util/assemble.coffee | MIT | 2545c4497865779a55762e03963a39237df9046b | 2,703 | https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-web/client/util/assemble.coffee | 71 | 83 |
jianliaoim/talk-os:talk-web/client/util/assemble.coffee:6:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
exports.storyFile = function(data) {
return Immutable.fromJS({
fileKey: data.fileKey || '',
fileName: data.fileName || '',
fileSize: data.fileSize || '',
fileType: data.fileType || '',
imageWidth: data.imageWidth || '',
previewUrl: data.pr... | exports.storyFile = (data) ->
Immutable.fromJS
fileKey: data.fileKey or ''
fileName: data.fileName or ''
fileSize: data.fileSize or ''
fileType: data.fileType or ''
imageWidth: data.imageWidth or ''
previewUrl: data.previewUrl or ''
downloadUrl: data.downloadUrl or ''
imageHeight: data... | JavaScript | CoffeeScript | jianliaoim/talk-os | talk-web/client/util/assemble.coffee | MIT | 2545c4497865779a55762e03963a39237df9046b | 2,703 | https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-web/client/util/assemble.coffee | 71 | 83 |
jianliaoim/talk-os:talk-web/client/util/assemble.coffee:6:completion | completion | exports.storyFile = (data) ->
Immutable.fromJS
fileKey: data.fileKey or ''
fileName: data.fileName or ''
fileSize: data.fileSize or ''
fileType: data.fileType or '' | imageWidth: data.imageWidth or ''
previewUrl: data.previewUrl or ''
downloadUrl: data.downloadUrl or ''
imageHeight: data.imageHeight or ''
fileCategory: data.fileCategory or ''
thumbnailUrl: data.thumbnailUrl or ''
title: data.fileName or '' | CoffeeScript | CoffeeScript | jianliaoim/talk-os | talk-web/client/util/assemble.coffee | MIT | 2545c4497865779a55762e03963a39237df9046b | 2,703 | https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-web/client/util/assemble.coffee | 71 | 83 |
jianliaoim/talk-os:talk-web/client/util/assemble.coffee:7:raw_corpus | raw_corpus | exports.storyLink = (data, url) ->
Immutable.fromJS
text: data.text or ''
title: data.title or url
imageUrl: data.imageUrl or ''
faviconUrl: data.faviconUrl or ''
url: data.url or url | CoffeeScript | jianliaoim/talk-os | talk-web/client/util/assemble.coffee | MIT | 2545c4497865779a55762e03963a39237df9046b | 2,703 | https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-web/client/util/assemble.coffee | 85 | 91 | ||
jianliaoim/talk-os:talk-web/client/util/assemble.coffee:7:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
exports.storyLink = (data, url) ->
Immutable.fromJS
text: data.text or ''
title: data.title or url
imageUrl: data.imageUrl or ''
faviconUrl: data.faviconUrl or ''
url: data.url or url
``` | exports.storyLink = function(data, url) {
return Immutable.fromJS({
text: data.text || '',
title: data.title || url,
imageUrl: data.imageUrl || '',
faviconUrl: data.faviconUrl || '',
url: data.url || url
});
}; | CoffeeScript | JavaScript | jianliaoim/talk-os | talk-web/client/util/assemble.coffee | MIT | 2545c4497865779a55762e03963a39237df9046b | 2,703 | https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-web/client/util/assemble.coffee | 85 | 91 |
jianliaoim/talk-os:talk-web/client/util/assemble.coffee:7:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
exports.storyLink = function(data, url) {
return Immutable.fromJS({
text: data.text || '',
title: data.title || url,
imageUrl: data.imageUrl || '',
faviconUrl: data.faviconUrl || '',
url: data.url || url
});
};
``` | exports.storyLink = (data, url) ->
Immutable.fromJS
text: data.text or ''
title: data.title or url
imageUrl: data.imageUrl or ''
faviconUrl: data.faviconUrl or ''
url: data.url or url | JavaScript | CoffeeScript | jianliaoim/talk-os | talk-web/client/util/assemble.coffee | MIT | 2545c4497865779a55762e03963a39237df9046b | 2,703 | https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-web/client/util/assemble.coffee | 85 | 91 |
jianliaoim/talk-os:talk-web/client/util/assemble.coffee:7:completion | completion | exports.storyLink = (data, url) ->
Immutable.fromJS
text: data.text or '' | title: data.title or url
imageUrl: data.imageUrl or ''
faviconUrl: data.faviconUrl or ''
url: data.url or url | CoffeeScript | CoffeeScript | jianliaoim/talk-os | talk-web/client/util/assemble.coffee | MIT | 2545c4497865779a55762e03963a39237df9046b | 2,703 | https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-web/client/util/assemble.coffee | 85 | 91 |
jianliaoim/talk-os:talk-web/client/util/assemble.coffee:8:raw_corpus | raw_corpus | exports.draftStory = (_teamId, _id, category) ->
data =
switch category
when 'file'
fileKey: ''
fileName: ''
fileSize: ''
fileType: ''
previewUrl: ''
imageWidth: ''
downloadUrl: ''
imageHeight: ''
fileCategory: ''
thumbnailUrl: ... | CoffeeScript | jianliaoim/talk-os | talk-web/client/util/assemble.coffee | MIT | 2545c4497865779a55762e03963a39237df9046b | 2,703 | https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-web/client/util/assemble.coffee | 93 | 126 | ||
jianliaoim/talk-os:talk-web/client/util/assemble.coffee:8:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
exports.draftStory = (_teamId, _id, category) ->
data =
switch category
when 'file'
fileKey: ''
fileName: ''
fileSize: ''
fileType: ''
previewUrl: ''
imageWidth: ''
downloadUrl: ''
imageH... | exports.draftStory = function(_teamId, _id, category) {
var data;
data = (function() {
switch (category) {
case 'file':
return {
fileKey: '',
fileName: '',
fileSize: '',
fileType: '',
previewUrl: '',
imageWidth: '',
downloadUrl:... | CoffeeScript | JavaScript | jianliaoim/talk-os | talk-web/client/util/assemble.coffee | MIT | 2545c4497865779a55762e03963a39237df9046b | 2,703 | https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-web/client/util/assemble.coffee | 93 | 126 |
jianliaoim/talk-os:talk-web/client/util/assemble.coffee:8:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
exports.draftStory = function(_teamId, _id, category) {
var data;
data = (function() {
switch (category) {
case 'file':
return {
fileKey: '',
fileName: '',
fileSize: '',
fileType: '',
previewUr... | exports.draftStory = (_teamId, _id, category) ->
data =
switch category
when 'file'
fileKey: ''
fileName: ''
fileSize: ''
fileType: ''
previewUrl: ''
imageWidth: ''
downloadUrl: ''
imageHeight: ''
fileCategory: ''
thumbnailUrl: ... | JavaScript | CoffeeScript | jianliaoim/talk-os | talk-web/client/util/assemble.coffee | MIT | 2545c4497865779a55762e03963a39237df9046b | 2,703 | https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-web/client/util/assemble.coffee | 93 | 126 |
jianliaoim/talk-os:talk-web/client/util/assemble.coffee:8:completion | completion | exports.draftStory = (_teamId, _id, category) ->
data =
switch category
when 'file'
fileKey: ''
fileName: ''
fileSize: ''
fileType: ''
previewUrl: ''
imageWidth: ''
downloadUrl: ''
imageHeight: ''
fileCategory: ''
thumbnailUrl: ... | title: ''
imageUrl: ''
faviconUrl: ''
when 'topic'
text: ''
title: ''
else {}
Immutable.fromJS
_teamId: _teamId
_draftId: _id
_memberIds: []
data: data
text: ''
title: ''
members: []
category: category | CoffeeScript | CoffeeScript | jianliaoim/talk-os | talk-web/client/util/assemble.coffee | MIT | 2545c4497865779a55762e03963a39237df9046b | 2,703 | https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-web/client/util/assemble.coffee | 93 | 126 |
jianliaoim/talk-os:talk-api2x/server/schemas/attachments/message.coffee:1:raw_corpus | raw_corpus | {Schema} = require 'mongoose'
util = require '../../util'
module.exports = MessageSchema = new Schema
creator: Object
team: type: Schema.Types.ObjectId
room: Object
to: Object
body: type: String
isSystem: type: Boolean, default: false
icon: type: String, default: 'normal'
createdAt: type: Date, default... | CoffeeScript | jianliaoim/talk-os | talk-api2x/server/schemas/attachments/message.coffee | MIT | 2545c4497865779a55762e03963a39237df9046b | 2,703 | https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-api2x/server/schemas/attachments/message.coffee | 1 | 25 | ||
jianliaoim/talk-os:talk-api2x/server/schemas/attachments/message.coffee:1:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
{Schema} = require 'mongoose'
util = require '../../util'
module.exports = MessageSchema = new Schema
creator: Object
team: type: Schema.Types.ObjectId
room: Object
to: Object
body: type: String
isSystem: type: Boolean, default: false
icon: type: S... | var MessageSchema, Schema, util;
({Schema} = require('mongoose'));
util = require('../../util');
module.exports = MessageSchema = new Schema({
creator: Object,
team: {
type: Schema.Types.ObjectId
},
room: Object,
to: Object,
body: {
type: String
},
isSystem: {
type: Boolean,
default: ... | CoffeeScript | JavaScript | jianliaoim/talk-os | talk-api2x/server/schemas/attachments/message.coffee | MIT | 2545c4497865779a55762e03963a39237df9046b | 2,703 | https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-api2x/server/schemas/attachments/message.coffee | 1 | 25 |
jianliaoim/talk-os:talk-api2x/server/schemas/attachments/message.coffee:1:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
var MessageSchema, Schema, util;
({Schema} = require('mongoose'));
util = require('../../util');
module.exports = MessageSchema = new Schema({
creator: Object,
team: {
type: Schema.Types.ObjectId
},
room: Object,
to: Object,
body: {
type: Str... | {Schema} = require 'mongoose'
util = require '../../util'
module.exports = MessageSchema = new Schema
creator: Object
team: type: Schema.Types.ObjectId
room: Object
to: Object
body: type: String
isSystem: type: Boolean, default: false
icon: type: String, default: 'normal'
createdAt: type: Date, default... | JavaScript | CoffeeScript | jianliaoim/talk-os | talk-api2x/server/schemas/attachments/message.coffee | MIT | 2545c4497865779a55762e03963a39237df9046b | 2,703 | https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-api2x/server/schemas/attachments/message.coffee | 1 | 25 |
jianliaoim/talk-os:talk-api2x/server/schemas/attachments/message.coffee:1:completion | completion | {Schema} = require 'mongoose'
util = require '../../util'
module.exports = MessageSchema = new Schema
creator: Object
team: type: Schema.Types.ObjectId
room: Object
to: Object
body: type: String
isSystem: type: Boolean, default: false
icon: type: String, default: 'normal'
createdAt: type: Date, default... | updatedAt: type: Date, default: Date.now
MessageSchema.virtual '_creatorId'
.get -> @creator?._id
MessageSchema.virtual '_roomId'
.get -> @room?._id
MessageSchema.virtual '_toId'
.get -> @to?._id
MessageSchema.virtual '_teamId'
.get -> @team | CoffeeScript | CoffeeScript | jianliaoim/talk-os | talk-api2x/server/schemas/attachments/message.coffee | MIT | 2545c4497865779a55762e03963a39237df9046b | 2,703 | https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-api2x/server/schemas/attachments/message.coffee | 1 | 25 |
mojs/mojs:src/shapes/rect.coffee:1:raw_corpus | raw_corpus | # ignore coffescript sudo code
Bit = require('./bit').default
class Rect extends Bit
# shape: 'rect'
# ratio: 1.43
_declareDefaults:->
super()
this._defaults.tag = 'rect'
this._defaults.rx = 0
this._defaults.ry = 0
# this._defaults.ratio = 1.43
_draw:->
super()
p = @_props
... | CoffeeScript | mojs/mojs | src/shapes/rect.coffee | MIT | 0a9cf9a87dd5637e6fa770755e79048489bcf817 | 18,698 | https://github.com/mojs/mojs/blob/0a9cf9a87dd5637e6fa770755e79048489bcf817/src/shapes/rect.coffee | 1 | 31 | ||
mojs/mojs:src/shapes/rect.coffee:1:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
# ignore coffescript sudo code
Bit = require('./bit').default
class Rect extends Bit
# shape: 'rect'
# ratio: 1.43
_declareDefaults:->
super()
this._defaults.tag = 'rect'
this._defaults.rx = 0
this._defaults.ry = 0
# this._defaul... | // ignore coffescript sudo code
var Bit, Rect;
Bit = require('./bit').default;
Rect = class Rect extends Bit {
// shape: 'rect'
// ratio: 1.43
_declareDefaults() {
super._declareDefaults();
this._defaults.tag = 'rect';
this._defaults.rx = 0;
return this._defaults.ry = 0;
}
// this._defa... | CoffeeScript | JavaScript | mojs/mojs | src/shapes/rect.coffee | MIT | 0a9cf9a87dd5637e6fa770755e79048489bcf817 | 18,698 | https://github.com/mojs/mojs/blob/0a9cf9a87dd5637e6fa770755e79048489bcf817/src/shapes/rect.coffee | 1 | 31 |
mojs/mojs:src/shapes/rect.coffee:1:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
// ignore coffescript sudo code
var Bit, Rect;
Bit = require('./bit').default;
Rect = class Rect extends Bit {
// shape: 'rect'
// ratio: 1.43
_declareDefaults() {
super._declareDefaults();
this._defaults.tag = 'rect';
this._defaults.rx = 0;... | # ignore coffescript sudo code
Bit = require('./bit').default
class Rect extends Bit
# shape: 'rect'
# ratio: 1.43
_declareDefaults:->
super()
this._defaults.tag = 'rect'
this._defaults.rx = 0
this._defaults.ry = 0
# this._defaults.ratio = 1.43
_draw:->
super()
p = @_props
... | JavaScript | CoffeeScript | mojs/mojs | src/shapes/rect.coffee | MIT | 0a9cf9a87dd5637e6fa770755e79048489bcf817 | 18,698 | https://github.com/mojs/mojs/blob/0a9cf9a87dd5637e6fa770755e79048489bcf817/src/shapes/rect.coffee | 1 | 31 |
mojs/mojs:src/shapes/rect.coffee:1:completion | completion | # ignore coffescript sudo code
Bit = require('./bit').default
class Rect extends Bit
# shape: 'rect'
# ratio: 1.43
_declareDefaults:->
super()
this._defaults.tag = 'rect'
this._defaults.rx = 0
this._defaults.ry = 0
# this._defaults.ratio = 1.43
_draw:->
super() | p = @_props
radiusX = if p.radiusX? then p.radiusX else p.radius
radiusY = if p.radiusY? then p.radiusY else p.radius
@_setAttrIfChanged 'width', 2*radiusX
@_setAttrIfChanged 'height', 2*radiusY
@_setAttrIfChanged 'x', (p.width/2) - radiusX
@_setAttrIfChanged 'y', (p.height/2) - radiusY
@_se... | CoffeeScript | CoffeeScript | mojs/mojs | src/shapes/rect.coffee | MIT | 0a9cf9a87dd5637e6fa770755e79048489bcf817 | 18,698 | https://github.com/mojs/mojs/blob/0a9cf9a87dd5637e6fa770755e79048489bcf817/src/shapes/rect.coffee | 1 | 31 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.