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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
maxwells/bootstrap-tags:src/templates/3/tag.coffee:1:raw_corpus | raw_corpus | window.Tags ||= {}
Tags.Templates ||= {}
Tags.Templates["3"] ||= {}
Tags.Templates["3"].tag = (options = {}) ->
"<div class='tag label #{options.tagClass} #{options.tagSize}' #{ if options.isPopover then "rel='popover'" else "" }>
<span>#{Tags.Helpers.addPadding options.tag, 2, options.isReadOnly}</span>
#{ i... | CoffeeScript | maxwells/bootstrap-tags | src/templates/3/tag.coffee | MIT | 9fcc5f6c1cada03cbf284e4b78162fd47a882384 | 543 | https://github.com/maxwells/bootstrap-tags/blob/9fcc5f6c1cada03cbf284e4b78162fd47a882384/src/templates/3/tag.coffee | 1 | 8 | ||
maxwells/bootstrap-tags:src/templates/3/tag.coffee:1:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
window.Tags ||= {}
Tags.Templates ||= {}
Tags.Templates["3"] ||= {}
Tags.Templates["3"].tag = (options = {}) ->
"<div class='tag label #{options.tagClass} #{options.tagSize}' #{ if options.isPopover then "rel='popover'" else "" }>
<span>#{Tags.Helpers.addPa... | var base;
window.Tags || (window.Tags = {});
Tags.Templates || (Tags.Templates = {});
(base = Tags.Templates)["3"] || (base["3"] = {});
Tags.Templates["3"].tag = function(options = {}) {
return `<div class='tag label ${options.tagClass} ${options.tagSize}' ${options.isPopover ? "rel='popover'" : ""}> <span>${Tags... | CoffeeScript | JavaScript | maxwells/bootstrap-tags | src/templates/3/tag.coffee | MIT | 9fcc5f6c1cada03cbf284e4b78162fd47a882384 | 543 | https://github.com/maxwells/bootstrap-tags/blob/9fcc5f6c1cada03cbf284e4b78162fd47a882384/src/templates/3/tag.coffee | 1 | 8 |
maxwells/bootstrap-tags:src/templates/3/tag.coffee:1:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
var base;
window.Tags || (window.Tags = {});
Tags.Templates || (Tags.Templates = {});
(base = Tags.Templates)["3"] || (base["3"] = {});
Tags.Templates["3"].tag = function(options = {}) {
return `<div class='tag label ${options.tagClass} ${options.tagSize}' ${... | window.Tags ||= {}
Tags.Templates ||= {}
Tags.Templates["3"] ||= {}
Tags.Templates["3"].tag = (options = {}) ->
"<div class='tag label #{options.tagClass} #{options.tagSize}' #{ if options.isPopover then "rel='popover'" else "" }>
<span>#{Tags.Helpers.addPadding options.tag, 2, options.isReadOnly}</span>
#{ i... | JavaScript | CoffeeScript | maxwells/bootstrap-tags | src/templates/3/tag.coffee | MIT | 9fcc5f6c1cada03cbf284e4b78162fd47a882384 | 543 | https://github.com/maxwells/bootstrap-tags/blob/9fcc5f6c1cada03cbf284e4b78162fd47a882384/src/templates/3/tag.coffee | 1 | 8 |
maxwells/bootstrap-tags:src/templates/3/tag.coffee:1:completion | completion | window.Tags ||= {}
Tags.Templates ||= {}
Tags.Templates["3"] ||= {}
Tags.Templates["3"].tag = (options = {}) -> | "<div class='tag label #{options.tagClass} #{options.tagSize}' #{ if options.isPopover then "rel='popover'" else "" }>
<span>#{Tags.Helpers.addPadding options.tag, 2, options.isReadOnly}</span>
#{ if options.isReadOnly then "" else "<a><i class='remove glyphicon glyphicon-remove-sign glyphicon-white' /></a>" }
... | CoffeeScript | CoffeeScript | maxwells/bootstrap-tags | src/templates/3/tag.coffee | MIT | 9fcc5f6c1cada03cbf284e4b78162fd47a882384 | 543 | https://github.com/maxwells/bootstrap-tags/blob/9fcc5f6c1cada03cbf284e4b78162fd47a882384/src/templates/3/tag.coffee | 1 | 8 |
maxwells/bootstrap-tags:src/templates/3/tag.coffee:1:raw_corpus | raw_corpus | window.Tags ||= {}
Tags.Templates ||= {}
Tags.Templates["3"] ||= {}
Tags.Templates["3"].tag = (options = {}) ->
"<div class='tag label #{options.tagClass}' #{ if options.isPopover then "rel='popover'" else "" }>
<span>#{Tags.Helpers.addPadding options.tag, 2, options.isReadOnly}</span>
#{ if options.isReadOnl... | CoffeeScript | maxwells/bootstrap-tags | src/templates/3/tag.coffee | MIT | ae67152582b63e66639fd361323deebea170ad7a | 543 | https://github.com/maxwells/bootstrap-tags/blob/ae67152582b63e66639fd361323deebea170ad7a/src/templates/3/tag.coffee | 1 | 8 | ||
maxwells/bootstrap-tags:src/templates/3/tag.coffee:1:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
window.Tags ||= {}
Tags.Templates ||= {}
Tags.Templates["3"] ||= {}
Tags.Templates["3"].tag = (options = {}) ->
"<div class='tag label #{options.tagClass}' #{ if options.isPopover then "rel='popover'" else "" }>
<span>#{Tags.Helpers.addPadding options.tag, ... | var base;
window.Tags || (window.Tags = {});
Tags.Templates || (Tags.Templates = {});
(base = Tags.Templates)["3"] || (base["3"] = {});
Tags.Templates["3"].tag = function(options = {}) {
return `<div class='tag label ${options.tagClass}' ${options.isPopover ? "rel='popover'" : ""}> <span>${Tags.Helpers.addPadding... | CoffeeScript | JavaScript | maxwells/bootstrap-tags | src/templates/3/tag.coffee | MIT | ae67152582b63e66639fd361323deebea170ad7a | 543 | https://github.com/maxwells/bootstrap-tags/blob/ae67152582b63e66639fd361323deebea170ad7a/src/templates/3/tag.coffee | 1 | 8 |
maxwells/bootstrap-tags:src/templates/3/tag.coffee:1:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
var base;
window.Tags || (window.Tags = {});
Tags.Templates || (Tags.Templates = {});
(base = Tags.Templates)["3"] || (base["3"] = {});
Tags.Templates["3"].tag = function(options = {}) {
return `<div class='tag label ${options.tagClass}' ${options.isPopover ?... | window.Tags ||= {}
Tags.Templates ||= {}
Tags.Templates["3"] ||= {}
Tags.Templates["3"].tag = (options = {}) ->
"<div class='tag label #{options.tagClass}' #{ if options.isPopover then "rel='popover'" else "" }>
<span>#{Tags.Helpers.addPadding options.tag, 2, options.isReadOnly}</span>
#{ if options.isReadOnl... | JavaScript | CoffeeScript | maxwells/bootstrap-tags | src/templates/3/tag.coffee | MIT | ae67152582b63e66639fd361323deebea170ad7a | 543 | https://github.com/maxwells/bootstrap-tags/blob/ae67152582b63e66639fd361323deebea170ad7a/src/templates/3/tag.coffee | 1 | 8 |
maxwells/bootstrap-tags:src/templates/3/tag.coffee:1:completion | completion | window.Tags ||= {}
Tags.Templates ||= {}
Tags.Templates["3"] ||= {}
Tags.Templates["3"].tag = (options = {}) -> | "<div class='tag label #{options.tagClass}' #{ if options.isPopover then "rel='popover'" else "" }>
<span>#{Tags.Helpers.addPadding options.tag, 2, options.isReadOnly}</span>
#{ if options.isReadOnly then "" else "<a><i class='glyphicon glyphicon-remove-sign glyphicon-white' /></a>" }
</div>" | CoffeeScript | CoffeeScript | maxwells/bootstrap-tags | src/templates/3/tag.coffee | MIT | ae67152582b63e66639fd361323deebea170ad7a | 543 | https://github.com/maxwells/bootstrap-tags/blob/ae67152582b63e66639fd361323deebea170ad7a/src/templates/3/tag.coffee | 1 | 8 |
maxwells/bootstrap-tags:src/templates/3/tag.coffee:1:raw_corpus | raw_corpus | window.Tags ||= {}
Tags.Templates ||= {}
Tags.Templates["3"] ||= {}
Tags.Templates["3"].tag = (options = {}) ->
"<div class='tag label #{options.tagClass}' #{ if options.isPopover then "rel='popover'" else "" }>
<span>#{Tags.Helpers.addPadding options.tag, 2, options.isReadOnly}</span>
#{ if options.isReadOnl... | CoffeeScript | maxwells/bootstrap-tags | src/templates/3/tag.coffee | MIT | be46a8e0a6a718bca3465e19c3d2042909c2cd8d | 543 | https://github.com/maxwells/bootstrap-tags/blob/be46a8e0a6a718bca3465e19c3d2042909c2cd8d/src/templates/3/tag.coffee | 1 | 8 | ||
maxwells/bootstrap-tags:src/templates/3/tag.coffee:1:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
window.Tags ||= {}
Tags.Templates ||= {}
Tags.Templates["3"] ||= {}
Tags.Templates["3"].tag = (options = {}) ->
"<div class='tag label #{options.tagClass}' #{ if options.isPopover then "rel='popover'" else "" }>
<span>#{Tags.Helpers.addPadding options.tag, ... | var base;
window.Tags || (window.Tags = {});
Tags.Templates || (Tags.Templates = {});
(base = Tags.Templates)["3"] || (base["3"] = {});
Tags.Templates["3"].tag = function(options = {}) {
return `<div class='tag label ${options.tagClass}' ${options.isPopover ? "rel='popover'" : ""}> <span>${Tags.Helpers.addPadding... | CoffeeScript | JavaScript | maxwells/bootstrap-tags | src/templates/3/tag.coffee | MIT | be46a8e0a6a718bca3465e19c3d2042909c2cd8d | 543 | https://github.com/maxwells/bootstrap-tags/blob/be46a8e0a6a718bca3465e19c3d2042909c2cd8d/src/templates/3/tag.coffee | 1 | 8 |
maxwells/bootstrap-tags:src/templates/3/tag.coffee:1:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
var base;
window.Tags || (window.Tags = {});
Tags.Templates || (Tags.Templates = {});
(base = Tags.Templates)["3"] || (base["3"] = {});
Tags.Templates["3"].tag = function(options = {}) {
return `<div class='tag label ${options.tagClass}' ${options.isPopover ?... | window.Tags ||= {}
Tags.Templates ||= {}
Tags.Templates["3"] ||= {}
Tags.Templates["3"].tag = (options = {}) ->
"<div class='tag label #{options.tagClass}' #{ if options.isPopover then "rel='popover'" else "" }>
<span>#{Tags.Helpers.addPadding options.tag, 2, options.isReadOnly}</span>
#{ if options.isReadOnl... | JavaScript | CoffeeScript | maxwells/bootstrap-tags | src/templates/3/tag.coffee | MIT | be46a8e0a6a718bca3465e19c3d2042909c2cd8d | 543 | https://github.com/maxwells/bootstrap-tags/blob/be46a8e0a6a718bca3465e19c3d2042909c2cd8d/src/templates/3/tag.coffee | 1 | 8 |
maxwells/bootstrap-tags:src/templates/3/tag.coffee:1:completion | completion | window.Tags ||= {}
Tags.Templates ||= {}
Tags.Templates["3"] ||= {}
Tags.Templates["3"].tag = (options = {}) -> | "<div class='tag label #{options.tagClass}' #{ if options.isPopover then "rel='popover'" else "" }>
<span>#{Tags.Helpers.addPadding options.tag, 2, options.isReadOnly}</span>
#{ if options.isReadOnly then "" else "<a><i class='glyphicon glyphicon-remove-circle glyphicon-white' /></a>" }
</div>" | CoffeeScript | CoffeeScript | maxwells/bootstrap-tags | src/templates/3/tag.coffee | MIT | be46a8e0a6a718bca3465e19c3d2042909c2cd8d | 543 | https://github.com/maxwells/bootstrap-tags/blob/be46a8e0a6a718bca3465e19c3d2042909c2cd8d/src/templates/3/tag.coffee | 1 | 8 |
maxwells/bootstrap-tags:src/templates/3/tag.coffee:1:raw_corpus | raw_corpus | window.Tags ||= {}
Tags.Templates ||= {}
Tags.Templates["3"] ||= {}
Tags.Templates["3"].tag = (options = {}) ->
"<div class='tag label #{options.tagClass}' #{ if options.isPopover then "rel='popover'" else "" }>
<span>#{options.tag}</span>
#{ if options.isReadOnly then "" else "<a><i class='glyphicon glyphico... | CoffeeScript | maxwells/bootstrap-tags | src/templates/3/tag.coffee | MIT | 23509c0e8bcb2e9bf7a4e5558dfbca7fc5c353b1 | 543 | https://github.com/maxwells/bootstrap-tags/blob/23509c0e8bcb2e9bf7a4e5558dfbca7fc5c353b1/src/templates/3/tag.coffee | 1 | 8 | ||
maxwells/bootstrap-tags:src/templates/3/tag.coffee:1:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
window.Tags ||= {}
Tags.Templates ||= {}
Tags.Templates["3"] ||= {}
Tags.Templates["3"].tag = (options = {}) ->
"<div class='tag label #{options.tagClass}' #{ if options.isPopover then "rel='popover'" else "" }>
<span>#{options.tag}</span>
#{ if options... | var base;
window.Tags || (window.Tags = {});
Tags.Templates || (Tags.Templates = {});
(base = Tags.Templates)["3"] || (base["3"] = {});
Tags.Templates["3"].tag = function(options = {}) {
return `<div class='tag label ${options.tagClass}' ${options.isPopover ? "rel='popover'" : ""}> <span>${options.tag}</span> ${o... | CoffeeScript | JavaScript | maxwells/bootstrap-tags | src/templates/3/tag.coffee | MIT | 23509c0e8bcb2e9bf7a4e5558dfbca7fc5c353b1 | 543 | https://github.com/maxwells/bootstrap-tags/blob/23509c0e8bcb2e9bf7a4e5558dfbca7fc5c353b1/src/templates/3/tag.coffee | 1 | 8 |
maxwells/bootstrap-tags:src/templates/3/tag.coffee:1:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
var base;
window.Tags || (window.Tags = {});
Tags.Templates || (Tags.Templates = {});
(base = Tags.Templates)["3"] || (base["3"] = {});
Tags.Templates["3"].tag = function(options = {}) {
return `<div class='tag label ${options.tagClass}' ${options.isPopover ?... | window.Tags ||= {}
Tags.Templates ||= {}
Tags.Templates["3"] ||= {}
Tags.Templates["3"].tag = (options = {}) ->
"<div class='tag label #{options.tagClass}' #{ if options.isPopover then "rel='popover'" else "" }>
<span>#{options.tag}</span>
#{ if options.isReadOnly then "" else "<a><i class='glyphicon glyphico... | JavaScript | CoffeeScript | maxwells/bootstrap-tags | src/templates/3/tag.coffee | MIT | 23509c0e8bcb2e9bf7a4e5558dfbca7fc5c353b1 | 543 | https://github.com/maxwells/bootstrap-tags/blob/23509c0e8bcb2e9bf7a4e5558dfbca7fc5c353b1/src/templates/3/tag.coffee | 1 | 8 |
maxwells/bootstrap-tags:src/templates/3/tag.coffee:1:completion | completion | window.Tags ||= {}
Tags.Templates ||= {}
Tags.Templates["3"] ||= {}
Tags.Templates["3"].tag = (options = {}) -> | "<div class='tag label #{options.tagClass}' #{ if options.isPopover then "rel='popover'" else "" }>
<span>#{options.tag}</span>
#{ if options.isReadOnly then "" else "<a><i class='glyphicon glyphicon-remove-circle glyphicon-white' /></a>" }
</div>" | CoffeeScript | CoffeeScript | maxwells/bootstrap-tags | src/templates/3/tag.coffee | MIT | 23509c0e8bcb2e9bf7a4e5558dfbca7fc5c353b1 | 543 | https://github.com/maxwells/bootstrap-tags/blob/23509c0e8bcb2e9bf7a4e5558dfbca7fc5c353b1/src/templates/3/tag.coffee | 1 | 8 |
gterrono/houston:client/lib/shared.coffee:1:raw_corpus | raw_corpus | Houston._admin_user_exists = -> Houston._admins.find().count() > 0
Houston.becomeAdmin = ->
Houston._call 'make_admin', Meteor.userId(), ->
Houston._subscribe_to_collections() # resubscribe so you get them
Houston._go 'home'
location.reload()
Houston._subscribe_to_collections = ->
Houston._collections... | CoffeeScript | gterrono/houston | client/lib/shared.coffee | MIT | 581357048f3577f0487ed598e26eaf063c813183 | 802 | https://github.com/gterrono/houston/blob/581357048f3577f0487ed598e26eaf063c813183/client/lib/shared.coffee | 1 | 50 | ||
gterrono/houston:client/lib/shared.coffee:1:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
Houston._admin_user_exists = -> Houston._admins.find().count() > 0
Houston.becomeAdmin = ->
Houston._call 'make_admin', Meteor.userId(), ->
Houston._subscribe_to_collections() # resubscribe so you get them
Houston._go 'home'
location.reload()
Hous... | Houston._admin_user_exists = function() {
return Houston._admins.find().count() > 0;
};
Houston.becomeAdmin = function() {
return Houston._call('make_admin', Meteor.userId(), function() {
Houston._subscribe_to_collections(); // resubscribe so you get them
Houston._go('home');
return location.reload();
... | CoffeeScript | JavaScript | gterrono/houston | client/lib/shared.coffee | MIT | 581357048f3577f0487ed598e26eaf063c813183 | 802 | https://github.com/gterrono/houston/blob/581357048f3577f0487ed598e26eaf063c813183/client/lib/shared.coffee | 1 | 50 |
gterrono/houston:client/lib/shared.coffee:1:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
Houston._admin_user_exists = function() {
return Houston._admins.find().count() > 0;
};
Houston.becomeAdmin = function() {
return Houston._call('make_admin', Meteor.userId(), function() {
Houston._subscribe_to_collections(); // resubscribe so you get them
... | Houston._admin_user_exists = -> Houston._admins.find().count() > 0
Houston.becomeAdmin = ->
Houston._call 'make_admin', Meteor.userId(), ->
Houston._subscribe_to_collections() # resubscribe so you get them
Houston._go 'home'
location.reload()
Houston._subscribe_to_collections = ->
Houston._collections... | JavaScript | CoffeeScript | gterrono/houston | client/lib/shared.coffee | MIT | 581357048f3577f0487ed598e26eaf063c813183 | 802 | https://github.com/gterrono/houston/blob/581357048f3577f0487ed598e26eaf063c813183/client/lib/shared.coffee | 1 | 50 |
gterrono/houston:client/lib/shared.coffee:1:completion | completion | Houston._admin_user_exists = -> Houston._admins.find().count() > 0
Houston.becomeAdmin = ->
Houston._call 'make_admin', Meteor.userId(), ->
Houston._subscribe_to_collections() # resubscribe so you get them
Houston._go 'home'
location.reload()
Houston._subscribe_to_collections = ->
Houston._collections... | 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...)
H... | CoffeeScript | CoffeeScript | gterrono/houston | client/lib/shared.coffee | MIT | 581357048f3577f0487ed598e26eaf063c813183 | 802 | https://github.com/gterrono/houston/blob/581357048f3577f0487ed598e26eaf063c813183/client/lib/shared.coffee | 1 | 50 |
gterrono/houston:client/lib/shared.coffee:2:raw_corpus | raw_corpus | return ''
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 if typeof... | CoffeeScript | gterrono/houston | client/lib/shared.coffee | MIT | 581357048f3577f0487ed598e26eaf063c813183 | 802 | https://github.com/gterrono/houston/blob/581357048f3577f0487ed598e26eaf063c813183/client/lib/shared.coffee | 51 | 70 | ||
gterrono/houston:client/lib/shared.coffee:2:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
return ''
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_... | return '';
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 ... | CoffeeScript | JavaScript | gterrono/houston | client/lib/shared.coffee | MIT | 581357048f3577f0487ed598e26eaf063c813183 | 802 | https://github.com/gterrono/houston/blob/581357048f3577f0487ed598e26eaf063c813183/client/lib/shared.coffee | 51 | 70 |
gterrono/houston:client/lib/shared.coffee:2:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
return '';
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)... | return ''
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 if typeof... | JavaScript | CoffeeScript | gterrono/houston | client/lib/shared.coffee | MIT | 581357048f3577f0487ed598e26eaf063c813183 | 802 | https://github.com/gterrono/houston/blob/581357048f3577f0487ed598e26eaf063c813183/client/lib/shared.coffee | 51 | 70 |
gterrono/houston:client/lib/shared.coffee:2:completion | completion | return ''
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 if typeof... | val == 'true'
else
constructor(val)
Houston._get_type = (field, collection) ->
find_obj = {}
find_obj[field] =
$exists: true
sample_val = Houston._nested_field_lookup(collection.findOne(find_obj), field)
typeof sample_val | CoffeeScript | CoffeeScript | gterrono/houston | client/lib/shared.coffee | MIT | 581357048f3577f0487ed598e26eaf063c813183 | 802 | https://github.com/gterrono/houston/blob/581357048f3577f0487ed598e26eaf063c813183/client/lib/shared.coffee | 51 | 70 |
gterrono/houston:client/lib/shared.coffee:1:raw_corpus | raw_corpus | Houston._admin_user_exists = -> Houston._admins.find().count() > 0
Houston.becomeAdmin = ->
Houston._call 'make_admin', Meteor.userId(), ->
Houston._subscribe_to_collections() # resubscribe so you get them
Houston._go 'home'
Houston._subscribe_to_collections = ->
Houston._collections_sub.stop() if Houston... | CoffeeScript | gterrono/houston | client/lib/shared.coffee | MIT | cb55ba7cbb4cf58e2e03a7588a8639f75c21965a | 802 | https://github.com/gterrono/houston/blob/cb55ba7cbb4cf58e2e03a7588a8639f75c21965a/client/lib/shared.coffee | 1 | 50 | ||
gterrono/houston:client/lib/shared.coffee:1:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
Houston._admin_user_exists = -> Houston._admins.find().count() > 0
Houston.becomeAdmin = ->
Houston._call 'make_admin', Meteor.userId(), ->
Houston._subscribe_to_collections() # resubscribe so you get them
Houston._go 'home'
Houston._subscribe_to_coll... | Houston._admin_user_exists = function() {
return Houston._admins.find().count() > 0;
};
Houston.becomeAdmin = function() {
return Houston._call('make_admin', Meteor.userId(), function() {
Houston._subscribe_to_collections(); // resubscribe so you get them
return Houston._go('home');
});
};
Houston._subs... | CoffeeScript | JavaScript | gterrono/houston | client/lib/shared.coffee | MIT | cb55ba7cbb4cf58e2e03a7588a8639f75c21965a | 802 | https://github.com/gterrono/houston/blob/cb55ba7cbb4cf58e2e03a7588a8639f75c21965a/client/lib/shared.coffee | 1 | 50 |
gterrono/houston:client/lib/shared.coffee:1:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
Houston._admin_user_exists = function() {
return Houston._admins.find().count() > 0;
};
Houston.becomeAdmin = function() {
return Houston._call('make_admin', Meteor.userId(), function() {
Houston._subscribe_to_collections(); // resubscribe so you get them
... | Houston._admin_user_exists = -> Houston._admins.find().count() > 0
Houston.becomeAdmin = ->
Houston._call 'make_admin', Meteor.userId(), ->
Houston._subscribe_to_collections() # resubscribe so you get them
Houston._go 'home'
Houston._subscribe_to_collections = ->
Houston._collections_sub.stop() if Houston... | JavaScript | CoffeeScript | gterrono/houston | client/lib/shared.coffee | MIT | cb55ba7cbb4cf58e2e03a7588a8639f75c21965a | 802 | https://github.com/gterrono/houston/blob/cb55ba7cbb4cf58e2e03a7588a8639f75c21965a/client/lib/shared.coffee | 1 | 50 |
gterrono/houston:client/lib/shared.coffee:1:completion | completion | Houston._admin_user_exists = -> Houston._admins.find().count() > 0
Houston.becomeAdmin = ->
Houston._call 'make_admin', Meteor.userId(), ->
Houston._subscribe_to_collections() # resubscribe so you get them
Houston._go 'home'
Houston._subscribe_to_collections = ->
Houston._collections_sub.stop() if Houston... | 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/lib/shared.coffee | MIT | cb55ba7cbb4cf58e2e03a7588a8639f75c21965a | 802 | https://github.com/gterrono/houston/blob/cb55ba7cbb4cf58e2e03a7588a8639f75c21965a/client/lib/shared.coffee | 1 | 50 |
gterrono/houston:client/lib/shared.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 if typeof sample_val... | CoffeeScript | gterrono/houston | client/lib/shared.coffee | MIT | cb55ba7cbb4cf58e2e03a7588a8639f75c21965a | 802 | https://github.com/gterrono/houston/blob/cb55ba7cbb4cf58e2e03a7588a8639f75c21965a/client/lib/shared.coffee | 51 | 69 | ||
gterrono/houston:client/lib/shared.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/lib/shared.coffee | MIT | cb55ba7cbb4cf58e2e03a7588a8639f75c21965a | 802 | https://github.com/gterrono/houston/blob/cb55ba7cbb4cf58e2e03a7588a8639f75c21965a/client/lib/shared.coffee | 51 | 69 |
gterrono/houston:client/lib/shared.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 if typeof sample_val... | JavaScript | CoffeeScript | gterrono/houston | client/lib/shared.coffee | MIT | cb55ba7cbb4cf58e2e03a7588a8639f75c21965a | 802 | https://github.com/gterrono/houston/blob/cb55ba7cbb4cf58e2e03a7588a8639f75c21965a/client/lib/shared.coffee | 51 | 69 |
gterrono/houston:client/lib/shared.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 if typeof sample_val... | else
constructor(val)
Houston._get_type = (field, collection) ->
find_obj = {}
find_obj[field] =
$exists: true
sample_val = Houston._nested_field_lookup(collection.findOne(find_obj), field)
typeof sample_val | CoffeeScript | CoffeeScript | gterrono/houston | client/lib/shared.coffee | MIT | cb55ba7cbb4cf58e2e03a7588a8639f75c21965a | 802 | https://github.com/gterrono/houston/blob/cb55ba7cbb4cf58e2e03a7588a8639f75c21965a/client/lib/shared.coffee | 51 | 69 |
gterrono/houston:client/lib/shared.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/lib/shared.coffee | MIT | 19d41727920fef6b6c638726f07fb40b4c6a8403 | 802 | https://github.com/gterrono/houston/blob/19d41727920fef6b6c638726f07fb40b4c6a8403/client/lib/shared.coffee | 51 | 67 | ||
gterrono/houston:client/lib/shared.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/lib/shared.coffee | MIT | 19d41727920fef6b6c638726f07fb40b4c6a8403 | 802 | https://github.com/gterrono/houston/blob/19d41727920fef6b6c638726f07fb40b4c6a8403/client/lib/shared.coffee | 51 | 67 |
gterrono/houston:client/lib/shared.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/lib/shared.coffee | MIT | 19d41727920fef6b6c638726f07fb40b4c6a8403 | 802 | https://github.com/gterrono/houston/blob/19d41727920fef6b6c638726f07fb40b4c6a8403/client/lib/shared.coffee | 51 | 67 |
gterrono/houston:client/lib/shared.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)
Houston._get_type = (field, collection) ->
find_obj = {}
find_obj[field] =
$exists: true
sample_val = Houston._nested_field_lookup(collection.findOne(find_obj), field)
typeof sample_val | CoffeeScript | CoffeeScript | gterrono/houston | client/lib/shared.coffee | MIT | 19d41727920fef6b6c638726f07fb40b4c6a8403 | 802 | https://github.com/gterrono/houston/blob/19d41727920fef6b6c638726f07fb40b4c6a8403/client/lib/shared.coffee | 51 | 67 |
gterrono/houston:client/lib/shared.coffee:1:raw_corpus | raw_corpus | Houston._admin_user_exists = -> Houston._admins.find().count() > 0
Houston.becomeAdmin = ->
Houston._call 'make_admin', Meteor.userId(), ->
Houston._subscribe_to_collections() # resubscribe so you get them
Houston._go 'home'
Houston._subscribe_to_collections = ->
Houston._collections_sub.stop() if Houston... | CoffeeScript | gterrono/houston | client/lib/shared.coffee | MIT | 1ed8de1ee76e6974fc4a388cdaacc1dc6dbc4a85 | 802 | https://github.com/gterrono/houston/blob/1ed8de1ee76e6974fc4a388cdaacc1dc6dbc4a85/client/lib/shared.coffee | 1 | 50 | ||
gterrono/houston:client/lib/shared.coffee:1:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
Houston._admin_user_exists = -> Houston._admins.find().count() > 0
Houston.becomeAdmin = ->
Houston._call 'make_admin', Meteor.userId(), ->
Houston._subscribe_to_collections() # resubscribe so you get them
Houston._go 'home'
Houston._subscribe_to_coll... | Houston._admin_user_exists = function() {
return Houston._admins.find().count() > 0;
};
Houston.becomeAdmin = function() {
return Houston._call('make_admin', Meteor.userId(), function() {
Houston._subscribe_to_collections(); // resubscribe so you get them
return Houston._go('home');
});
};
Houston._subs... | CoffeeScript | JavaScript | gterrono/houston | client/lib/shared.coffee | MIT | 1ed8de1ee76e6974fc4a388cdaacc1dc6dbc4a85 | 802 | https://github.com/gterrono/houston/blob/1ed8de1ee76e6974fc4a388cdaacc1dc6dbc4a85/client/lib/shared.coffee | 1 | 50 |
gterrono/houston:client/lib/shared.coffee:1:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
Houston._admin_user_exists = function() {
return Houston._admins.find().count() > 0;
};
Houston.becomeAdmin = function() {
return Houston._call('make_admin', Meteor.userId(), function() {
Houston._subscribe_to_collections(); // resubscribe so you get them
... | Houston._admin_user_exists = -> Houston._admins.find().count() > 0
Houston.becomeAdmin = ->
Houston._call 'make_admin', Meteor.userId(), ->
Houston._subscribe_to_collections() # resubscribe so you get them
Houston._go 'home'
Houston._subscribe_to_collections = ->
Houston._collections_sub.stop() if Houston... | JavaScript | CoffeeScript | gterrono/houston | client/lib/shared.coffee | MIT | 1ed8de1ee76e6974fc4a388cdaacc1dc6dbc4a85 | 802 | https://github.com/gterrono/houston/blob/1ed8de1ee76e6974fc4a388cdaacc1dc6dbc4a85/client/lib/shared.coffee | 1 | 50 |
gterrono/houston:client/lib/shared.coffee:1:completion | completion | Houston._admin_user_exists = -> Houston._admins.find().count() > 0
Houston.becomeAdmin = ->
Houston._call 'make_admin', Meteor.userId(), ->
Houston._subscribe_to_collections() # resubscribe so you get them
Houston._go 'home'
Houston._subscribe_to_collections = ->
Houston._collections_sub.stop() if Houston... | 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/lib/shared.coffee | MIT | 1ed8de1ee76e6974fc4a388cdaacc1dc6dbc4a85 | 802 | https://github.com/gterrono/houston/blob/1ed8de1ee76e6974fc4a388cdaacc1dc6dbc4a85/client/lib/shared.coffee | 1 | 50 |
gterrono/houston:client/lib/shared.coffee:1:raw_corpus | raw_corpus | Houston._admin_user_exists = -> Houston._admins.find().count() > 0
Houston.becomeAdmin = ->
Houston._call 'make_admin', Meteor.userId(), ->
Houston._subscribe_to_collections() # resubscribe so you get them
Houston._go 'home'
Houston._subscribe_to_collections = ->
Houston._collections_sub.stop() if Houston... | CoffeeScript | gterrono/houston | client/lib/shared.coffee | MIT | 0f6d10fca18da1946add534ccc920ff74ab99d68 | 802 | https://github.com/gterrono/houston/blob/0f6d10fca18da1946add534ccc920ff74ab99d68/client/lib/shared.coffee | 1 | 50 | ||
gterrono/houston:client/lib/shared.coffee:1:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
Houston._admin_user_exists = -> Houston._admins.find().count() > 0
Houston.becomeAdmin = ->
Houston._call 'make_admin', Meteor.userId(), ->
Houston._subscribe_to_collections() # resubscribe so you get them
Houston._go 'home'
Houston._subscribe_to_coll... | Houston._admin_user_exists = function() {
return Houston._admins.find().count() > 0;
};
Houston.becomeAdmin = function() {
return Houston._call('make_admin', Meteor.userId(), function() {
Houston._subscribe_to_collections(); // resubscribe so you get them
return Houston._go('home');
});
};
Houston._subs... | CoffeeScript | JavaScript | gterrono/houston | client/lib/shared.coffee | MIT | 0f6d10fca18da1946add534ccc920ff74ab99d68 | 802 | https://github.com/gterrono/houston/blob/0f6d10fca18da1946add534ccc920ff74ab99d68/client/lib/shared.coffee | 1 | 50 |
gterrono/houston:client/lib/shared.coffee:1:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
Houston._admin_user_exists = function() {
return Houston._admins.find().count() > 0;
};
Houston.becomeAdmin = function() {
return Houston._call('make_admin', Meteor.userId(), function() {
Houston._subscribe_to_collections(); // resubscribe so you get them
... | Houston._admin_user_exists = -> Houston._admins.find().count() > 0
Houston.becomeAdmin = ->
Houston._call 'make_admin', Meteor.userId(), ->
Houston._subscribe_to_collections() # resubscribe so you get them
Houston._go 'home'
Houston._subscribe_to_collections = ->
Houston._collections_sub.stop() if Houston... | JavaScript | CoffeeScript | gterrono/houston | client/lib/shared.coffee | MIT | 0f6d10fca18da1946add534ccc920ff74ab99d68 | 802 | https://github.com/gterrono/houston/blob/0f6d10fca18da1946add534ccc920ff74ab99d68/client/lib/shared.coffee | 1 | 50 |
gterrono/houston:client/lib/shared.coffee:1:completion | completion | Houston._admin_user_exists = -> Houston._admins.find().count() > 0
Houston.becomeAdmin = ->
Houston._call 'make_admin', Meteor.userId(), ->
Houston._subscribe_to_collections() # resubscribe so you get them
Houston._go 'home'
Houston._subscribe_to_collections = ->
Houston._collections_sub.stop() if Houston... | catch e
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._LocalCollectionD... | CoffeeScript | CoffeeScript | gterrono/houston | client/lib/shared.coffee | MIT | 0f6d10fca18da1946add534ccc920ff74ab99d68 | 802 | https://github.com/gterrono/houston/blob/0f6d10fca18da1946add534ccc920ff74ab99d68/client/lib/shared.coffee | 1 | 50 |
gterrono/houston:client/lib/shared.coffee:2:raw_corpus | raw_corpus | result = object
for part in path.split(".")
result = result[part]
return '' unless result? # quit if you can't find anything here
# Return date objects and other non-object types
if typeof result isnt 'object' or result instanceof Date
return result
else
return ''
Houston._convert_to_correct... | CoffeeScript | gterrono/houston | client/lib/shared.coffee | MIT | 0f6d10fca18da1946add534ccc920ff74ab99d68 | 802 | https://github.com/gterrono/houston/blob/0f6d10fca18da1946add534ccc920ff74ab99d68/client/lib/shared.coffee | 51 | 78 | ||
gterrono/houston:client/lib/shared.coffee:2:completion | completion | result = object
for part in path.split(".")
result = result[part]
return '' unless result? # quit if you can't find anything here
# Return date objects and other non-object types
if typeof result isnt 'object' or result instanceof Date
return result
else
return ''
Houston._convert_to_correct... | 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)
Houston._get_type = (field, collection) ->
find_obj = {}
find_obj[field] =
... | CoffeeScript | CoffeeScript | gterrono/houston | client/lib/shared.coffee | MIT | 0f6d10fca18da1946add534ccc920ff74ab99d68 | 802 | https://github.com/gterrono/houston/blob/0f6d10fca18da1946add534ccc920ff74ab99d68/client/lib/shared.coffee | 51 | 78 |
gterrono/houston:client/lib/shared.coffee:1:raw_corpus | raw_corpus | Houston._admin_user_exists = -> Houston._admins.find().count() > 0
Handlebars.registerHelper 'currentUserIsAdmin', ->
Houston._user_is_admin(Meteor.userId())
Handlebars.registerHelper 'adminUserExists', Houston._admin_user_exists
Houston._collections ?= {}
# regardless of what version of meteor we are using,
# ge... | CoffeeScript | gterrono/houston | client/lib/shared.coffee | MIT | 43ce6b667f75b82395fe057541a34de414e4501f | 802 | https://github.com/gterrono/houston/blob/43ce6b667f75b82395fe057541a34de414e4501f/client/lib/shared.coffee | 1 | 50 | ||
gterrono/houston:client/lib/shared.coffee:1:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
Houston._admin_user_exists = -> Houston._admins.find().count() > 0
Handlebars.registerHelper 'currentUserIsAdmin', ->
Houston._user_is_admin(Meteor.userId())
Handlebars.registerHelper 'adminUserExists', Houston._admin_user_exists
Houston._collections ?= {}
... | Houston._admin_user_exists = function() {
return Houston._admins.find().count() > 0;
};
Handlebars.registerHelper('currentUserIsAdmin', function() {
return Houston._user_is_admin(Meteor.userId());
});
Handlebars.registerHelper('adminUserExists', Houston._admin_user_exists);
if (Houston._collections == null) {
... | CoffeeScript | JavaScript | gterrono/houston | client/lib/shared.coffee | MIT | 43ce6b667f75b82395fe057541a34de414e4501f | 802 | https://github.com/gterrono/houston/blob/43ce6b667f75b82395fe057541a34de414e4501f/client/lib/shared.coffee | 1 | 50 |
gterrono/houston:client/lib/shared.coffee:1:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
Houston._admin_user_exists = function() {
return Houston._admins.find().count() > 0;
};
Handlebars.registerHelper('currentUserIsAdmin', function() {
return Houston._user_is_admin(Meteor.userId());
});
Handlebars.registerHelper('adminUserExists', Houston._admi... | Houston._admin_user_exists = -> Houston._admins.find().count() > 0
Handlebars.registerHelper 'currentUserIsAdmin', ->
Houston._user_is_admin(Meteor.userId())
Handlebars.registerHelper 'adminUserExists', Houston._admin_user_exists
Houston._collections ?= {}
# regardless of what version of meteor we are using,
# ge... | JavaScript | CoffeeScript | gterrono/houston | client/lib/shared.coffee | MIT | 43ce6b667f75b82395fe057541a34de414e4501f | 802 | https://github.com/gterrono/houston/blob/43ce6b667f75b82395fe057541a34de414e4501f/client/lib/shared.coffee | 1 | 50 |
gterrono/houston:client/lib/shared.coffee:1:completion | completion | Houston._admin_user_exists = -> Houston._admins.find().count() > 0
Handlebars.registerHelper 'currentUserIsAdmin', ->
Houston._user_is_admin(Meteor.userId())
Handlebars.registerHelper 'adminUserExists', Houston._admin_user_exists
Houston._collections ?= {}
# regardless of what version of meteor we are using,
# ge... | 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/lib/shared.coffee | MIT | 43ce6b667f75b82395fe057541a34de414e4501f | 802 | https://github.com/gterrono/houston/blob/43ce6b667f75b82395fe057541a34de414e4501f/client/lib/shared.coffee | 1 | 50 |
gterrono/houston:client/lib/shared.coffee:2:raw_corpus | raw_corpus | else
return ''
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
... | CoffeeScript | gterrono/houston | client/lib/shared.coffee | MIT | 43ce6b667f75b82395fe057541a34de414e4501f | 802 | https://github.com/gterrono/houston/blob/43ce6b667f75b82395fe057541a34de414e4501f/client/lib/shared.coffee | 51 | 69 | ||
gterrono/houston:client/lib/shared.coffee:2:completion | completion | else
return ''
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)
Houston._get_type = (field, collection) ->
find_obj = {}
find_obj[field] =
$exists: true
sample_val = Houston._nested_field_lookup(collection.findOne(find_obj), field)
typeof sample_val | CoffeeScript | CoffeeScript | gterrono/houston | client/lib/shared.coffee | MIT | 43ce6b667f75b82395fe057541a34de414e4501f | 802 | https://github.com/gterrono/houston/blob/43ce6b667f75b82395fe057541a34de414e4501f/client/lib/shared.coffee | 51 | 69 |
octoblu/meshblu:test/lib/MeshbluEventEmitter-spec.coffee:1:raw_corpus | raw_corpus | _ = require 'lodash'
MeshbluEventEmitter = require '../../lib/MeshbluEventEmitter'
describe 'MeshbluEventEmitter', ->
beforeEach ->
@sendMessage = sinon.spy()
describe '->emit', ->
describe 'when it has two uuids', ->
beforeEach ->
uuids = ['some-uuid','some-other-uuid']
@Date = sino... | CoffeeScript | octoblu/meshblu | test/lib/MeshbluEventEmitter-spec.coffee | MIT | b378524f50aa14c2f3b98a30dfa7da27aa9f11a2 | 815 | https://github.com/octoblu/meshblu/blob/b378524f50aa14c2f3b98a30dfa7da27aa9f11a2/test/lib/MeshbluEventEmitter-spec.coffee | 1 | 24 | ||
octoblu/meshblu:test/lib/MeshbluEventEmitter-spec.coffee:1:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
_ = require 'lodash'
MeshbluEventEmitter = require '../../lib/MeshbluEventEmitter'
describe 'MeshbluEventEmitter', ->
beforeEach ->
@sendMessage = sinon.spy()
describe '->emit', ->
describe 'when it has two uuids', ->
beforeEach ->
uui... | var MeshbluEventEmitter, _;
_ = require('lodash');
MeshbluEventEmitter = require('../../lib/MeshbluEventEmitter');
describe('MeshbluEventEmitter', function() {
beforeEach(function() {
return this.sendMessage = sinon.spy();
});
return describe('->emit', function() {
return describe('when it has two uuid... | CoffeeScript | JavaScript | octoblu/meshblu | test/lib/MeshbluEventEmitter-spec.coffee | MIT | b378524f50aa14c2f3b98a30dfa7da27aa9f11a2 | 815 | https://github.com/octoblu/meshblu/blob/b378524f50aa14c2f3b98a30dfa7da27aa9f11a2/test/lib/MeshbluEventEmitter-spec.coffee | 1 | 24 |
octoblu/meshblu:test/lib/MeshbluEventEmitter-spec.coffee:1:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
var MeshbluEventEmitter, _;
_ = require('lodash');
MeshbluEventEmitter = require('../../lib/MeshbluEventEmitter');
describe('MeshbluEventEmitter', function() {
beforeEach(function() {
return this.sendMessage = sinon.spy();
});
return describe('->emit',... | _ = require 'lodash'
MeshbluEventEmitter = require '../../lib/MeshbluEventEmitter'
describe 'MeshbluEventEmitter', ->
beforeEach ->
@sendMessage = sinon.spy()
describe '->emit', ->
describe 'when it has two uuids', ->
beforeEach ->
uuids = ['some-uuid','some-other-uuid']
@Date = sino... | JavaScript | CoffeeScript | octoblu/meshblu | test/lib/MeshbluEventEmitter-spec.coffee | MIT | b378524f50aa14c2f3b98a30dfa7da27aa9f11a2 | 815 | https://github.com/octoblu/meshblu/blob/b378524f50aa14c2f3b98a30dfa7da27aa9f11a2/test/lib/MeshbluEventEmitter-spec.coffee | 1 | 24 |
octoblu/meshblu:test/lib/MeshbluEventEmitter-spec.coffee:1:completion | completion | _ = require 'lodash'
MeshbluEventEmitter = require '../../lib/MeshbluEventEmitter'
describe 'MeshbluEventEmitter', ->
beforeEach ->
@sendMessage = sinon.spy()
describe '->emit', ->
describe 'when it has two uuids', ->
beforeEach ->
uuids = ['some-uuid','some-other-uuid']
@Date = sino... | @sut = new MeshbluEventEmitter 'meshblu-uuid', uuids, @sendMessage, Date: @Date
describe 'when called with an eventType and payload', ->
beforeEach ->
@sut.emit 'update', {'$set': {foo: 'bar'}}
it 'should call sendMessage with a message', ->
expect(@sendMessage).to.have.been.... | CoffeeScript | CoffeeScript | octoblu/meshblu | test/lib/MeshbluEventEmitter-spec.coffee | MIT | b378524f50aa14c2f3b98a30dfa7da27aa9f11a2 | 815 | https://github.com/octoblu/meshblu/blob/b378524f50aa14c2f3b98a30dfa7da27aa9f11a2/test/lib/MeshbluEventEmitter-spec.coffee | 1 | 24 |
octoblu/meshblu:test/lib/MeshbluEventEmitter-spec.coffee:1:raw_corpus | raw_corpus | _ = require 'lodash'
MeshbluEventEmitter = require '../../lib/MeshbluEventEmitter'
describe 'MeshbluEventEmitter', ->
beforeEach ->
@sendMessage = sinon.spy()
describe '->emit', ->
describe 'when it has two uuids', ->
beforeEach ->
uuids = ['some-uuid','some-other-uuid']
@Date = now:... | CoffeeScript | octoblu/meshblu | test/lib/MeshbluEventEmitter-spec.coffee | MIT | 3754117cb39a22bbfd909d7ba5aba71a2f26ccf0 | 815 | https://github.com/octoblu/meshblu/blob/3754117cb39a22bbfd909d7ba5aba71a2f26ccf0/test/lib/MeshbluEventEmitter-spec.coffee | 1 | 24 | ||
octoblu/meshblu:test/lib/MeshbluEventEmitter-spec.coffee:1:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
_ = require 'lodash'
MeshbluEventEmitter = require '../../lib/MeshbluEventEmitter'
describe 'MeshbluEventEmitter', ->
beforeEach ->
@sendMessage = sinon.spy()
describe '->emit', ->
describe 'when it has two uuids', ->
beforeEach ->
uui... | var MeshbluEventEmitter, _;
_ = require('lodash');
MeshbluEventEmitter = require('../../lib/MeshbluEventEmitter');
describe('MeshbluEventEmitter', function() {
beforeEach(function() {
return this.sendMessage = sinon.spy();
});
return describe('->emit', function() {
return describe('when it has two uuid... | CoffeeScript | JavaScript | octoblu/meshblu | test/lib/MeshbluEventEmitter-spec.coffee | MIT | 3754117cb39a22bbfd909d7ba5aba71a2f26ccf0 | 815 | https://github.com/octoblu/meshblu/blob/3754117cb39a22bbfd909d7ba5aba71a2f26ccf0/test/lib/MeshbluEventEmitter-spec.coffee | 1 | 24 |
octoblu/meshblu:test/lib/MeshbluEventEmitter-spec.coffee:1:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
var MeshbluEventEmitter, _;
_ = require('lodash');
MeshbluEventEmitter = require('../../lib/MeshbluEventEmitter');
describe('MeshbluEventEmitter', function() {
beforeEach(function() {
return this.sendMessage = sinon.spy();
});
return describe('->emit',... | _ = require 'lodash'
MeshbluEventEmitter = require '../../lib/MeshbluEventEmitter'
describe 'MeshbluEventEmitter', ->
beforeEach ->
@sendMessage = sinon.spy()
describe '->emit', ->
describe 'when it has two uuids', ->
beforeEach ->
uuids = ['some-uuid','some-other-uuid']
@Date = now:... | JavaScript | CoffeeScript | octoblu/meshblu | test/lib/MeshbluEventEmitter-spec.coffee | MIT | 3754117cb39a22bbfd909d7ba5aba71a2f26ccf0 | 815 | https://github.com/octoblu/meshblu/blob/3754117cb39a22bbfd909d7ba5aba71a2f26ccf0/test/lib/MeshbluEventEmitter-spec.coffee | 1 | 24 |
octoblu/meshblu:test/lib/MeshbluEventEmitter-spec.coffee:1:completion | completion | _ = require 'lodash'
MeshbluEventEmitter = require '../../lib/MeshbluEventEmitter'
describe 'MeshbluEventEmitter', ->
beforeEach ->
@sendMessage = sinon.spy()
describe '->emit', ->
describe 'when it has two uuids', ->
beforeEach ->
uuids = ['some-uuid','some-other-uuid']
@Date = now:... | @sut = new MeshbluEventEmitter 'meshblu-uuid', uuids, @sendMessage, Date: @Date
describe 'when called with an eventType and payload', ->
beforeEach ->
@sut.emit 'update', {'$set': {foo: 'bar'}}
it 'should call sendMessage with a message', ->
expect(@sendMessage).to.have.been.... | CoffeeScript | CoffeeScript | octoblu/meshblu | test/lib/MeshbluEventEmitter-spec.coffee | MIT | 3754117cb39a22bbfd909d7ba5aba71a2f26ccf0 | 815 | https://github.com/octoblu/meshblu/blob/3754117cb39a22bbfd909d7ba5aba71a2f26ccf0/test/lib/MeshbluEventEmitter-spec.coffee | 1 | 24 |
octoblu/meshblu:test/lib/MeshbluEventEmitter-spec.coffee:1:raw_corpus | raw_corpus | MeshbluEventEmitter = require '../../lib/MeshbluEventEmitter'
describe 'MeshbluEventEmitter', ->
beforeEach ->
@sendMessage = sinon.spy()
describe '->emit', ->
describe 'when it has two uuids', ->
beforeEach ->
uuids = ['some-uuid','some-other-uuid']
@sut = new MeshbluEventEmitter 'm... | CoffeeScript | octoblu/meshblu | test/lib/MeshbluEventEmitter-spec.coffee | MIT | fa4bf1f60609663a92befac2cb9d4061a9fbbd64 | 815 | https://github.com/octoblu/meshblu/blob/fa4bf1f60609663a92befac2cb9d4061a9fbbd64/test/lib/MeshbluEventEmitter-spec.coffee | 1 | 22 | ||
octoblu/meshblu:test/lib/MeshbluEventEmitter-spec.coffee:1:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
MeshbluEventEmitter = require '../../lib/MeshbluEventEmitter'
describe 'MeshbluEventEmitter', ->
beforeEach ->
@sendMessage = sinon.spy()
describe '->emit', ->
describe 'when it has two uuids', ->
beforeEach ->
uuids = ['some-uuid','so... | var MeshbluEventEmitter;
MeshbluEventEmitter = require('../../lib/MeshbluEventEmitter');
describe('MeshbluEventEmitter', function() {
beforeEach(function() {
return this.sendMessage = sinon.spy();
});
return describe('->emit', function() {
return describe('when it has two uuids', function() {
befo... | CoffeeScript | JavaScript | octoblu/meshblu | test/lib/MeshbluEventEmitter-spec.coffee | MIT | fa4bf1f60609663a92befac2cb9d4061a9fbbd64 | 815 | https://github.com/octoblu/meshblu/blob/fa4bf1f60609663a92befac2cb9d4061a9fbbd64/test/lib/MeshbluEventEmitter-spec.coffee | 1 | 22 |
octoblu/meshblu:test/lib/MeshbluEventEmitter-spec.coffee:1:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
var MeshbluEventEmitter;
MeshbluEventEmitter = require('../../lib/MeshbluEventEmitter');
describe('MeshbluEventEmitter', function() {
beforeEach(function() {
return this.sendMessage = sinon.spy();
});
return describe('->emit', function() {
return de... | MeshbluEventEmitter = require '../../lib/MeshbluEventEmitter'
describe 'MeshbluEventEmitter', ->
beforeEach ->
@sendMessage = sinon.spy()
describe '->emit', ->
describe 'when it has two uuids', ->
beforeEach ->
uuids = ['some-uuid','some-other-uuid']
@sut = new MeshbluEventEmitter 'm... | JavaScript | CoffeeScript | octoblu/meshblu | test/lib/MeshbluEventEmitter-spec.coffee | MIT | fa4bf1f60609663a92befac2cb9d4061a9fbbd64 | 815 | https://github.com/octoblu/meshblu/blob/fa4bf1f60609663a92befac2cb9d4061a9fbbd64/test/lib/MeshbluEventEmitter-spec.coffee | 1 | 22 |
octoblu/meshblu:test/lib/MeshbluEventEmitter-spec.coffee:1:completion | completion | MeshbluEventEmitter = require '../../lib/MeshbluEventEmitter'
describe 'MeshbluEventEmitter', ->
beforeEach ->
@sendMessage = sinon.spy()
describe '->emit', ->
describe 'when it has two uuids', ->
beforeEach ->
uuids = ['some-uuid','some-other-uuid']
@sut = new MeshbluEventEmitter 'm... | describe 'when called with an eventType and payload', ->
beforeEach ->
@sut.emit 'update', {'$set': {foo: 'bar'}}
it 'should call sendMessage with a message', ->
expect(@sendMessage).to.have.been.calledWith(uuid: 'meshblu-uuid', {
devices: ['some-uuid','some-other-uuid']... | CoffeeScript | CoffeeScript | octoblu/meshblu | test/lib/MeshbluEventEmitter-spec.coffee | MIT | fa4bf1f60609663a92befac2cb9d4061a9fbbd64 | 815 | https://github.com/octoblu/meshblu/blob/fa4bf1f60609663a92befac2cb9d4061a9fbbd64/test/lib/MeshbluEventEmitter-spec.coffee | 1 | 22 |
octoblu/meshblu:test/lib/MeshbluEventEmitter-spec.coffee:1:raw_corpus | raw_corpus | MeshbluEventEmitter = require '../../lib/MeshbluEventEmitter'
describe 'MeshbluEventEmitter', ->
beforeEach ->
@sendMessage = sinon.spy()
describe '->emit', ->
describe 'when it has two uuids', ->
beforeEach ->
uuids = ['some-uuid','some-other-uuid']
@sut = new MeshbluEventEmitter 'm... | CoffeeScript | octoblu/meshblu | test/lib/MeshbluEventEmitter-spec.coffee | MIT | 18bc12630115922725aaab0b6000a445fa234791 | 815 | https://github.com/octoblu/meshblu/blob/18bc12630115922725aaab0b6000a445fa234791/test/lib/MeshbluEventEmitter-spec.coffee | 1 | 22 | ||
octoblu/meshblu:test/lib/MeshbluEventEmitter-spec.coffee:1:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
MeshbluEventEmitter = require '../../lib/MeshbluEventEmitter'
describe 'MeshbluEventEmitter', ->
beforeEach ->
@sendMessage = sinon.spy()
describe '->emit', ->
describe 'when it has two uuids', ->
beforeEach ->
uuids = ['some-uuid','so... | var MeshbluEventEmitter;
MeshbluEventEmitter = require('../../lib/MeshbluEventEmitter');
describe('MeshbluEventEmitter', function() {
beforeEach(function() {
return this.sendMessage = sinon.spy();
});
return describe('->emit', function() {
return describe('when it has two uuids', function() {
befo... | CoffeeScript | JavaScript | octoblu/meshblu | test/lib/MeshbluEventEmitter-spec.coffee | MIT | 18bc12630115922725aaab0b6000a445fa234791 | 815 | https://github.com/octoblu/meshblu/blob/18bc12630115922725aaab0b6000a445fa234791/test/lib/MeshbluEventEmitter-spec.coffee | 1 | 22 |
octoblu/meshblu:test/lib/MeshbluEventEmitter-spec.coffee:1:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
var MeshbluEventEmitter;
MeshbluEventEmitter = require('../../lib/MeshbluEventEmitter');
describe('MeshbluEventEmitter', function() {
beforeEach(function() {
return this.sendMessage = sinon.spy();
});
return describe('->emit', function() {
return de... | MeshbluEventEmitter = require '../../lib/MeshbluEventEmitter'
describe 'MeshbluEventEmitter', ->
beforeEach ->
@sendMessage = sinon.spy()
describe '->emit', ->
describe 'when it has two uuids', ->
beforeEach ->
uuids = ['some-uuid','some-other-uuid']
@sut = new MeshbluEventEmitter 'm... | JavaScript | CoffeeScript | octoblu/meshblu | test/lib/MeshbluEventEmitter-spec.coffee | MIT | 18bc12630115922725aaab0b6000a445fa234791 | 815 | https://github.com/octoblu/meshblu/blob/18bc12630115922725aaab0b6000a445fa234791/test/lib/MeshbluEventEmitter-spec.coffee | 1 | 22 |
octoblu/meshblu:test/lib/MeshbluEventEmitter-spec.coffee:1:completion | completion | MeshbluEventEmitter = require '../../lib/MeshbluEventEmitter'
describe 'MeshbluEventEmitter', ->
beforeEach ->
@sendMessage = sinon.spy()
describe '->emit', ->
describe 'when it has two uuids', ->
beforeEach ->
uuids = ['some-uuid','some-other-uuid']
@sut = new MeshbluEventEmitter 'm... | describe 'when called with an eventType and payload', ->
beforeEach ->
@sut.emit 'update', {'$set': {foo: 'bar'}}
it 'should call sendMessage with a message', ->
expect(@sendMessage).to.have.been.calledWith('meshblu-uuid', {
devices: ['some-uuid','some-other-uuid']
... | CoffeeScript | CoffeeScript | octoblu/meshblu | test/lib/MeshbluEventEmitter-spec.coffee | MIT | 18bc12630115922725aaab0b6000a445fa234791 | 815 | https://github.com/octoblu/meshblu/blob/18bc12630115922725aaab0b6000a445fa234791/test/lib/MeshbluEventEmitter-spec.coffee | 1 | 22 |
jianliaoim/talk-os:talk-api2x/migrations/1422584968996-import-invite-code.coffee:1:raw_corpus | raw_corpus | {limbo, redis} = require '../lib/components'
util = require '../lib/util'
Promise = require 'bluebird'
{TeamModel} = limbo.use 'talk'
exports.up = (next) ->
redis.keysAsync 'team:*:invitecode'
.then (keys) ->
inviteCodeHash = {}
redis.mgetAsync keys
.then (inviteCodes) ->
for i, key of keys
... | CoffeeScript | jianliaoim/talk-os | talk-api2x/migrations/1422584968996-import-invite-code.coffee | MIT | 2545c4497865779a55762e03963a39237df9046b | 2,703 | https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-api2x/migrations/1422584968996-import-invite-code.coffee | 1 | 42 | ||
jianliaoim/talk-os:talk-api2x/migrations/1422584968996-import-invite-code.coffee:1:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
{limbo, redis} = require '../lib/components'
util = require '../lib/util'
Promise = require 'bluebird'
{TeamModel} = limbo.use 'talk'
exports.up = (next) ->
redis.keysAsync 'team:*:invitecode'
.then (keys) ->
inviteCodeHash = {}
redis.mgetAsync k... | var Promise, TeamModel, limbo, redis, util;
({limbo, redis} = require('../lib/components'));
util = require('../lib/util');
Promise = require('bluebird');
({TeamModel} = limbo.use('talk'));
exports.up = function(next) {
return redis.keysAsync('team:*:invitecode').then(function(keys) {
var inviteCodeHash;
... | CoffeeScript | JavaScript | jianliaoim/talk-os | talk-api2x/migrations/1422584968996-import-invite-code.coffee | MIT | 2545c4497865779a55762e03963a39237df9046b | 2,703 | https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-api2x/migrations/1422584968996-import-invite-code.coffee | 1 | 42 |
jianliaoim/talk-os:talk-api2x/migrations/1422584968996-import-invite-code.coffee:1:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
var Promise, TeamModel, limbo, redis, util;
({limbo, redis} = require('../lib/components'));
util = require('../lib/util');
Promise = require('bluebird');
({TeamModel} = limbo.use('talk'));
exports.up = function(next) {
return redis.keysAsync('team:*:invitec... | {limbo, redis} = require '../lib/components'
util = require '../lib/util'
Promise = require 'bluebird'
{TeamModel} = limbo.use 'talk'
exports.up = (next) ->
redis.keysAsync 'team:*:invitecode'
.then (keys) ->
inviteCodeHash = {}
redis.mgetAsync keys
.then (inviteCodes) ->
for i, key of keys
... | JavaScript | CoffeeScript | jianliaoim/talk-os | talk-api2x/migrations/1422584968996-import-invite-code.coffee | MIT | 2545c4497865779a55762e03963a39237df9046b | 2,703 | https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-api2x/migrations/1422584968996-import-invite-code.coffee | 1 | 42 |
jianliaoim/talk-os:talk-api2x/migrations/1422584968996-import-invite-code.coffee:1:completion | completion | {limbo, redis} = require '../lib/components'
util = require '../lib/util'
Promise = require 'bluebird'
{TeamModel} = limbo.use 'talk'
exports.up = (next) ->
redis.keysAsync 'team:*:invitecode'
.then (keys) ->
inviteCodeHash = {}
redis.mgetAsync keys
.then (inviteCodes) ->
for i, key of keys
... | .then (inviteCodeHash) ->
TeamModel.findAsync {}
.map (team) ->
inviteCode = inviteCodeHash["#{team._id}"]
if inviteCode and team.inviteCode isnt inviteCode
team.inviteCode = inviteCode
else
team.inviteCode = util.genInviteCode()
Promise.promisify team.save
.appl... | CoffeeScript | CoffeeScript | jianliaoim/talk-os | talk-api2x/migrations/1422584968996-import-invite-code.coffee | MIT | 2545c4497865779a55762e03963a39237df9046b | 2,703 | https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-api2x/migrations/1422584968996-import-invite-code.coffee | 1 | 42 |
twilson63/express-coffee:lib/coffee/lib/coffee-script/test/test_exceptions.coffee:1:raw_corpus | raw_corpus | # Basic exception throwing.
block: -> (throw 'up')
throws block, 'up'
# Basic try/catch.
result: try
10
finally
15
ok result is 10
result: try
throw 'up'
catch err
err.length
ok result is 2 | CoffeeScript | twilson63/express-coffee | lib/coffee/lib/coffee-script/test/test_exceptions.coffee | MIT | 971837f7d7a5e96cf5a5fdb52e52748060ed2c68 | 622 | https://github.com/twilson63/express-coffee/blob/971837f7d7a5e96cf5a5fdb52e52748060ed2c68/lib/coffee/lib/coffee-script/test/test_exceptions.coffee | 1 | 19 | ||
twilson63/express-coffee:lib/coffee/lib/coffee-script/test/test_exceptions.coffee:1:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
# Basic exception throwing.
block: -> (throw 'up')
throws block, 'up'
# Basic try/catch.
result: try
10
finally
15
ok result is 10
result: try
throw 'up'
catch err
err.length
ok result is 2
``` | // Basic exception throwing.
var err;
({
block: function() {
throw 'up';
}
});
throws(block, 'up');
({
// Basic try/catch.
result: (function() {
try {
return 10;
} finally {
15;
}
})()
});
ok(result === 10);
({
result: (function() {
try {
throw 'up';
} catch (e... | CoffeeScript | JavaScript | twilson63/express-coffee | lib/coffee/lib/coffee-script/test/test_exceptions.coffee | MIT | 971837f7d7a5e96cf5a5fdb52e52748060ed2c68 | 622 | https://github.com/twilson63/express-coffee/blob/971837f7d7a5e96cf5a5fdb52e52748060ed2c68/lib/coffee/lib/coffee-script/test/test_exceptions.coffee | 1 | 19 |
twilson63/express-coffee:lib/coffee/lib/coffee-script/test/test_exceptions.coffee:1:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
// Basic exception throwing.
var err;
({
block: function() {
throw 'up';
}
});
throws(block, 'up');
({
// Basic try/catch.
result: (function() {
try {
return 10;
} finally {
15;
}
})()
});
ok(result === 10);
({
result: (... | # Basic exception throwing.
block: -> (throw 'up')
throws block, 'up'
# Basic try/catch.
result: try
10
finally
15
ok result is 10
result: try
throw 'up'
catch err
err.length
ok result is 2 | JavaScript | CoffeeScript | twilson63/express-coffee | lib/coffee/lib/coffee-script/test/test_exceptions.coffee | MIT | 971837f7d7a5e96cf5a5fdb52e52748060ed2c68 | 622 | https://github.com/twilson63/express-coffee/blob/971837f7d7a5e96cf5a5fdb52e52748060ed2c68/lib/coffee/lib/coffee-script/test/test_exceptions.coffee | 1 | 19 |
twilson63/express-coffee:lib/coffee/lib/coffee-script/test/test_exceptions.coffee:1:completion | completion | # Basic exception throwing.
block: -> (throw 'up')
throws block, 'up'
# Basic try/catch.
result: try
10
finally | 15
ok result is 10
result: try
throw 'up'
catch err
err.length
ok result is 2 | CoffeeScript | CoffeeScript | twilson63/express-coffee | lib/coffee/lib/coffee-script/test/test_exceptions.coffee | MIT | 971837f7d7a5e96cf5a5fdb52e52748060ed2c68 | 622 | https://github.com/twilson63/express-coffee/blob/971837f7d7a5e96cf5a5fdb52e52748060ed2c68/lib/coffee/lib/coffee-script/test/test_exceptions.coffee | 1 | 19 |
jianliaoim/talk-os:talk-api2x/test/main.coffee:1:raw_corpus | raw_corpus | async = require 'async'
app = require './app'
# Start fake servers
require './servers'
######################## Intialize ########################
app.fakeServer()
######################## Units ########################
require './util/util.coffee'
######################## Units ########################
require './... | CoffeeScript | jianliaoim/talk-os | talk-api2x/test/main.coffee | MIT | 2545c4497865779a55762e03963a39237df9046b | 2,703 | https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-api2x/test/main.coffee | 1 | 50 | ||
jianliaoim/talk-os:talk-api2x/test/main.coffee:1:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
async = require 'async'
app = require './app'
# Start fake servers
require './servers'
######################## Intialize ########################
app.fakeServer()
######################## Units ########################
require './util/util.coffee'
##########... | var app, async;
async = require('async');
app = require('./app');
// Start fake servers
require('./servers');
//####################### Intialize ########################
app.fakeServer();
//####################### Units ########################
require('./util/util.coffee');
//####################### Units #####... | CoffeeScript | JavaScript | jianliaoim/talk-os | talk-api2x/test/main.coffee | MIT | 2545c4497865779a55762e03963a39237df9046b | 2,703 | https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-api2x/test/main.coffee | 1 | 50 |
jianliaoim/talk-os:talk-api2x/test/main.coffee:1:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
var app, async;
async = require('async');
app = require('./app');
// Start fake servers
require('./servers');
//####################### Intialize ########################
app.fakeServer();
//####################### Units ########################
require('./uti... | async = require 'async'
app = require './app'
# Start fake servers
require './servers'
######################## Intialize ########################
app.fakeServer()
######################## Units ########################
require './util/util.coffee'
######################## Units ########################
require './... | JavaScript | CoffeeScript | jianliaoim/talk-os | talk-api2x/test/main.coffee | MIT | 2545c4497865779a55762e03963a39237df9046b | 2,703 | https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-api2x/test/main.coffee | 1 | 50 |
jianliaoim/talk-os:talk-api2x/test/main.coffee:1:completion | completion | async = require 'async'
app = require './app'
# Start fake servers
require './servers'
######################## Intialize ########################
app.fakeServer()
######################## Units ########################
require './util/util.coffee'
######################## Units ########################
require './... | require './controllers/integration.coffee'
require './controllers/devicetoken.coffee'
require './controllers/tag.coffee'
require './controllers/story.coffee'
require './controllers/notification.coffee'
require './controllers/discover.coffee'
require './controllers/invitation.coffee'
require './controllers/group.coffee'... | CoffeeScript | CoffeeScript | jianliaoim/talk-os | talk-api2x/test/main.coffee | MIT | 2545c4497865779a55762e03963a39237df9046b | 2,703 | https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-api2x/test/main.coffee | 1 | 50 |
linemanjs/lineman:archetype/spec/hello-spec.coffee:1:raw_corpus | raw_corpus | describe ".helloText", ->
When -> @result = helloText()
Then -> expect(@result).toEqual("Hello, World!") | CoffeeScript | linemanjs/lineman | archetype/spec/hello-spec.coffee | MIT | da7b69982e44220bdd107798d86abc78749dc125 | 1,168 | https://github.com/linemanjs/lineman/blob/da7b69982e44220bdd107798d86abc78749dc125/archetype/spec/hello-spec.coffee | 1 | 3 | ||
linemanjs/lineman:archetype/spec/hello-spec.coffee:1:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
describe ".helloText", ->
When -> @result = helloText()
Then -> expect(@result).toEqual("Hello, World!")
``` | describe(".helloText", function() {
When(function() {
return this.result = helloText();
});
return Then(function() {
return expect(this.result).toEqual("Hello, World!");
});
}); | CoffeeScript | JavaScript | linemanjs/lineman | archetype/spec/hello-spec.coffee | MIT | da7b69982e44220bdd107798d86abc78749dc125 | 1,168 | https://github.com/linemanjs/lineman/blob/da7b69982e44220bdd107798d86abc78749dc125/archetype/spec/hello-spec.coffee | 1 | 3 |
linemanjs/lineman:archetype/spec/hello-spec.coffee:1:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
describe(".helloText", function() {
When(function() {
return this.result = helloText();
});
return Then(function() {
return expect(this.result).toEqual("Hello, World!");
});
});
``` | describe ".helloText", ->
When -> @result = helloText()
Then -> expect(@result).toEqual("Hello, World!") | JavaScript | CoffeeScript | linemanjs/lineman | archetype/spec/hello-spec.coffee | MIT | da7b69982e44220bdd107798d86abc78749dc125 | 1,168 | https://github.com/linemanjs/lineman/blob/da7b69982e44220bdd107798d86abc78749dc125/archetype/spec/hello-spec.coffee | 1 | 3 |
elving/swag:test/miscellaneous_test.coffee:1:raw_corpus | raw_corpus | require 'should'
Handlebars = require 'handlebars'
Swag = require '../lib/swag'
Swag.registerHelpers Handlebars
describe 'default', ->
describe '{{default title "Not title available."}}', ->
it 'should provide a default or fallback value if a value doesn\'t exist.', ->
source = '{{default t... | CoffeeScript | elving/swag | test/miscellaneous_test.coffee | MIT | e9c8788dfc9f640038c00eaafe33f4137ff5f465 | 675 | https://github.com/elving/swag/blob/e9c8788dfc9f640038c00eaafe33f4137ff5f465/test/miscellaneous_test.coffee | 1 | 39 | ||
elving/swag:test/miscellaneous_test.coffee:1:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
require 'should'
Handlebars = require 'handlebars'
Swag = require '../lib/swag'
Swag.registerHelpers Handlebars
describe 'default', ->
describe '{{default title "Not title available."}}', ->
it 'should provide a default or fallback value if a value... | var Handlebars, Swag;
require('should');
Handlebars = require('handlebars');
Swag = require('../lib/swag');
Swag.registerHelpers(Handlebars);
describe('default', function() {
return describe('{{default title "Not title available."}}', function() {
return it('should provide a default or fallback value if a va... | CoffeeScript | JavaScript | elving/swag | test/miscellaneous_test.coffee | MIT | e9c8788dfc9f640038c00eaafe33f4137ff5f465 | 675 | https://github.com/elving/swag/blob/e9c8788dfc9f640038c00eaafe33f4137ff5f465/test/miscellaneous_test.coffee | 1 | 39 |
elving/swag:test/miscellaneous_test.coffee:1:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
var Handlebars, Swag;
require('should');
Handlebars = require('handlebars');
Swag = require('../lib/swag');
Swag.registerHelpers(Handlebars);
describe('default', function() {
return describe('{{default title "Not title available."}}', function() {
return... | require 'should'
Handlebars = require 'handlebars'
Swag = require '../lib/swag'
Swag.registerHelpers Handlebars
describe 'default', ->
describe '{{default title "Not title available."}}', ->
it 'should provide a default or fallback value if a value doesn\'t exist.', ->
source = '{{default t... | JavaScript | CoffeeScript | elving/swag | test/miscellaneous_test.coffee | MIT | e9c8788dfc9f640038c00eaafe33f4137ff5f465 | 675 | https://github.com/elving/swag/blob/e9c8788dfc9f640038c00eaafe33f4137ff5f465/test/miscellaneous_test.coffee | 1 | 39 |
elving/swag:test/miscellaneous_test.coffee:1:completion | completion | require 'should'
Handlebars = require 'handlebars'
Swag = require '../lib/swag'
Swag.registerHelpers Handlebars
describe 'default', ->
describe '{{default title "Not title available."}}', ->
it 'should provide a default or fallback value if a value doesn\'t exist.', ->
source = '{{default t... | beforeEach ->
delete Swag.Handlebars.partials["some_template"]
describe '{{partial name data template}}', ->
it 'should register and render a partial.', ->
context =
data: text: 'yay'
template: 'A partial {{text}}.'
source = '{{partial "som... | CoffeeScript | CoffeeScript | elving/swag | test/miscellaneous_test.coffee | MIT | e9c8788dfc9f640038c00eaafe33f4137ff5f465 | 675 | https://github.com/elving/swag/blob/e9c8788dfc9f640038c00eaafe33f4137ff5f465/test/miscellaneous_test.coffee | 1 | 39 |
elving/swag:test/miscellaneous_test.coffee:1:raw_corpus | raw_corpus | require 'should'
Handlebars = require 'handlebars'
Swag = require '../lib/swag'
Swag.registerHelpers Handlebars
describe 'default', ->
describe '{{default title "Not title available."}}', ->
it 'should provide a default or fallback value if a value doesn\'t exist.', ->
source = '{{default t... | CoffeeScript | elving/swag | test/miscellaneous_test.coffee | MIT | f17d2de491f4ec174ae77b59461eb8c9f823302c | 675 | https://github.com/elving/swag/blob/f17d2de491f4ec174ae77b59461eb8c9f823302c/test/miscellaneous_test.coffee | 1 | 25 | ||
elving/swag:test/miscellaneous_test.coffee:1:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
require 'should'
Handlebars = require 'handlebars'
Swag = require '../lib/swag'
Swag.registerHelpers Handlebars
describe 'default', ->
describe '{{default title "Not title available."}}', ->
it 'should provide a default or fallback value if a value... | var Handlebars, Swag;
require('should');
Handlebars = require('handlebars');
Swag = require('../lib/swag');
Swag.registerHelpers(Handlebars);
describe('default', function() {
return describe('{{default title "Not title available."}}', function() {
return it('should provide a default or fallback value if a va... | CoffeeScript | JavaScript | elving/swag | test/miscellaneous_test.coffee | MIT | f17d2de491f4ec174ae77b59461eb8c9f823302c | 675 | https://github.com/elving/swag/blob/f17d2de491f4ec174ae77b59461eb8c9f823302c/test/miscellaneous_test.coffee | 1 | 25 |
elving/swag:test/miscellaneous_test.coffee:1:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
var Handlebars, Swag;
require('should');
Handlebars = require('handlebars');
Swag = require('../lib/swag');
Swag.registerHelpers(Handlebars);
describe('default', function() {
return describe('{{default title "Not title available."}}', function() {
return... | require 'should'
Handlebars = require 'handlebars'
Swag = require '../lib/swag'
Swag.registerHelpers Handlebars
describe 'default', ->
describe '{{default title "Not title available."}}', ->
it 'should provide a default or fallback value if a value doesn\'t exist.', ->
source = '{{default t... | JavaScript | CoffeeScript | elving/swag | test/miscellaneous_test.coffee | MIT | f17d2de491f4ec174ae77b59461eb8c9f823302c | 675 | https://github.com/elving/swag/blob/f17d2de491f4ec174ae77b59461eb8c9f823302c/test/miscellaneous_test.coffee | 1 | 25 |
elving/swag:test/miscellaneous_test.coffee:1:completion | completion | require 'should'
Handlebars = require 'handlebars'
Swag = require '../lib/swag'
Swag.registerHelpers Handlebars
describe 'default', ->
describe '{{default title "Not title available."}}', ->
it 'should provide a default or fallback value if a value doesn\'t exist.', ->
source = '{{default t... | context = title: null
template(context).should.equal 'No title available.'
Swag.Config.partialsPath = '../test/templates/'
describe 'partial', ->
describe '{{partial "some_template"}}', ->
it 'should register and render a partial.', ->
source = '{{partial "some_template"}}'
... | CoffeeScript | CoffeeScript | elving/swag | test/miscellaneous_test.coffee | MIT | f17d2de491f4ec174ae77b59461eb8c9f823302c | 675 | https://github.com/elving/swag/blob/f17d2de491f4ec174ae77b59461eb8c9f823302c/test/miscellaneous_test.coffee | 1 | 25 |
elving/swag:test/miscellaneous_test.coffee:1:raw_corpus | raw_corpus | require 'should'
Handlebars = require 'handlebars'
Swag = require '../lib/swag'
describe 'default', ->
describe '{{default title "Not title available."}}', ->
it 'should provide a default or fallback value if a value doesn\'t exist.', ->
source = '{{default title "No title available."}}'
... | CoffeeScript | elving/swag | test/miscellaneous_test.coffee | MIT | 5e45f8e30f1605c8b521997024c9a49806571fc8 | 675 | https://github.com/elving/swag/blob/5e45f8e30f1605c8b521997024c9a49806571fc8/test/miscellaneous_test.coffee | 1 | 23 | ||
elving/swag:test/miscellaneous_test.coffee:1:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
require 'should'
Handlebars = require 'handlebars'
Swag = require '../lib/swag'
describe 'default', ->
describe '{{default title "Not title available."}}', ->
it 'should provide a default or fallback value if a value doesn\'t exist.', ->
... | var Handlebars, Swag;
require('should');
Handlebars = require('handlebars');
Swag = require('../lib/swag');
describe('default', function() {
return describe('{{default title "Not title available."}}', function() {
return it('should provide a default or fallback value if a value doesn\'t exist.', function() {
... | CoffeeScript | JavaScript | elving/swag | test/miscellaneous_test.coffee | MIT | 5e45f8e30f1605c8b521997024c9a49806571fc8 | 675 | https://github.com/elving/swag/blob/5e45f8e30f1605c8b521997024c9a49806571fc8/test/miscellaneous_test.coffee | 1 | 23 |
elving/swag:test/miscellaneous_test.coffee:1:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
var Handlebars, Swag;
require('should');
Handlebars = require('handlebars');
Swag = require('../lib/swag');
describe('default', function() {
return describe('{{default title "Not title available."}}', function() {
return it('should provide a default or fa... | require 'should'
Handlebars = require 'handlebars'
Swag = require '../lib/swag'
describe 'default', ->
describe '{{default title "Not title available."}}', ->
it 'should provide a default or fallback value if a value doesn\'t exist.', ->
source = '{{default title "No title available."}}'
... | JavaScript | CoffeeScript | elving/swag | test/miscellaneous_test.coffee | MIT | 5e45f8e30f1605c8b521997024c9a49806571fc8 | 675 | https://github.com/elving/swag/blob/5e45f8e30f1605c8b521997024c9a49806571fc8/test/miscellaneous_test.coffee | 1 | 23 |
elving/swag:test/miscellaneous_test.coffee:1:completion | completion | require 'should'
Handlebars = require 'handlebars'
Swag = require '../lib/swag'
describe 'default', ->
describe '{{default title "Not title available."}}', ->
it 'should provide a default or fallback value if a value doesn\'t exist.', ->
source = '{{default title "No title available."}}'
... | template(context).should.equal 'No title available.'
Swag.Config.partialsPath = '../test/templates/'
describe 'partial', ->
describe '{{partial "some_template"}}', ->
it 'should register and render a partial.', ->
source = '{{partial "some_template"}}'
template = Handlebars.compi... | CoffeeScript | CoffeeScript | elving/swag | test/miscellaneous_test.coffee | MIT | 5e45f8e30f1605c8b521997024c9a49806571fc8 | 675 | https://github.com/elving/swag/blob/5e45f8e30f1605c8b521997024c9a49806571fc8/test/miscellaneous_test.coffee | 1 | 23 |
oozcitak/xmlbuilder-js:test/issues/157.coffee:1:raw_corpus | raw_corpus | suite 'Tests specific to issues:', ->
test 'Option to add space before closing tag. Issue 157', ->
eq(
xml('root')
.dtd('hello.dtd')
.ins('pub_border', 'thin')
.ele('img', 'EMPTY')
.att('img', 'height', 'CDATA', '#REQUIRED')
.not('fs', { sysID: 'http:/... | CoffeeScript | oozcitak/xmlbuilder-js | test/issues/157.coffee | MIT | ce625aeb9f52d1f75d5d94260794d3b5fd74a8b1 | 926 | https://github.com/oozcitak/xmlbuilder-js/blob/ce625aeb9f52d1f75d5d94260794d3b5fd74a8b1/test/issues/157.coffee | 1 | 39 | ||
oozcitak/xmlbuilder-js:test/issues/157.coffee:1:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
suite 'Tests specific to issues:', ->
test 'Option to add space before closing tag. Issue 157', ->
eq(
xml('root')
.dtd('hello.dtd')
.ins('pub_border', 'thin')
.ele('img', 'EMPTY')
.att('img', 'height', 'CDA... | suite('Tests specific to issues:', function() {
test('Option to add space before closing tag. Issue 157', function() {
return eq(xml('root').dtd('hello.dtd').ins('pub_border', 'thin').ele('img', 'EMPTY').att('img', 'height', 'CDATA', '#REQUIRED').not('fs', {
sysID: 'http://my.fs.com/reader'
}).ent('ent'... | CoffeeScript | JavaScript | oozcitak/xmlbuilder-js | test/issues/157.coffee | MIT | ce625aeb9f52d1f75d5d94260794d3b5fd74a8b1 | 926 | https://github.com/oozcitak/xmlbuilder-js/blob/ce625aeb9f52d1f75d5d94260794d3b5fd74a8b1/test/issues/157.coffee | 1 | 39 |
oozcitak/xmlbuilder-js:test/issues/157.coffee:1:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
suite('Tests specific to issues:', function() {
test('Option to add space before closing tag. Issue 157', function() {
return eq(xml('root').dtd('hello.dtd').ins('pub_border', 'thin').ele('img', 'EMPTY').att('img', 'height', 'CDATA', '#REQUIRED').not('fs', {
... | suite 'Tests specific to issues:', ->
test 'Option to add space before closing tag. Issue 157', ->
eq(
xml('root')
.dtd('hello.dtd')
.ins('pub_border', 'thin')
.ele('img', 'EMPTY')
.att('img', 'height', 'CDATA', '#REQUIRED')
.not('fs', { sysID: 'http:/... | JavaScript | CoffeeScript | oozcitak/xmlbuilder-js | test/issues/157.coffee | MIT | ce625aeb9f52d1f75d5d94260794d3b5fd74a8b1 | 926 | https://github.com/oozcitak/xmlbuilder-js/blob/ce625aeb9f52d1f75d5d94260794d3b5fd74a8b1/test/issues/157.coffee | 1 | 39 |
oozcitak/xmlbuilder-js:test/issues/157.coffee:1:completion | completion | suite 'Tests specific to issues:', ->
test 'Option to add space before closing tag. Issue 157', ->
eq(
xml('root')
.dtd('hello.dtd')
.ins('pub_border', 'thin')
.ele('img', 'EMPTY')
.att('img', 'height', 'CDATA', '#REQUIRED')
.not('fs', { sysID: 'http:/... | <?pub_border thin ?>
<!ELEMENT img EMPTY >
<!ATTLIST img height CDATA #REQUIRED >
<!NOTATION fs SYSTEM "http://my.fs.com/reader" >
<!ENTITY ent "my val" >
<!ENTITY % ent "my val" >
] >
<root>
<?a b ?>
<xmlbuilder />
</root>
"""
)
tes... | CoffeeScript | CoffeeScript | oozcitak/xmlbuilder-js | test/issues/157.coffee | MIT | ce625aeb9f52d1f75d5d94260794d3b5fd74a8b1 | 926 | https://github.com/oozcitak/xmlbuilder-js/blob/ce625aeb9f52d1f75d5d94260794d3b5fd74a8b1/test/issues/157.coffee | 1 | 39 |
oozcitak/xmlbuilder-js:test/issues/157.coffee:1:raw_corpus | raw_corpus | suite 'Creating XML with string writer:', ->
test 'Plain text writer', ->
eq(
xml('root')
.dtd('hello.dtd')
.ins('pub_border', 'thin')
.ele('img', 'EMPTY')
.att('img', 'height', 'CDATA', '#REQUIRED')
.not('fs', { sysID: 'http://my.fs.com/reader' })
... | CoffeeScript | oozcitak/xmlbuilder-js | test/issues/157.coffee | MIT | 63d51436618d67eee703abc4c720a732d13036ee | 926 | https://github.com/oozcitak/xmlbuilder-js/blob/63d51436618d67eee703abc4c720a732d13036ee/test/issues/157.coffee | 1 | 39 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.