id stringlengths 34 124 | type stringclasses 4
values | prompt stringlengths 0 4.95k | response stringlengths 21 4.89k | source_lang stringclasses 3
values | target_lang stringclasses 2
values | repo stringclasses 75
values | path stringlengths 10 88 | license stringclasses 1
value | commit stringlengths 40 40 | stars int64 431 18.7k | source_url stringlengths 86 176 | line_start int64 1 214 | line_end int64 3 253 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
elving/swag:src/swag.dates.coffee:7:raw_corpus | raw_corpus | Dates.format = (date, format) ->
format.replace Dates.formats, (m, p) ->
switch p
when 'a' then Dates.abbreviatedWeekdays[date.getDay()]
when 'A' then Dates.fullWeekdays[date.getDay()]
when 'b' then Dates.abbreviatedMonths[date.getMonth()]
when 'B' then Dates.... | CoffeeScript | elving/swag | src/swag.dates.coffee | MIT | e9c8788dfc9f640038c00eaafe33f4137ff5f465 | 675 | https://github.com/elving/swag/blob/e9c8788dfc9f640038c00eaafe33f4137ff5f465/src/swag.dates.coffee | 34 | 83 | ||
elving/swag:src/swag.dates.coffee:7:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
Dates.format = (date, format) ->
format.replace Dates.formats, (m, p) ->
switch p
when 'a' then Dates.abbreviatedWeekdays[date.getDay()]
when 'A' then Dates.fullWeekdays[date.getDay()]
when 'b' then Dates.abbreviate... | Dates.format = function(date, format) {
return format.replace(Dates.formats, function(m, p) {
switch (p) {
case 'a':
return Dates.abbreviatedWeekdays[date.getDay()];
case 'A':
return Dates.fullWeekdays[date.getDay()];
case 'b':
return Dates.abbreviatedMonths[date.getMonth... | CoffeeScript | JavaScript | elving/swag | src/swag.dates.coffee | MIT | e9c8788dfc9f640038c00eaafe33f4137ff5f465 | 675 | https://github.com/elving/swag/blob/e9c8788dfc9f640038c00eaafe33f4137ff5f465/src/swag.dates.coffee | 34 | 83 |
elving/swag:src/swag.dates.coffee:7:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
Dates.format = function(date, format) {
return format.replace(Dates.formats, function(m, p) {
switch (p) {
case 'a':
return Dates.abbreviatedWeekdays[date.getDay()];
case 'A':
return Dates.fullWeekdays[date.getDay()];
case 'b... | Dates.format = (date, format) ->
format.replace Dates.formats, (m, p) ->
switch p
when 'a' then Dates.abbreviatedWeekdays[date.getDay()]
when 'A' then Dates.fullWeekdays[date.getDay()]
when 'b' then Dates.abbreviatedMonths[date.getMonth()]
when 'B' then Dates.... | JavaScript | CoffeeScript | elving/swag | src/swag.dates.coffee | MIT | e9c8788dfc9f640038c00eaafe33f4137ff5f465 | 675 | https://github.com/elving/swag/blob/e9c8788dfc9f640038c00eaafe33f4137ff5f465/src/swag.dates.coffee | 34 | 83 |
elving/swag:src/swag.dates.coffee:7:completion | completion | Dates.format = (date, format) ->
format.replace Dates.formats, (m, p) ->
switch p
when 'a' then Dates.abbreviatedWeekdays[date.getDay()]
when 'A' then Dates.fullWeekdays[date.getDay()]
when 'b' then Dates.abbreviatedMonths[date.getMonth()]
when 'B' then Dates.... | when 'P' then Dates.format(date, '%p').toLowerCase()
when 'r' then Dates.format date, '%I:%M:%S %p'
when 'R' then Dates.format date, '%H:%M'
when 's' then date.getTime() / 1000
when 'S' then Dates.padNumber date.getSeconds(), 2
when 't' then '\t'
w... | CoffeeScript | CoffeeScript | elving/swag | src/swag.dates.coffee | MIT | e9c8788dfc9f640038c00eaafe33f4137ff5f465 | 675 | https://github.com/elving/swag/blob/e9c8788dfc9f640038c00eaafe33f4137ff5f465/src/swag.dates.coffee | 34 | 83 |
elving/swag:src/swag.dates.coffee:8:raw_corpus | raw_corpus | # Port of formatDate-js library - https://github.com/michaelbaldry/formatDate-js
Swag.addHelper 'formatDate', (date, format) ->
date = new Date date
Dates.format date, format
, ['string|number|date', 'string']
Swag.addHelper 'now', (format) ->
date = new Date()
if Utils.isUndefined(format) then date el... | CoffeeScript | elving/swag | src/swag.dates.coffee | MIT | e9c8788dfc9f640038c00eaafe33f4137ff5f465 | 675 | https://github.com/elving/swag/blob/e9c8788dfc9f640038c00eaafe33f4137ff5f465/src/swag.dates.coffee | 84 | 115 | ||
elving/swag:src/swag.dates.coffee:8:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
# Port of formatDate-js library - https://github.com/michaelbaldry/formatDate-js
Swag.addHelper 'formatDate', (date, format) ->
date = new Date date
Dates.format date, format
, ['string|number|date', 'string']
Swag.addHelper 'now', (format) ->
date =... | // Port of formatDate-js library - https://github.com/michaelbaldry/formatDate-js
Swag.addHelper('formatDate', function(date, format) {
date = new Date(date);
return Dates.format(date, format);
}, ['string|number|date', 'string']);
Swag.addHelper('now', function(format) {
var date;
date = new Date();
if (Uti... | CoffeeScript | JavaScript | elving/swag | src/swag.dates.coffee | MIT | e9c8788dfc9f640038c00eaafe33f4137ff5f465 | 675 | https://github.com/elving/swag/blob/e9c8788dfc9f640038c00eaafe33f4137ff5f465/src/swag.dates.coffee | 84 | 115 |
elving/swag:src/swag.dates.coffee:8:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
// Port of formatDate-js library - https://github.com/michaelbaldry/formatDate-js
Swag.addHelper('formatDate', function(date, format) {
date = new Date(date);
return Dates.format(date, format);
}, ['string|number|date', 'string']);
Swag.addHelper('now', functi... | # Port of formatDate-js library - https://github.com/michaelbaldry/formatDate-js
Swag.addHelper 'formatDate', (date, format) ->
date = new Date date
Dates.format date, format
, ['string|number|date', 'string']
Swag.addHelper 'now', (format) ->
date = new Date()
if Utils.isUndefined(format) then date el... | JavaScript | CoffeeScript | elving/swag | src/swag.dates.coffee | MIT | e9c8788dfc9f640038c00eaafe33f4137ff5f465 | 675 | https://github.com/elving/swag/blob/e9c8788dfc9f640038c00eaafe33f4137ff5f465/src/swag.dates.coffee | 84 | 115 |
elving/swag:src/swag.dates.coffee:8:completion | completion | # Port of formatDate-js library - https://github.com/michaelbaldry/formatDate-js
Swag.addHelper 'formatDate', (date, format) ->
date = new Date date
Dates.format date, format
, ['string|number|date', 'string']
Swag.addHelper 'now', (format) ->
date = new Date()
if Utils.isUndefined(format) then date el... | return "#{interval} years ago" if interval > 1
interval = Math.floor(seconds / 2592000)
return if interval > 1 then "#{interval} months ago"
interval = Math.floor(seconds / 86400)
return if interval > 1 then "#{interval} days ago"
interval = Math.floor(seconds / 3600)
return if interval > 1 t... | CoffeeScript | CoffeeScript | elving/swag | src/swag.dates.coffee | MIT | e9c8788dfc9f640038c00eaafe33f4137ff5f465 | 675 | https://github.com/elving/swag/blob/e9c8788dfc9f640038c00eaafe33f4137ff5f465/src/swag.dates.coffee | 84 | 115 |
elving/swag:src/swag.dates.coffee:8:raw_corpus | raw_corpus | # Port of formatDate-js library - https://github.com/michaelbaldry/formatDate-js
Swag.addHelper 'formatDate', (date, format) ->
date = Utils.result date
format = Utils.result format
date = new Date date
Dates.format date, format
, ['string|number|date', 'string']
Swag.addHelper 'now', (format) ->
f... | CoffeeScript | elving/swag | src/swag.dates.coffee | MIT | 1dab7399e1ac6127c7b2cde8d518f46c85838801 | 675 | https://github.com/elving/swag/blob/1dab7399e1ac6127c7b2cde8d518f46c85838801/src/swag.dates.coffee | 84 | 119 | ||
elving/swag:src/swag.dates.coffee:8:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
# Port of formatDate-js library - https://github.com/michaelbaldry/formatDate-js
Swag.addHelper 'formatDate', (date, format) ->
date = Utils.result date
format = Utils.result format
date = new Date date
Dates.format date, format
, ['string|number|... | // Port of formatDate-js library - https://github.com/michaelbaldry/formatDate-js
Swag.addHelper('formatDate', function(date, format) {
date = Utils.result(date);
format = Utils.result(format);
date = new Date(date);
return Dates.format(date, format);
}, ['string|number|date', 'string']);
Swag.addHelper('now',... | CoffeeScript | JavaScript | elving/swag | src/swag.dates.coffee | MIT | 1dab7399e1ac6127c7b2cde8d518f46c85838801 | 675 | https://github.com/elving/swag/blob/1dab7399e1ac6127c7b2cde8d518f46c85838801/src/swag.dates.coffee | 84 | 119 |
elving/swag:src/swag.dates.coffee:8:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
// Port of formatDate-js library - https://github.com/michaelbaldry/formatDate-js
Swag.addHelper('formatDate', function(date, format) {
date = Utils.result(date);
format = Utils.result(format);
date = new Date(date);
return Dates.format(date, format);
}, ['... | # Port of formatDate-js library - https://github.com/michaelbaldry/formatDate-js
Swag.addHelper 'formatDate', (date, format) ->
date = Utils.result date
format = Utils.result format
date = new Date date
Dates.format date, format
, ['string|number|date', 'string']
Swag.addHelper 'now', (format) ->
f... | JavaScript | CoffeeScript | elving/swag | src/swag.dates.coffee | MIT | 1dab7399e1ac6127c7b2cde8d518f46c85838801 | 675 | https://github.com/elving/swag/blob/1dab7399e1ac6127c7b2cde8d518f46c85838801/src/swag.dates.coffee | 84 | 119 |
elving/swag:src/swag.dates.coffee:8:completion | completion | # Port of formatDate-js library - https://github.com/michaelbaldry/formatDate-js
Swag.addHelper 'formatDate', (date, format) ->
date = Utils.result date
format = Utils.result format
date = new Date date
Dates.format date, format
, ['string|number|date', 'string']
Swag.addHelper 'now', (format) ->
f... | interval = Math.floor(seconds / 31536000)
return "#{interval} years ago" if interval > 1
interval = Math.floor(seconds / 2592000)
return if interval > 1 then "#{interval} months ago"
interval = Math.floor(seconds / 86400)
return if interval > 1 then "#{interval} days ago"
interval = Math.floo... | CoffeeScript | CoffeeScript | elving/swag | src/swag.dates.coffee | MIT | 1dab7399e1ac6127c7b2cde8d518f46c85838801 | 675 | https://github.com/elving/swag/blob/1dab7399e1ac6127c7b2cde8d518f46c85838801/src/swag.dates.coffee | 84 | 119 |
elving/swag:src/swag.dates.coffee:8:raw_corpus | raw_corpus | # Port of formatDate-js library - https://github.com/michaelbaldry/formatDate-js
Swag.addHelper 'formatDate', (date, format) ->
unless Utils.isUndefined date
date = Utils.result date
format = Utils.result format
date = new Date date
Dates.format date, format
else
Utils.er... | CoffeeScript | elving/swag | src/swag.dates.coffee | MIT | 3a5249a04c2d7c27acb8834dc3e31ae0f56ccfd1 | 675 | https://github.com/elving/swag/blob/3a5249a04c2d7c27acb8834dc3e31ae0f56ccfd1/src/swag.dates.coffee | 84 | 123 | ||
elving/swag:src/swag.dates.coffee:8:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
# Port of formatDate-js library - https://github.com/michaelbaldry/formatDate-js
Swag.addHelper 'formatDate', (date, format) ->
unless Utils.isUndefined date
date = Utils.result date
format = Utils.result format
date = new Date date
... | // Port of formatDate-js library - https://github.com/michaelbaldry/formatDate-js
Swag.addHelper('formatDate', function(date, format) {
if (!Utils.isUndefined(date)) {
date = Utils.result(date);
format = Utils.result(format);
date = new Date(date);
return Dates.format(date, format);
} else {
ret... | CoffeeScript | JavaScript | elving/swag | src/swag.dates.coffee | MIT | 3a5249a04c2d7c27acb8834dc3e31ae0f56ccfd1 | 675 | https://github.com/elving/swag/blob/3a5249a04c2d7c27acb8834dc3e31ae0f56ccfd1/src/swag.dates.coffee | 84 | 123 |
elving/swag:src/swag.dates.coffee:8:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
// Port of formatDate-js library - https://github.com/michaelbaldry/formatDate-js
Swag.addHelper('formatDate', function(date, format) {
if (!Utils.isUndefined(date)) {
date = Utils.result(date);
format = Utils.result(format);
date = new Date(date);
... | # Port of formatDate-js library - https://github.com/michaelbaldry/formatDate-js
Swag.addHelper 'formatDate', (date, format) ->
unless Utils.isUndefined date
date = Utils.result date
format = Utils.result format
date = new Date date
Dates.format date, format
else
Utils.er... | JavaScript | CoffeeScript | elving/swag | src/swag.dates.coffee | MIT | 3a5249a04c2d7c27acb8834dc3e31ae0f56ccfd1 | 675 | https://github.com/elving/swag/blob/3a5249a04c2d7c27acb8834dc3e31ae0f56ccfd1/src/swag.dates.coffee | 84 | 123 |
elving/swag:src/swag.dates.coffee:8:completion | completion | # Port of formatDate-js library - https://github.com/michaelbaldry/formatDate-js
Swag.addHelper 'formatDate', (date, format) ->
unless Utils.isUndefined date
date = Utils.result date
format = Utils.result format
date = new Date date
Dates.format date, format
else
Utils.er... | seconds = Math.floor((new Date() - date) / 1000)
interval = Math.floor(seconds / 31536000)
return "#{interval} years ago" if interval > 1
interval = Math.floor(seconds / 2592000)
return if interval > 1 then "#{interval} months ago"
interval = Math.floor(seconds / 86400)
... | CoffeeScript | CoffeeScript | elving/swag | src/swag.dates.coffee | MIT | 3a5249a04c2d7c27acb8834dc3e31ae0f56ccfd1 | 675 | https://github.com/elving/swag/blob/3a5249a04c2d7c27acb8834dc3e31ae0f56ccfd1/src/swag.dates.coffee | 84 | 123 |
elving/swag:src/swag.dates.coffee:8:raw_corpus | raw_corpus | # Port of formatDate-js library - https://github.com/michaelbaldry/formatDate-js
Swag.addHelper 'formatDate', (date, format) ->
date = new Date date
Dates.format date, format
Swag.addHelper 'now', (format) ->
date = new Date()
if Utils.isUndefined(format) then date else Dates.format(date, format)
# Mo... | CoffeeScript | elving/swag | src/swag.dates.coffee | MIT | f17d2de491f4ec174ae77b59461eb8c9f823302c | 675 | https://github.com/elving/swag/blob/f17d2de491f4ec174ae77b59461eb8c9f823302c/src/swag.dates.coffee | 84 | 113 | ||
elving/swag:src/swag.dates.coffee:8:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
# Port of formatDate-js library - https://github.com/michaelbaldry/formatDate-js
Swag.addHelper 'formatDate', (date, format) ->
date = new Date date
Dates.format date, format
Swag.addHelper 'now', (format) ->
date = new Date()
if Utils.isUndefine... | // Port of formatDate-js library - https://github.com/michaelbaldry/formatDate-js
Swag.addHelper('formatDate', function(date, format) {
date = new Date(date);
return Dates.format(date, format);
});
Swag.addHelper('now', function(format) {
var date;
date = new Date();
if (Utils.isUndefined(format)) {
retu... | CoffeeScript | JavaScript | elving/swag | src/swag.dates.coffee | MIT | f17d2de491f4ec174ae77b59461eb8c9f823302c | 675 | https://github.com/elving/swag/blob/f17d2de491f4ec174ae77b59461eb8c9f823302c/src/swag.dates.coffee | 84 | 113 |
elving/swag:src/swag.dates.coffee:8:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
// Port of formatDate-js library - https://github.com/michaelbaldry/formatDate-js
Swag.addHelper('formatDate', function(date, format) {
date = new Date(date);
return Dates.format(date, format);
});
Swag.addHelper('now', function(format) {
var date;
date = ... | # Port of formatDate-js library - https://github.com/michaelbaldry/formatDate-js
Swag.addHelper 'formatDate', (date, format) ->
date = new Date date
Dates.format date, format
Swag.addHelper 'now', (format) ->
date = new Date()
if Utils.isUndefined(format) then date else Dates.format(date, format)
# Mo... | JavaScript | CoffeeScript | elving/swag | src/swag.dates.coffee | MIT | f17d2de491f4ec174ae77b59461eb8c9f823302c | 675 | https://github.com/elving/swag/blob/f17d2de491f4ec174ae77b59461eb8c9f823302c/src/swag.dates.coffee | 84 | 113 |
elving/swag:src/swag.dates.coffee:8:completion | completion | # Port of formatDate-js library - https://github.com/michaelbaldry/formatDate-js
Swag.addHelper 'formatDate', (date, format) ->
date = new Date date
Dates.format date, format
Swag.addHelper 'now', (format) ->
date = new Date()
if Utils.isUndefined(format) then date else Dates.format(date, format)
# Mo... | return "#{interval} years ago" if interval > 1
interval = Math.floor(seconds / 2592000)
return if interval > 1 then "#{interval} months ago"
interval = Math.floor(seconds / 86400)
return if interval > 1 then "#{interval} days ago"
interval = Math.floor(seconds / 3600)
return if interval > 1 t... | CoffeeScript | CoffeeScript | elving/swag | src/swag.dates.coffee | MIT | f17d2de491f4ec174ae77b59461eb8c9f823302c | 675 | https://github.com/elving/swag/blob/f17d2de491f4ec174ae77b59461eb8c9f823302c/src/swag.dates.coffee | 84 | 113 |
elving/swag:src/swag.dates.coffee:8:raw_corpus | raw_corpus | # Port of formatDate-js library - https://github.com/michaelbaldry/formatDate-js
Swag.registerHelper 'formatDate', (date, format) ->
date = new Date date
Dates.format date, format
Swag.registerHelper 'now', (format) ->
date = new Date()
if Utils.isUndefined(format) then date else Dates.format(date, for... | CoffeeScript | elving/swag | src/swag.dates.coffee | MIT | 65fa361b1dbaa9c28ca8dbf5cad24d741f96ff17 | 675 | https://github.com/elving/swag/blob/65fa361b1dbaa9c28ca8dbf5cad24d741f96ff17/src/swag.dates.coffee | 84 | 113 | ||
elving/swag:src/swag.dates.coffee:8:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
# Port of formatDate-js library - https://github.com/michaelbaldry/formatDate-js
Swag.registerHelper 'formatDate', (date, format) ->
date = new Date date
Dates.format date, format
Swag.registerHelper 'now', (format) ->
date = new Date()
if Utils.... | // Port of formatDate-js library - https://github.com/michaelbaldry/formatDate-js
Swag.registerHelper('formatDate', function(date, format) {
date = new Date(date);
return Dates.format(date, format);
});
Swag.registerHelper('now', function(format) {
var date;
date = new Date();
if (Utils.isUndefined(format)) ... | CoffeeScript | JavaScript | elving/swag | src/swag.dates.coffee | MIT | 65fa361b1dbaa9c28ca8dbf5cad24d741f96ff17 | 675 | https://github.com/elving/swag/blob/65fa361b1dbaa9c28ca8dbf5cad24d741f96ff17/src/swag.dates.coffee | 84 | 113 |
elving/swag:src/swag.dates.coffee:8:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
// Port of formatDate-js library - https://github.com/michaelbaldry/formatDate-js
Swag.registerHelper('formatDate', function(date, format) {
date = new Date(date);
return Dates.format(date, format);
});
Swag.registerHelper('now', function(format) {
var date;... | # Port of formatDate-js library - https://github.com/michaelbaldry/formatDate-js
Swag.registerHelper 'formatDate', (date, format) ->
date = new Date date
Dates.format date, format
Swag.registerHelper 'now', (format) ->
date = new Date()
if Utils.isUndefined(format) then date else Dates.format(date, for... | JavaScript | CoffeeScript | elving/swag | src/swag.dates.coffee | MIT | 65fa361b1dbaa9c28ca8dbf5cad24d741f96ff17 | 675 | https://github.com/elving/swag/blob/65fa361b1dbaa9c28ca8dbf5cad24d741f96ff17/src/swag.dates.coffee | 84 | 113 |
elving/swag:src/swag.dates.coffee:8:completion | completion | # Port of formatDate-js library - https://github.com/michaelbaldry/formatDate-js
Swag.registerHelper 'formatDate', (date, format) ->
date = new Date date
Dates.format date, format
Swag.registerHelper 'now', (format) ->
date = new Date()
if Utils.isUndefined(format) then date else Dates.format(date, for... | return "#{interval} years ago" if interval > 1
interval = Math.floor(seconds / 2592000)
return if interval > 1 then "#{interval} months ago"
interval = Math.floor(seconds / 86400)
return if interval > 1 then "#{interval} days ago"
interval = Math.floor(seconds / 3600)
return if interval > 1 t... | CoffeeScript | CoffeeScript | elving/swag | src/swag.dates.coffee | MIT | 65fa361b1dbaa9c28ca8dbf5cad24d741f96ff17 | 675 | https://github.com/elving/swag/blob/65fa361b1dbaa9c28ca8dbf5cad24d741f96ff17/src/swag.dates.coffee | 84 | 113 |
elving/swag:src/swag.dates.coffee:8:raw_corpus | raw_corpus | # Port of formatDate-js library - https://github.com/michaelbaldry/formatDate-js
Handlebars.registerHelper 'formatDate', (date, format) ->
date = new Date date
Dates.format date, format
Handlebars.registerHelper 'now', (format) ->
date = new Date()
if Utils.isUndefined(format) then date else Dates.form... | CoffeeScript | elving/swag | src/swag.dates.coffee | MIT | 163af3a070eefe79a32c8239884929e0cae1f589 | 675 | https://github.com/elving/swag/blob/163af3a070eefe79a32c8239884929e0cae1f589/src/swag.dates.coffee | 84 | 113 | ||
elving/swag:src/swag.dates.coffee:8:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
# Port of formatDate-js library - https://github.com/michaelbaldry/formatDate-js
Handlebars.registerHelper 'formatDate', (date, format) ->
date = new Date date
Dates.format date, format
Handlebars.registerHelper 'now', (format) ->
date = new Date()
... | // Port of formatDate-js library - https://github.com/michaelbaldry/formatDate-js
Handlebars.registerHelper('formatDate', function(date, format) {
date = new Date(date);
return Dates.format(date, format);
});
Handlebars.registerHelper('now', function(format) {
var date;
date = new Date();
if (Utils.isUndefin... | CoffeeScript | JavaScript | elving/swag | src/swag.dates.coffee | MIT | 163af3a070eefe79a32c8239884929e0cae1f589 | 675 | https://github.com/elving/swag/blob/163af3a070eefe79a32c8239884929e0cae1f589/src/swag.dates.coffee | 84 | 113 |
elving/swag:src/swag.dates.coffee:8:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
// Port of formatDate-js library - https://github.com/michaelbaldry/formatDate-js
Handlebars.registerHelper('formatDate', function(date, format) {
date = new Date(date);
return Dates.format(date, format);
});
Handlebars.registerHelper('now', function(format) {... | # Port of formatDate-js library - https://github.com/michaelbaldry/formatDate-js
Handlebars.registerHelper 'formatDate', (date, format) ->
date = new Date date
Dates.format date, format
Handlebars.registerHelper 'now', (format) ->
date = new Date()
if Utils.isUndefined(format) then date else Dates.form... | JavaScript | CoffeeScript | elving/swag | src/swag.dates.coffee | MIT | 163af3a070eefe79a32c8239884929e0cae1f589 | 675 | https://github.com/elving/swag/blob/163af3a070eefe79a32c8239884929e0cae1f589/src/swag.dates.coffee | 84 | 113 |
elving/swag:src/swag.dates.coffee:8:completion | completion | # Port of formatDate-js library - https://github.com/michaelbaldry/formatDate-js
Handlebars.registerHelper 'formatDate', (date, format) ->
date = new Date date
Dates.format date, format
Handlebars.registerHelper 'now', (format) ->
date = new Date()
if Utils.isUndefined(format) then date else Dates.form... | return "#{interval} years ago" if interval > 1
interval = Math.floor(seconds / 2592000)
return if interval > 1 then "#{interval} months ago"
interval = Math.floor(seconds / 86400)
return if interval > 1 then "#{interval} days ago"
interval = Math.floor(seconds / 3600)
return if interval > 1 t... | CoffeeScript | CoffeeScript | elving/swag | src/swag.dates.coffee | MIT | 163af3a070eefe79a32c8239884929e0cae1f589 | 675 | https://github.com/elving/swag/blob/163af3a070eefe79a32c8239884929e0cae1f589/src/swag.dates.coffee | 84 | 113 |
jianliaoim/talk-os:talk-web/client/handlers/activities.coffee:1:raw_corpus | raw_corpus | recorder = require 'actions-recorder'
exports.create = (activity) ->
recorder.dispatch 'activities/create', activity
exports.remove = (activity) ->
recorder.dispatch 'activities/remove', activity
exports.update = (activity) ->
recorder.dispatch 'activities/update', activity | CoffeeScript | jianliaoim/talk-os | talk-web/client/handlers/activities.coffee | MIT | 2545c4497865779a55762e03963a39237df9046b | 2,703 | https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-web/client/handlers/activities.coffee | 1 | 10 | ||
jianliaoim/talk-os:talk-web/client/handlers/activities.coffee:1:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
recorder = require 'actions-recorder'
exports.create = (activity) ->
recorder.dispatch 'activities/create', activity
exports.remove = (activity) ->
recorder.dispatch 'activities/remove', activity
exports.update = (activity) ->
recorder.dispatch 'activiti... | var recorder;
recorder = require('actions-recorder');
exports.create = function(activity) {
return recorder.dispatch('activities/create', activity);
};
exports.remove = function(activity) {
return recorder.dispatch('activities/remove', activity);
};
exports.update = function(activity) {
return recorder.dispat... | CoffeeScript | JavaScript | jianliaoim/talk-os | talk-web/client/handlers/activities.coffee | MIT | 2545c4497865779a55762e03963a39237df9046b | 2,703 | https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-web/client/handlers/activities.coffee | 1 | 10 |
jianliaoim/talk-os:talk-web/client/handlers/activities.coffee:1:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
var recorder;
recorder = require('actions-recorder');
exports.create = function(activity) {
return recorder.dispatch('activities/create', activity);
};
exports.remove = function(activity) {
return recorder.dispatch('activities/remove', activity);
};
exports... | recorder = require 'actions-recorder'
exports.create = (activity) ->
recorder.dispatch 'activities/create', activity
exports.remove = (activity) ->
recorder.dispatch 'activities/remove', activity
exports.update = (activity) ->
recorder.dispatch 'activities/update', activity | JavaScript | CoffeeScript | jianliaoim/talk-os | talk-web/client/handlers/activities.coffee | MIT | 2545c4497865779a55762e03963a39237df9046b | 2,703 | https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-web/client/handlers/activities.coffee | 1 | 10 |
jianliaoim/talk-os:talk-web/client/handlers/activities.coffee:1:completion | completion | recorder = require 'actions-recorder'
exports.create = (activity) ->
recorder.dispatch 'activities/create', activity | exports.remove = (activity) ->
recorder.dispatch 'activities/remove', activity
exports.update = (activity) ->
recorder.dispatch 'activities/update', activity | CoffeeScript | CoffeeScript | jianliaoim/talk-os | talk-web/client/handlers/activities.coffee | MIT | 2545c4497865779a55762e03963a39237df9046b | 2,703 | https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-web/client/handlers/activities.coffee | 1 | 10 |
jianliaoim/talk-os:talk-web/client/app/topic-menu.coffee:2:raw_corpus | raw_corpus | module.exports = React.createClass
displayName: 'topic-menu'
mixins: [PureRenderMixin]
propTypes:
topics: T.instanceOf(Immutable.List)
onSelect: T.func.isRequired
_teamId: T.string.isRequired
getInitialState: ->
index: 0
componentWillReceiveProps: (props) ->
if props.topics.size isnt @... | CoffeeScript | jianliaoim/talk-os | talk-web/client/app/topic-menu.coffee | MIT | 2545c4497865779a55762e03963a39237df9046b | 2,703 | https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-web/client/app/topic-menu.coffee | 24 | 73 | ||
jianliaoim/talk-os:talk-web/client/app/topic-menu.coffee:2:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
module.exports = React.createClass
displayName: 'topic-menu'
mixins: [PureRenderMixin]
propTypes:
topics: T.instanceOf(Immutable.List)
onSelect: T.func.isRequired
_teamId: T.string.isRequired
getInitialState: ->
index: 0
componentWil... | module.exports = React.createClass({
displayName: 'topic-menu',
mixins: [PureRenderMixin],
propTypes: {
topics: T.instanceOf(Immutable.List),
onSelect: T.func.isRequired,
_teamId: T.string.isRequired
},
getInitialState: function() {
return {
index: 0
};
},
componentWillReceivePro... | CoffeeScript | JavaScript | jianliaoim/talk-os | talk-web/client/app/topic-menu.coffee | MIT | 2545c4497865779a55762e03963a39237df9046b | 2,703 | https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-web/client/app/topic-menu.coffee | 24 | 73 |
jianliaoim/talk-os:talk-web/client/app/topic-menu.coffee:2:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
module.exports = React.createClass({
displayName: 'topic-menu',
mixins: [PureRenderMixin],
propTypes: {
topics: T.instanceOf(Immutable.List),
onSelect: T.func.isRequired,
_teamId: T.string.isRequired
},
getInitialState: function() {
return... | module.exports = React.createClass
displayName: 'topic-menu'
mixins: [PureRenderMixin]
propTypes:
topics: T.instanceOf(Immutable.List)
onSelect: T.func.isRequired
_teamId: T.string.isRequired
getInitialState: ->
index: 0
componentWillReceiveProps: (props) ->
if props.topics.size isnt @... | JavaScript | CoffeeScript | jianliaoim/talk-os | talk-web/client/app/topic-menu.coffee | MIT | 2545c4497865779a55762e03963a39237df9046b | 2,703 | https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-web/client/app/topic-menu.coffee | 24 | 73 |
jianliaoim/talk-os:talk-web/client/app/topic-menu.coffee:2:completion | completion | module.exports = React.createClass
displayName: 'topic-menu'
mixins: [PureRenderMixin]
propTypes:
topics: T.instanceOf(Immutable.List)
onSelect: T.func.isRequired
_teamId: T.string.isRequired
getInitialState: ->
index: 0
componentWillReceiveProps: (props) ->
if props.topics.size isnt @... | componentDidUpdate: ->
root = @refs.root
@debouncedUpdateScroll(root)
updateScroll: (root) ->
eachHeight = 36
totalHeight = eachHeight * 8
startY = eachHeight * @state.index
endY = startY + eachHeight
top = root.scrollTop
if (startY < top) or (endY > top + totalHeight)
y = star... | CoffeeScript | CoffeeScript | jianliaoim/talk-os | talk-web/client/app/topic-menu.coffee | MIT | 2545c4497865779a55762e03963a39237df9046b | 2,703 | https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-web/client/app/topic-menu.coffee | 24 | 73 |
jianliaoim/talk-os:talk-web/client/app/topic-menu.coffee:3:raw_corpus | raw_corpus | getLength: ->
@getTopics().size
moveSelectUp: ->
if @state.index is 0
@setState index: limit80(@getLength()) - 1
else
@setState index: (@state.index - 1)
moveSelectDown: ->
if (@state.index + 1) >= limit80(@getLength())
@setState index: 0
else
@setState index: (@state.i... | CoffeeScript | jianliaoim/talk-os | talk-web/client/app/topic-menu.coffee | MIT | 2545c4497865779a55762e03963a39237df9046b | 2,703 | https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-web/client/app/topic-menu.coffee | 74 | 123 | ||
jianliaoim/talk-os:talk-web/client/app/topic-menu.coffee:3:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
getLength: ->
@getTopics().size
moveSelectUp: ->
if @state.index is 0
@setState index: limit80(@getLength()) - 1
else
@setState index: (@state.index - 1)
moveSelectDown: ->
if (@state.index + 1) >= limit80(@getLength())
@se... | ({
getLength: function() {
return this.getTopics().size;
},
moveSelectUp: function() {
if (this.state.index === 0) {
return this.setState({
index: limit80(this.getLength()) - 1
});
} else {
return this.setState({
index: this.state.index - 1
});
}
},
move... | CoffeeScript | JavaScript | jianliaoim/talk-os | talk-web/client/app/topic-menu.coffee | MIT | 2545c4497865779a55762e03963a39237df9046b | 2,703 | https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-web/client/app/topic-menu.coffee | 74 | 123 |
jianliaoim/talk-os:talk-web/client/app/topic-menu.coffee:3:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
({
getLength: function() {
return this.getTopics().size;
},
moveSelectUp: function() {
if (this.state.index === 0) {
return this.setState({
index: limit80(this.getLength()) - 1
});
} else {
return this.setState({
... | getLength: ->
@getTopics().size
moveSelectUp: ->
if @state.index is 0
@setState index: limit80(@getLength()) - 1
else
@setState index: (@state.index - 1)
moveSelectDown: ->
if (@state.index + 1) >= limit80(@getLength())
@setState index: 0
else
@setState index: (@state.i... | JavaScript | CoffeeScript | jianliaoim/talk-os | talk-web/client/app/topic-menu.coffee | MIT | 2545c4497865779a55762e03963a39237df9046b | 2,703 | https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-web/client/app/topic-menu.coffee | 74 | 123 |
jianliaoim/talk-os:talk-web/client/app/topic-menu.coffee:3:completion | completion | getLength: ->
@getTopics().size
moveSelectUp: ->
if @state.index is 0
@setState index: limit80(@getLength()) - 1
else
@setState index: (@state.index - 1)
moveSelectDown: ->
if (@state.index + 1) >= limit80(@getLength())
@setState index: 0
else
@setState index: (@state.i... | switch event.keyCode
when keyboard.up then @moveSelectUp()
when keyboard.down then @moveSelectDown()
when keyboard.enter then @selectCurrent()
when keyboard.tab then @selectCurrent()
onSelect: (index) ->
@setState {index}
renderTopics: ->
@getTopics()
.map (topic, index) =>
... | CoffeeScript | CoffeeScript | jianliaoim/talk-os | talk-web/client/app/topic-menu.coffee | MIT | 2545c4497865779a55762e03963a39237df9046b | 2,703 | https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-web/client/app/topic-menu.coffee | 74 | 123 |
octoblu/meshblu:lib/MessageIORedisEmitter.coffee:1:raw_corpus | raw_corpus | _ = require 'lodash'
config = require '../config'
redis = require './redis'
debug = require('debug')('meshblu:message-io-emitter')
class MessageIOEmitter
constructor: (dependencies={}) ->
@emitters = []
addEmitter: (emitter) =>
@emitters.push emitter
emit: (channel, topic, data) =>
_.each @emitters... | CoffeeScript | octoblu/meshblu | lib/MessageIORedisEmitter.coffee | MIT | 1302cf052169ca93119561b2e7e3304f3f81bad1 | 815 | https://github.com/octoblu/meshblu/blob/1302cf052169ca93119561b2e7e3304f3f81bad1/lib/MessageIORedisEmitter.coffee | 1 | 18 | ||
octoblu/meshblu:lib/MessageIORedisEmitter.coffee:1:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
_ = require 'lodash'
config = require '../config'
redis = require './redis'
debug = require('debug')('meshblu:message-io-emitter')
class MessageIOEmitter
constructor: (dependencies={}) ->
@emitters = []
addEmitter: (emitter) =>
@emitters.push emitte... | var MessageIOEmitter, _, config, debug, redis;
_ = require('lodash');
config = require('../config');
redis = require('./redis');
debug = require('debug')('meshblu:message-io-emitter');
MessageIOEmitter = class MessageIOEmitter {
constructor(dependencies = {}) {
this.addEmitter = this.addEmitter.bind(this);
... | CoffeeScript | JavaScript | octoblu/meshblu | lib/MessageIORedisEmitter.coffee | MIT | 1302cf052169ca93119561b2e7e3304f3f81bad1 | 815 | https://github.com/octoblu/meshblu/blob/1302cf052169ca93119561b2e7e3304f3f81bad1/lib/MessageIORedisEmitter.coffee | 1 | 18 |
octoblu/meshblu:lib/MessageIORedisEmitter.coffee:1:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
var MessageIOEmitter, _, config, debug, redis;
_ = require('lodash');
config = require('../config');
redis = require('./redis');
debug = require('debug')('meshblu:message-io-emitter');
MessageIOEmitter = class MessageIOEmitter {
constructor(dependencies = {}... | _ = require 'lodash'
config = require '../config'
redis = require './redis'
debug = require('debug')('meshblu:message-io-emitter')
class MessageIOEmitter
constructor: (dependencies={}) ->
@emitters = []
addEmitter: (emitter) =>
@emitters.push emitter
emit: (channel, topic, data) =>
_.each @emitters... | JavaScript | CoffeeScript | octoblu/meshblu | lib/MessageIORedisEmitter.coffee | MIT | 1302cf052169ca93119561b2e7e3304f3f81bad1 | 815 | https://github.com/octoblu/meshblu/blob/1302cf052169ca93119561b2e7e3304f3f81bad1/lib/MessageIORedisEmitter.coffee | 1 | 18 |
octoblu/meshblu:lib/MessageIORedisEmitter.coffee:1:completion | completion | _ = require 'lodash'
config = require '../config'
redis = require './redis'
debug = require('debug')('meshblu:message-io-emitter')
class MessageIOEmitter
constructor: (dependencies={}) ->
@emitters = [] | addEmitter: (emitter) =>
@emitters.push emitter
emit: (channel, topic, data) =>
_.each @emitters, (emitter) ->
debug 'emit', channel, topic, data
emitter.in(channel).emit(topic, data)
module.exports = MessageIOEmitter | CoffeeScript | CoffeeScript | octoblu/meshblu | lib/MessageIORedisEmitter.coffee | MIT | 1302cf052169ca93119561b2e7e3304f3f81bad1 | 815 | https://github.com/octoblu/meshblu/blob/1302cf052169ca93119561b2e7e3304f3f81bad1/lib/MessageIORedisEmitter.coffee | 1 | 18 |
oozcitak/xmlbuilder-js:src/XMLDTDAttList.coffee:1:raw_corpus | raw_corpus | XMLNode = require './XMLNode'
NodeType = require './NodeType'
# Represents an attribute list
module.exports = class XMLDTDAttList extends XMLNode
# Initializes a new instance of `XMLDTDAttList`
#
# `parent` the parent `XMLDocType` element
# `elementName` the name of the element containing this attribute
# ... | CoffeeScript | oozcitak/xmlbuilder-js | src/XMLDTDAttList.coffee | MIT | ce625aeb9f52d1f75d5d94260794d3b5fd74a8b1 | 926 | https://github.com/oozcitak/xmlbuilder-js/blob/ce625aeb9f52d1f75d5d94260794d3b5fd74a8b1/src/XMLDTDAttList.coffee | 1 | 50 | ||
oozcitak/xmlbuilder-js:src/XMLDTDAttList.coffee:1:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
XMLNode = require './XMLNode'
NodeType = require './NodeType'
# Represents an attribute list
module.exports = class XMLDTDAttList extends XMLNode
# Initializes a new instance of `XMLDTDAttList`
#
# `parent` the parent `XMLDocType` element
# `elementNam... | var NodeType, XMLDTDAttList, XMLNode;
XMLNode = require('./XMLNode');
NodeType = require('./NodeType');
// Represents an attribute list
module.exports = XMLDTDAttList = class XMLDTDAttList extends XMLNode {
// Initializes a new instance of `XMLDTDAttList`
// `parent` the parent `XMLDocType` element
// `elemen... | CoffeeScript | JavaScript | oozcitak/xmlbuilder-js | src/XMLDTDAttList.coffee | MIT | ce625aeb9f52d1f75d5d94260794d3b5fd74a8b1 | 926 | https://github.com/oozcitak/xmlbuilder-js/blob/ce625aeb9f52d1f75d5d94260794d3b5fd74a8b1/src/XMLDTDAttList.coffee | 1 | 50 |
oozcitak/xmlbuilder-js:src/XMLDTDAttList.coffee:1:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
var NodeType, XMLDTDAttList, XMLNode;
XMLNode = require('./XMLNode');
NodeType = require('./NodeType');
// Represents an attribute list
module.exports = XMLDTDAttList = class XMLDTDAttList extends XMLNode {
// Initializes a new instance of `XMLDTDAttList`
/... | XMLNode = require './XMLNode'
NodeType = require './NodeType'
# Represents an attribute list
module.exports = class XMLDTDAttList extends XMLNode
# Initializes a new instance of `XMLDTDAttList`
#
# `parent` the parent `XMLDocType` element
# `elementName` the name of the element containing this attribute
# ... | JavaScript | CoffeeScript | oozcitak/xmlbuilder-js | src/XMLDTDAttList.coffee | MIT | ce625aeb9f52d1f75d5d94260794d3b5fd74a8b1 | 926 | https://github.com/oozcitak/xmlbuilder-js/blob/ce625aeb9f52d1f75d5d94260794d3b5fd74a8b1/src/XMLDTDAttList.coffee | 1 | 50 |
oozcitak/xmlbuilder-js:src/XMLDTDAttList.coffee:1:completion | completion | XMLNode = require './XMLNode'
NodeType = require './NodeType'
# Represents an attribute list
module.exports = class XMLDTDAttList extends XMLNode
# Initializes a new instance of `XMLDTDAttList`
#
# `parent` the parent `XMLDocType` element
# `elementName` the name of the element containing this attribute
# ... | throw new Error "Missing DTD attribute type. " + @debugInfo(elementName)
if not defaultValueType
throw new Error "Missing DTD attribute default. " + @debugInfo(elementName)
if defaultValueType.indexOf('#') != 0
defaultValueType = '#' + defaultValueType
if not defaultValueType.match /^(#REQUIRED|... | CoffeeScript | CoffeeScript | oozcitak/xmlbuilder-js | src/XMLDTDAttList.coffee | MIT | ce625aeb9f52d1f75d5d94260794d3b5fd74a8b1 | 926 | https://github.com/oozcitak/xmlbuilder-js/blob/ce625aeb9f52d1f75d5d94260794d3b5fd74a8b1/src/XMLDTDAttList.coffee | 1 | 50 |
oozcitak/xmlbuilder-js:src/XMLDTDAttList.coffee:1:raw_corpus | raw_corpus | XMLNode = require './XMLNode'
NodeType = require './NodeType'
# Represents an attribute list
module.exports = class XMLDTDAttList extends XMLNode
# Initializes a new instance of `XMLDTDAttList`
#
# `parent` the parent `XMLDocType` element
# `elementName` the name of the element containing this attribute
# ... | CoffeeScript | oozcitak/xmlbuilder-js | src/XMLDTDAttList.coffee | MIT | d8de14769590b262e56b467df05db50855a0ad24 | 926 | https://github.com/oozcitak/xmlbuilder-js/blob/d8de14769590b262e56b467df05db50855a0ad24/src/XMLDTDAttList.coffee | 1 | 50 | ||
oozcitak/xmlbuilder-js:src/XMLDTDAttList.coffee:1:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
XMLNode = require './XMLNode'
NodeType = require './NodeType'
# Represents an attribute list
module.exports = class XMLDTDAttList extends XMLNode
# Initializes a new instance of `XMLDTDAttList`
#
# `parent` the parent `XMLDocType` element
# `elementNam... | var NodeType, XMLDTDAttList, XMLNode;
XMLNode = require('./XMLNode');
NodeType = require('./NodeType');
// Represents an attribute list
module.exports = XMLDTDAttList = class XMLDTDAttList extends XMLNode {
// Initializes a new instance of `XMLDTDAttList`
// `parent` the parent `XMLDocType` element
// `elemen... | CoffeeScript | JavaScript | oozcitak/xmlbuilder-js | src/XMLDTDAttList.coffee | MIT | d8de14769590b262e56b467df05db50855a0ad24 | 926 | https://github.com/oozcitak/xmlbuilder-js/blob/d8de14769590b262e56b467df05db50855a0ad24/src/XMLDTDAttList.coffee | 1 | 50 |
oozcitak/xmlbuilder-js:src/XMLDTDAttList.coffee:1:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
var NodeType, XMLDTDAttList, XMLNode;
XMLNode = require('./XMLNode');
NodeType = require('./NodeType');
// Represents an attribute list
module.exports = XMLDTDAttList = class XMLDTDAttList extends XMLNode {
// Initializes a new instance of `XMLDTDAttList`
/... | XMLNode = require './XMLNode'
NodeType = require './NodeType'
# Represents an attribute list
module.exports = class XMLDTDAttList extends XMLNode
# Initializes a new instance of `XMLDTDAttList`
#
# `parent` the parent `XMLDocType` element
# `elementName` the name of the element containing this attribute
# ... | JavaScript | CoffeeScript | oozcitak/xmlbuilder-js | src/XMLDTDAttList.coffee | MIT | d8de14769590b262e56b467df05db50855a0ad24 | 926 | https://github.com/oozcitak/xmlbuilder-js/blob/d8de14769590b262e56b467df05db50855a0ad24/src/XMLDTDAttList.coffee | 1 | 50 |
oozcitak/xmlbuilder-js:src/XMLDTDAttList.coffee:1:completion | completion | XMLNode = require './XMLNode'
NodeType = require './NodeType'
# Represents an attribute list
module.exports = class XMLDTDAttList extends XMLNode
# Initializes a new instance of `XMLDTDAttList`
#
# `parent` the parent `XMLDocType` element
# `elementName` the name of the element containing this attribute
# ... | throw new Error "Missing DTD attribute type. " + @debugInfo(elementName)
if not defaultValueType
throw new Error "Missing DTD attribute default. " + @debugInfo(elementName)
if defaultValueType.indexOf('#') != 0
defaultValueType = '#' + defaultValueType
if not defaultValueType.match /^(#REQUIRED|... | CoffeeScript | CoffeeScript | oozcitak/xmlbuilder-js | src/XMLDTDAttList.coffee | MIT | d8de14769590b262e56b467df05db50855a0ad24 | 926 | https://github.com/oozcitak/xmlbuilder-js/blob/d8de14769590b262e56b467df05db50855a0ad24/src/XMLDTDAttList.coffee | 1 | 50 |
oozcitak/xmlbuilder-js:src/XMLDTDAttList.coffee:1:raw_corpus | raw_corpus | XMLNode = require './XMLNode'
# Represents an attribute list
module.exports = class XMLDTDAttList extends XMLNode
# Initializes a new instance of `XMLDTDAttList`
#
# `parent` the parent `XMLDocType` element
# `elementName` the name of the element containing this attribute
# `attributeName` attribute name
... | CoffeeScript | oozcitak/xmlbuilder-js | src/XMLDTDAttList.coffee | MIT | b38e655b1c8b3f940de5f764029d4cb6c4bc5d9e | 926 | https://github.com/oozcitak/xmlbuilder-js/blob/b38e655b1c8b3f940de5f764029d4cb6c4bc5d9e/src/XMLDTDAttList.coffee | 1 | 49 | ||
oozcitak/xmlbuilder-js:src/XMLDTDAttList.coffee:1:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
XMLNode = require './XMLNode'
# Represents an attribute list
module.exports = class XMLDTDAttList extends XMLNode
# Initializes a new instance of `XMLDTDAttList`
#
# `parent` the parent `XMLDocType` element
# `elementName` the name of the element conta... | var XMLDTDAttList, XMLNode;
XMLNode = require('./XMLNode');
// Represents an attribute list
module.exports = XMLDTDAttList = class XMLDTDAttList extends XMLNode {
// Initializes a new instance of `XMLDTDAttList`
// `parent` the parent `XMLDocType` element
// `elementName` the name of the element containing thi... | CoffeeScript | JavaScript | oozcitak/xmlbuilder-js | src/XMLDTDAttList.coffee | MIT | b38e655b1c8b3f940de5f764029d4cb6c4bc5d9e | 926 | https://github.com/oozcitak/xmlbuilder-js/blob/b38e655b1c8b3f940de5f764029d4cb6c4bc5d9e/src/XMLDTDAttList.coffee | 1 | 49 |
oozcitak/xmlbuilder-js:src/XMLDTDAttList.coffee:1:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
var XMLDTDAttList, XMLNode;
XMLNode = require('./XMLNode');
// Represents an attribute list
module.exports = XMLDTDAttList = class XMLDTDAttList extends XMLNode {
// Initializes a new instance of `XMLDTDAttList`
// `parent` the parent `XMLDocType` element
... | XMLNode = require './XMLNode'
# Represents an attribute list
module.exports = class XMLDTDAttList extends XMLNode
# Initializes a new instance of `XMLDTDAttList`
#
# `parent` the parent `XMLDocType` element
# `elementName` the name of the element containing this attribute
# `attributeName` attribute name
... | JavaScript | CoffeeScript | oozcitak/xmlbuilder-js | src/XMLDTDAttList.coffee | MIT | b38e655b1c8b3f940de5f764029d4cb6c4bc5d9e | 926 | https://github.com/oozcitak/xmlbuilder-js/blob/b38e655b1c8b3f940de5f764029d4cb6c4bc5d9e/src/XMLDTDAttList.coffee | 1 | 49 |
oozcitak/xmlbuilder-js:src/XMLDTDAttList.coffee:1:completion | completion | XMLNode = require './XMLNode'
# Represents an attribute list
module.exports = class XMLDTDAttList extends XMLNode
# Initializes a new instance of `XMLDTDAttList`
#
# `parent` the parent `XMLDocType` element
# `elementName` the name of the element containing this attribute
# `attributeName` attribute name
... | throw new Error "Missing DTD attribute type. " + @debugInfo(elementName)
if not defaultValueType
throw new Error "Missing DTD attribute default. " + @debugInfo(elementName)
if defaultValueType.indexOf('#') != 0
defaultValueType = '#' + defaultValueType
if not defaultValueType.match /^(#REQUIRED|... | CoffeeScript | CoffeeScript | oozcitak/xmlbuilder-js | src/XMLDTDAttList.coffee | MIT | b38e655b1c8b3f940de5f764029d4cb6c4bc5d9e | 926 | https://github.com/oozcitak/xmlbuilder-js/blob/b38e655b1c8b3f940de5f764029d4cb6c4bc5d9e/src/XMLDTDAttList.coffee | 1 | 49 |
oozcitak/xmlbuilder-js:src/XMLDTDAttList.coffee:1:raw_corpus | raw_corpus | XMLNode = require './XMLNode'
# Represents an attribute list
module.exports = class XMLDTDAttList extends XMLNode
# Initializes a new instance of `XMLDTDAttList`
#
# `parent` the parent `XMLDocType` element
# `elementName` the name of the element containing this attribute
# `attributeName` attribute name
... | CoffeeScript | oozcitak/xmlbuilder-js | src/XMLDTDAttList.coffee | MIT | b6c2503daa774b02579fb8c98c31877ea24861a1 | 926 | https://github.com/oozcitak/xmlbuilder-js/blob/b6c2503daa774b02579fb8c98c31877ea24861a1/src/XMLDTDAttList.coffee | 1 | 49 | ||
oozcitak/xmlbuilder-js:src/XMLDTDAttList.coffee:1:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
XMLNode = require './XMLNode'
# Represents an attribute list
module.exports = class XMLDTDAttList extends XMLNode
# Initializes a new instance of `XMLDTDAttList`
#
# `parent` the parent `XMLDocType` element
# `elementName` the name of the element conta... | var XMLDTDAttList, XMLNode;
XMLNode = require('./XMLNode');
// Represents an attribute list
module.exports = XMLDTDAttList = class XMLDTDAttList extends XMLNode {
// Initializes a new instance of `XMLDTDAttList`
// `parent` the parent `XMLDocType` element
// `elementName` the name of the element containing thi... | CoffeeScript | JavaScript | oozcitak/xmlbuilder-js | src/XMLDTDAttList.coffee | MIT | b6c2503daa774b02579fb8c98c31877ea24861a1 | 926 | https://github.com/oozcitak/xmlbuilder-js/blob/b6c2503daa774b02579fb8c98c31877ea24861a1/src/XMLDTDAttList.coffee | 1 | 49 |
oozcitak/xmlbuilder-js:src/XMLDTDAttList.coffee:1:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
var XMLDTDAttList, XMLNode;
XMLNode = require('./XMLNode');
// Represents an attribute list
module.exports = XMLDTDAttList = class XMLDTDAttList extends XMLNode {
// Initializes a new instance of `XMLDTDAttList`
// `parent` the parent `XMLDocType` element
... | XMLNode = require './XMLNode'
# Represents an attribute list
module.exports = class XMLDTDAttList extends XMLNode
# Initializes a new instance of `XMLDTDAttList`
#
# `parent` the parent `XMLDocType` element
# `elementName` the name of the element containing this attribute
# `attributeName` attribute name
... | JavaScript | CoffeeScript | oozcitak/xmlbuilder-js | src/XMLDTDAttList.coffee | MIT | b6c2503daa774b02579fb8c98c31877ea24861a1 | 926 | https://github.com/oozcitak/xmlbuilder-js/blob/b6c2503daa774b02579fb8c98c31877ea24861a1/src/XMLDTDAttList.coffee | 1 | 49 |
oozcitak/xmlbuilder-js:src/XMLDTDAttList.coffee:1:completion | completion | XMLNode = require './XMLNode'
# Represents an attribute list
module.exports = class XMLDTDAttList extends XMLNode
# Initializes a new instance of `XMLDTDAttList`
#
# `parent` the parent `XMLDocType` element
# `elementName` the name of the element containing this attribute
# `attributeName` attribute name
... | throw new Error "Missing DTD attribute type. " + @debugInfo(elementName)
if not defaultValueType
throw new Error "Missing DTD attribute default. " + @debugInfo(elementName)
if defaultValueType.indexOf('#') != 0
defaultValueType = '#' + defaultValueType
if not defaultValueType.match /^(#REQUIRED|... | CoffeeScript | CoffeeScript | oozcitak/xmlbuilder-js | src/XMLDTDAttList.coffee | MIT | b6c2503daa774b02579fb8c98c31877ea24861a1 | 926 | https://github.com/oozcitak/xmlbuilder-js/blob/b6c2503daa774b02579fb8c98c31877ea24861a1/src/XMLDTDAttList.coffee | 1 | 49 |
oozcitak/xmlbuilder-js:src/XMLDTDAttList.coffee:1:raw_corpus | raw_corpus | XMLNode = require './XMLNode'
# Represents an attribute list
module.exports = class XMLDTDAttList extends XMLNode
# Initializes a new instance of `XMLDTDAttList`
#
# `parent` the parent `XMLDocType` element
# `elementName` the name of the element containing this attribute
# `attributeName` attribute name
... | CoffeeScript | oozcitak/xmlbuilder-js | src/XMLDTDAttList.coffee | MIT | f066a3151d269e738ea37d87e5bf2470ef948b24 | 926 | https://github.com/oozcitak/xmlbuilder-js/blob/f066a3151d269e738ea37d87e5bf2470ef948b24/src/XMLDTDAttList.coffee | 1 | 49 | ||
oozcitak/xmlbuilder-js:src/XMLDTDAttList.coffee:1:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
XMLNode = require './XMLNode'
# Represents an attribute list
module.exports = class XMLDTDAttList extends XMLNode
# Initializes a new instance of `XMLDTDAttList`
#
# `parent` the parent `XMLDocType` element
# `elementName` the name of the element conta... | var XMLDTDAttList, XMLNode;
XMLNode = require('./XMLNode');
// Represents an attribute list
module.exports = XMLDTDAttList = class XMLDTDAttList extends XMLNode {
// Initializes a new instance of `XMLDTDAttList`
// `parent` the parent `XMLDocType` element
// `elementName` the name of the element containing thi... | CoffeeScript | JavaScript | oozcitak/xmlbuilder-js | src/XMLDTDAttList.coffee | MIT | f066a3151d269e738ea37d87e5bf2470ef948b24 | 926 | https://github.com/oozcitak/xmlbuilder-js/blob/f066a3151d269e738ea37d87e5bf2470ef948b24/src/XMLDTDAttList.coffee | 1 | 49 |
oozcitak/xmlbuilder-js:src/XMLDTDAttList.coffee:1:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
var XMLDTDAttList, XMLNode;
XMLNode = require('./XMLNode');
// Represents an attribute list
module.exports = XMLDTDAttList = class XMLDTDAttList extends XMLNode {
// Initializes a new instance of `XMLDTDAttList`
// `parent` the parent `XMLDocType` element
... | XMLNode = require './XMLNode'
# Represents an attribute list
module.exports = class XMLDTDAttList extends XMLNode
# Initializes a new instance of `XMLDTDAttList`
#
# `parent` the parent `XMLDocType` element
# `elementName` the name of the element containing this attribute
# `attributeName` attribute name
... | JavaScript | CoffeeScript | oozcitak/xmlbuilder-js | src/XMLDTDAttList.coffee | MIT | f066a3151d269e738ea37d87e5bf2470ef948b24 | 926 | https://github.com/oozcitak/xmlbuilder-js/blob/f066a3151d269e738ea37d87e5bf2470ef948b24/src/XMLDTDAttList.coffee | 1 | 49 |
oozcitak/xmlbuilder-js:src/XMLDTDAttList.coffee:1:completion | completion | XMLNode = require './XMLNode'
# Represents an attribute list
module.exports = class XMLDTDAttList extends XMLNode
# Initializes a new instance of `XMLDTDAttList`
#
# `parent` the parent `XMLDocType` element
# `elementName` the name of the element containing this attribute
# `attributeName` attribute name
... | throw new Error "Missing DTD attribute type. " + @debugInfo(elementName)
if not defaultValueType
throw new Error "Missing DTD attribute default. " + @debugInfo(elementName)
if defaultValueType.indexOf('#') != 0
defaultValueType = '#' + defaultValueType
if not defaultValueType.match /^(#REQUIRED|... | CoffeeScript | CoffeeScript | oozcitak/xmlbuilder-js | src/XMLDTDAttList.coffee | MIT | f066a3151d269e738ea37d87e5bf2470ef948b24 | 926 | https://github.com/oozcitak/xmlbuilder-js/blob/f066a3151d269e738ea37d87e5bf2470ef948b24/src/XMLDTDAttList.coffee | 1 | 49 |
jianliaoim/talk-os:talk-account/server/apis/user.coffee:1:raw_corpus | raw_corpus | Promise = require 'bluebird'
app = require '../server'
limbo = require 'limbo'
{
UserModel
MobileModel
EmailModel
UnionModel
} = limbo.use 'account'
module.exports = userController = app.controller 'user', ->
@mixin require './mixins/auth'
@before 'verifyAccount', only: 'get accounts'
@before 'appen... | CoffeeScript | jianliaoim/talk-os | talk-account/server/apis/user.coffee | MIT | 2545c4497865779a55762e03963a39237df9046b | 2,703 | https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-account/server/apis/user.coffee | 1 | 50 | ||
jianliaoim/talk-os:talk-account/server/apis/user.coffee:1:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
Promise = require 'bluebird'
app = require '../server'
limbo = require 'limbo'
{
UserModel
MobileModel
EmailModel
UnionModel
} = limbo.use 'account'
module.exports = userController = app.controller 'user', ->
@mixin require './mixins/auth'
@befo... | var EmailModel, MobileModel, Promise, UnionModel, UserModel, app, limbo, userController;
Promise = require('bluebird');
app = require('../server');
limbo = require('limbo');
({UserModel, MobileModel, EmailModel, UnionModel} = limbo.use('account'));
module.exports = userController = app.controller('user', function(... | CoffeeScript | JavaScript | jianliaoim/talk-os | talk-account/server/apis/user.coffee | MIT | 2545c4497865779a55762e03963a39237df9046b | 2,703 | https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-account/server/apis/user.coffee | 1 | 50 |
jianliaoim/talk-os:talk-account/server/apis/user.coffee:1:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
var EmailModel, MobileModel, Promise, UnionModel, UserModel, app, limbo, userController;
Promise = require('bluebird');
app = require('../server');
limbo = require('limbo');
({UserModel, MobileModel, EmailModel, UnionModel} = limbo.use('account'));
module.expo... | Promise = require 'bluebird'
app = require '../server'
limbo = require 'limbo'
{
UserModel
MobileModel
EmailModel
UnionModel
} = limbo.use 'account'
module.exports = userController = app.controller 'user', ->
@mixin require './mixins/auth'
@before 'verifyAccount', only: 'get accounts'
@before 'appen... | JavaScript | CoffeeScript | jianliaoim/talk-os | talk-account/server/apis/user.coffee | MIT | 2545c4497865779a55762e03963a39237df9046b | 2,703 | https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-account/server/apis/user.coffee | 1 | 50 |
jianliaoim/talk-os:talk-account/server/apis/user.coffee:1:completion | completion | Promise = require 'bluebird'
app = require '../server'
limbo = require 'limbo'
{
UserModel
MobileModel
EmailModel
UnionModel
} = limbo.use 'account'
module.exports = userController = app.controller 'user', ->
@mixin require './mixins/auth'
@before 'verifyAccount', only: 'get accounts'
@before 'appen... | callback null, req.get('user')
###*
* 获取所有绑定账号
* @return {Array} 绑定的账号和类型
###
@action 'accounts', (req, res, callback) ->
{user} = req.get()
$mobile = MobileModel.findOneAsync user: user._id
$email = EmailModel.findOneAsync user: user._id
$unions = UnionModel.find user: user._id
$ac... | CoffeeScript | CoffeeScript | jianliaoim/talk-os | talk-account/server/apis/user.coffee | MIT | 2545c4497865779a55762e03963a39237df9046b | 2,703 | https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-account/server/apis/user.coffee | 1 | 50 |
Pagedraw/pagedraw:html-importer/selenium_importer/page-importer.coffee:1:raw_corpus | raw_corpus | window.importPage = () ->
doc = {}
# utils
numOfPx = (str) ->
if str? == false or not _.endsWith(str, 'px')
console.log("failed to get size of #{str}")
return undefined
return Number(str.slice(0, -2))
relativeNumOfPx = (str, basisSize) ->
if not _.endsWi... | CoffeeScript | Pagedraw/pagedraw | html-importer/selenium_importer/page-importer.coffee | MIT | aba1bd1b8ef6bb7f58866a9d11ebb7f1e0e18a8e | 3,558 | https://github.com/Pagedraw/pagedraw/blob/aba1bd1b8ef6bb7f58866a9d11ebb7f1e0e18a8e/html-importer/selenium_importer/page-importer.coffee | 2 | 51 | ||
Pagedraw/pagedraw:html-importer/selenium_importer/page-importer.coffee:1:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
window.importPage = () ->
doc = {}
# utils
numOfPx = (str) ->
if str? == false or not _.endsWith(str, 'px')
console.log("failed to get size of #{str}")
return undefined
return Number(str.slice(0, -2))
rela... | window.importPage = function() {
var clientRect, colorIsVisible, doc, getCSSValueUrl, isOffscreen, numOfPx, relativeNumOfPx;
doc = {};
// utils
numOfPx = function(str) {
if ((str != null) === false || !_.endsWith(str, 'px')) {
console.log(`failed to get size of ${str}`);
return void 0;
}
... | CoffeeScript | JavaScript | Pagedraw/pagedraw | html-importer/selenium_importer/page-importer.coffee | MIT | aba1bd1b8ef6bb7f58866a9d11ebb7f1e0e18a8e | 3,558 | https://github.com/Pagedraw/pagedraw/blob/aba1bd1b8ef6bb7f58866a9d11ebb7f1e0e18a8e/html-importer/selenium_importer/page-importer.coffee | 2 | 51 |
Pagedraw/pagedraw:html-importer/selenium_importer/page-importer.coffee:1:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
window.importPage = function() {
var clientRect, colorIsVisible, doc, getCSSValueUrl, isOffscreen, numOfPx, relativeNumOfPx;
doc = {};
// utils
numOfPx = function(str) {
if ((str != null) === false || !_.endsWith(str, 'px')) {
console.log(`failed ... | window.importPage = () ->
doc = {}
# utils
numOfPx = (str) ->
if str? == false or not _.endsWith(str, 'px')
console.log("failed to get size of #{str}")
return undefined
return Number(str.slice(0, -2))
relativeNumOfPx = (str, basisSize) ->
if not _.endsWi... | JavaScript | CoffeeScript | Pagedraw/pagedraw | html-importer/selenium_importer/page-importer.coffee | MIT | aba1bd1b8ef6bb7f58866a9d11ebb7f1e0e18a8e | 3,558 | https://github.com/Pagedraw/pagedraw/blob/aba1bd1b8ef6bb7f58866a9d11ebb7f1e0e18a8e/html-importer/selenium_importer/page-importer.coffee | 2 | 51 |
Pagedraw/pagedraw:html-importer/selenium_importer/page-importer.coffee:1:completion | completion | window.importPage = () ->
doc = {}
# utils
numOfPx = (str) ->
if str? == false or not _.endsWith(str, 'px')
console.log("failed to get size of #{str}")
return undefined
return Number(str.slice(0, -2))
relativeNumOfPx = (str, basisSize) ->
if not _.endsWi... | a = 1
else
return true # assume visible on failure
return false if a == 0
#return false if r == b == g == 255 # pretend white is assumed background color
return true
getCSSValueUrl = (cssvalue) ->
return undefined unless cssvalue?
... | CoffeeScript | CoffeeScript | Pagedraw/pagedraw | html-importer/selenium_importer/page-importer.coffee | MIT | aba1bd1b8ef6bb7f58866a9d11ebb7f1e0e18a8e | 3,558 | https://github.com/Pagedraw/pagedraw/blob/aba1bd1b8ef6bb7f58866a9d11ebb7f1e0e18a8e/html-importer/selenium_importer/page-importer.coffee | 2 | 51 |
Pagedraw/pagedraw:html-importer/selenium_importer/page-importer.coffee:2:raw_corpus | raw_corpus | hasVisibleText = (dom) ->
return (dom.nodeType == Node.TEXT_NODE or _.some(dom.childNodes, hasVisibleText))
## Start reading stuff
DEBUG=true
if DEBUG?
urlpath = document.location.href
else
# get page's url path component
urlpath = document.location.pathname
# get... | CoffeeScript | Pagedraw/pagedraw | html-importer/selenium_importer/page-importer.coffee | MIT | aba1bd1b8ef6bb7f58866a9d11ebb7f1e0e18a8e | 3,558 | https://github.com/Pagedraw/pagedraw/blob/aba1bd1b8ef6bb7f58866a9d11ebb7f1e0e18a8e/html-importer/selenium_importer/page-importer.coffee | 52 | 101 | ||
Pagedraw/pagedraw:html-importer/selenium_importer/page-importer.coffee:2:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
hasVisibleText = (dom) ->
return (dom.nodeType == Node.TEXT_NODE or _.some(dom.childNodes, hasVisibleText))
## Start reading stuff
DEBUG=true
if DEBUG?
urlpath = document.location.href
else
# get page's url path componen... | var DEBUG, blocks, hasVisibleText, urlpath;
hasVisibleText = function(dom) {
return dom.nodeType === Node.TEXT_NODE || _.some(dom.childNodes, hasVisibleText);
};
//# Start reading stuff
DEBUG = true;
if (DEBUG != null) {
urlpath = document.location.href;
} else {
// get page's url path component
urlpath = do... | CoffeeScript | JavaScript | Pagedraw/pagedraw | html-importer/selenium_importer/page-importer.coffee | MIT | aba1bd1b8ef6bb7f58866a9d11ebb7f1e0e18a8e | 3,558 | https://github.com/Pagedraw/pagedraw/blob/aba1bd1b8ef6bb7f58866a9d11ebb7f1e0e18a8e/html-importer/selenium_importer/page-importer.coffee | 52 | 101 |
Pagedraw/pagedraw:html-importer/selenium_importer/page-importer.coffee:2:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
var DEBUG, blocks, hasVisibleText, urlpath;
hasVisibleText = function(dom) {
return dom.nodeType === Node.TEXT_NODE || _.some(dom.childNodes, hasVisibleText);
};
//# Start reading stuff
DEBUG = true;
if (DEBUG != null) {
urlpath = document.location.href;
} e... | hasVisibleText = (dom) ->
return (dom.nodeType == Node.TEXT_NODE or _.some(dom.childNodes, hasVisibleText))
## Start reading stuff
DEBUG=true
if DEBUG?
urlpath = document.location.href
else
# get page's url path component
urlpath = document.location.pathname
# get... | JavaScript | CoffeeScript | Pagedraw/pagedraw | html-importer/selenium_importer/page-importer.coffee | MIT | aba1bd1b8ef6bb7f58866a9d11ebb7f1e0e18a8e | 3,558 | https://github.com/Pagedraw/pagedraw/blob/aba1bd1b8ef6bb7f58866a9d11ebb7f1e0e18a8e/html-importer/selenium_importer/page-importer.coffee | 52 | 101 |
Pagedraw/pagedraw:html-importer/selenium_importer/page-importer.coffee:2:completion | completion | hasVisibleText = (dom) ->
return (dom.nodeType == Node.TEXT_NODE or _.some(dom.childNodes, hasVisibleText))
## Start reading stuff
DEBUG=true
if DEBUG?
urlpath = document.location.href
else
# get page's url path component
urlpath = document.location.pathname
# get... | left += numOfPx(styles.paddingLeft) + numOfPx(styles.borderLeftWidth)
# $.height() and $.width() get the height/width of the element content
rect = domBlock[0].getBoundingClientRect()
[height, width] = [rect.height, rect.width]
# Make sure we have integers for geometry; Pagedraw only w... | CoffeeScript | CoffeeScript | Pagedraw/pagedraw | html-importer/selenium_importer/page-importer.coffee | MIT | aba1bd1b8ef6bb7f58866a9d11ebb7f1e0e18a8e | 3,558 | https://github.com/Pagedraw/pagedraw/blob/aba1bd1b8ef6bb7f58866a9d11ebb7f1e0e18a8e/html-importer/selenium_importer/page-importer.coffee | 52 | 101 |
Pagedraw/pagedraw:html-importer/selenium_importer/page-importer.coffee:3:raw_corpus | raw_corpus | if domBlock[0].tagName == 'INPUT' and domBlock[0].type == 'text'
btype = 'text-input'
block.placeholder = domBlock[0].placeholder
# FIXME need better heuristic for if we should consider block text content
else if domBlock.children()?.length == 0 and domBlock.text() and hasVisibleText(... | CoffeeScript | Pagedraw/pagedraw | html-importer/selenium_importer/page-importer.coffee | MIT | aba1bd1b8ef6bb7f58866a9d11ebb7f1e0e18a8e | 3,558 | https://github.com/Pagedraw/pagedraw/blob/aba1bd1b8ef6bb7f58866a9d11ebb7f1e0e18a8e/html-importer/selenium_importer/page-importer.coffee | 102 | 139 | ||
Pagedraw/pagedraw:html-importer/selenium_importer/page-importer.coffee:3:completion | completion | if domBlock[0].tagName == 'INPUT' and domBlock[0].type == 'text'
btype = 'text-input'
block.placeholder = domBlock[0].placeholder
# FIXME need better heuristic for if we should consider block text content
else if domBlock.children()?.length == 0 and domBlock.text() and hasVisibleText(... | btype = 'image'
block.url = domBlock[0].src
# it's actually fairly difficult to figure out whether we're the same
# color as the background or a single child or something, but or now,
# assume white means no color
else if not colorIsVisible(block.color) and not block.image?
... | CoffeeScript | CoffeeScript | Pagedraw/pagedraw | html-importer/selenium_importer/page-importer.coffee | MIT | aba1bd1b8ef6bb7f58866a9d11ebb7f1e0e18a8e | 3,558 | https://github.com/Pagedraw/pagedraw/blob/aba1bd1b8ef6bb7f58866a9d11ebb7f1e0e18a8e/html-importer/selenium_importer/page-importer.coffee | 102 | 139 |
nickperkinslondon/angular-bootstrap-nav-tree:src/angular_bootstrap_nav_tree.coffee:1:raw_corpus | raw_corpus | module = angular.module 'angularBootstrapNavTree',[]
module.directive 'abnTree',($timeout)->
restrict:'E'
templateUrl:'abn_tree_template.html'
scope:
treedata:'='
link:(scope,element,attrs)->
# check args
if !scope.treedata
alert 'no treedata defined for the tree!'
if !scope.treedata.le... | CoffeeScript | nickperkinslondon/angular-bootstrap-nav-tree | src/angular_bootstrap_nav_tree.coffee | MIT | ffd7fd20da9ed99f9ece0fef0c09b427024d7684 | 670 | https://github.com/nickperkinslondon/angular-bootstrap-nav-tree/blob/ffd7fd20da9ed99f9ece0fef0c09b427024d7684/src/angular_bootstrap_nav_tree.coffee | 1 | 40 | ||
nickperkinslondon/angular-bootstrap-nav-tree:src/angular_bootstrap_nav_tree.coffee:1:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
module = angular.module 'angularBootstrapNavTree',[]
module.directive 'abnTree',($timeout)->
restrict:'E'
templateUrl:'abn_tree_template.html'
scope:
treedata:'='
link:(scope,element,attrs)->
# check args
if !scope.treedata
alert 'no ... | var module;
module = angular.module('angularBootstrapNavTree', []);
module.directive('abnTree', function($timeout) {
return {
restrict: 'E',
templateUrl: 'abn_tree_template.html',
scope: {
treedata: '='
},
link: function(scope, element, attrs) {
var expand_all, for_each_branch, unsel... | CoffeeScript | JavaScript | nickperkinslondon/angular-bootstrap-nav-tree | src/angular_bootstrap_nav_tree.coffee | MIT | ffd7fd20da9ed99f9ece0fef0c09b427024d7684 | 670 | https://github.com/nickperkinslondon/angular-bootstrap-nav-tree/blob/ffd7fd20da9ed99f9ece0fef0c09b427024d7684/src/angular_bootstrap_nav_tree.coffee | 1 | 40 |
nickperkinslondon/angular-bootstrap-nav-tree:src/angular_bootstrap_nav_tree.coffee:1:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
var module;
module = angular.module('angularBootstrapNavTree', []);
module.directive('abnTree', function($timeout) {
return {
restrict: 'E',
templateUrl: 'abn_tree_template.html',
scope: {
treedata: '='
},
link: function(scope, element... | module = angular.module 'angularBootstrapNavTree',[]
module.directive 'abnTree',($timeout)->
restrict:'E'
templateUrl:'abn_tree_template.html'
scope:
treedata:'='
link:(scope,element,attrs)->
# check args
if !scope.treedata
alert 'no treedata defined for the tree!'
if !scope.treedata.le... | JavaScript | CoffeeScript | nickperkinslondon/angular-bootstrap-nav-tree | src/angular_bootstrap_nav_tree.coffee | MIT | ffd7fd20da9ed99f9ece0fef0c09b427024d7684 | 670 | https://github.com/nickperkinslondon/angular-bootstrap-nav-tree/blob/ffd7fd20da9ed99f9ece0fef0c09b427024d7684/src/angular_bootstrap_nav_tree.coffee | 1 | 40 |
nickperkinslondon/angular-bootstrap-nav-tree:src/angular_bootstrap_nav_tree.coffee:1:completion | completion | module = angular.module 'angularBootstrapNavTree',[]
module.directive 'abnTree',($timeout)->
restrict:'E'
templateUrl:'abn_tree_template.html'
scope:
treedata:'='
link:(scope,element,attrs)->
# check args
if !scope.treedata
alert 'no treedata defined for the tree!'
if !scope.treedata.le... | #
# internal utilities...
#
for_each_branch = (f)->
do_f = (branch)->
f(branch)
if branch.children?
for child in branch.children
do_f(child)
for root_branch in scope.treedata
do_f(root_branch)
expand_all = ->
for_each_branch (branch)->
... | CoffeeScript | CoffeeScript | nickperkinslondon/angular-bootstrap-nav-tree | src/angular_bootstrap_nav_tree.coffee | MIT | ffd7fd20da9ed99f9ece0fef0c09b427024d7684 | 670 | https://github.com/nickperkinslondon/angular-bootstrap-nav-tree/blob/ffd7fd20da9ed99f9ece0fef0c09b427024d7684/src/angular_bootstrap_nav_tree.coffee | 1 | 40 |
nickperkinslondon/angular-bootstrap-nav-tree:src/angular_bootstrap_nav_tree.coffee:2:raw_corpus | raw_corpus | #
# the default is to have all branches expanded
#
if not attrs.collapsed? and not attrs.collapse
# be
expand_all()
#
# give each Branch a UID ( to keep AngularJS happy )
#
for_each_branch (branch)->
branch.uid = ""+Math.random()
#
# only one branch can be select... | CoffeeScript | nickperkinslondon/angular-bootstrap-nav-tree | src/angular_bootstrap_nav_tree.coffee | MIT | ffd7fd20da9ed99f9ece0fef0c09b427024d7684 | 670 | https://github.com/nickperkinslondon/angular-bootstrap-nav-tree/blob/ffd7fd20da9ed99f9ece0fef0c09b427024d7684/src/angular_bootstrap_nav_tree.coffee | 42 | 81 | ||
nickperkinslondon/angular-bootstrap-nav-tree:src/angular_bootstrap_nav_tree.coffee:2:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
#
# the default is to have all branches expanded
#
if not attrs.collapsed? and not attrs.collapse
# be
expand_all()
#
# give each Branch a UID ( to keep AngularJS happy )
#
for_each_branch (branch)->
branch.uid = ""+... | // the default is to have all branches expanded
var select_branch, selected_branch;
if ((attrs.collapsed == null) && !attrs.collapse) {
// be
expand_all();
}
// give each Branch a UID ( to keep AngularJS happy )
for_each_branch(function(branch) {
return branch.uid = "" + Math.random();
});
// only one bran... | CoffeeScript | JavaScript | nickperkinslondon/angular-bootstrap-nav-tree | src/angular_bootstrap_nav_tree.coffee | MIT | ffd7fd20da9ed99f9ece0fef0c09b427024d7684 | 670 | https://github.com/nickperkinslondon/angular-bootstrap-nav-tree/blob/ffd7fd20da9ed99f9ece0fef0c09b427024d7684/src/angular_bootstrap_nav_tree.coffee | 42 | 81 |
nickperkinslondon/angular-bootstrap-nav-tree:src/angular_bootstrap_nav_tree.coffee:2:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
// the default is to have all branches expanded
var select_branch, selected_branch;
if ((attrs.collapsed == null) && !attrs.collapse) {
// be
expand_all();
}
// give each Branch a UID ( to keep AngularJS happy )
for_each_branch(function(branch) {
return ... | #
# the default is to have all branches expanded
#
if not attrs.collapsed? and not attrs.collapse
# be
expand_all()
#
# give each Branch a UID ( to keep AngularJS happy )
#
for_each_branch (branch)->
branch.uid = ""+Math.random()
#
# only one branch can be select... | JavaScript | CoffeeScript | nickperkinslondon/angular-bootstrap-nav-tree | src/angular_bootstrap_nav_tree.coffee | MIT | ffd7fd20da9ed99f9ece0fef0c09b427024d7684 | 670 | https://github.com/nickperkinslondon/angular-bootstrap-nav-tree/blob/ffd7fd20da9ed99f9ece0fef0c09b427024d7684/src/angular_bootstrap_nav_tree.coffee | 42 | 81 |
nickperkinslondon/angular-bootstrap-nav-tree:src/angular_bootstrap_nav_tree.coffee:2:completion | completion | #
# the default is to have all branches expanded
#
if not attrs.collapsed? and not attrs.collapse
# be
expand_all()
#
# give each Branch a UID ( to keep AngularJS happy )
#
for_each_branch (branch)->
branch.uid = ""+Math.random()
#
# only one branch can be select... | branch.selected = true
selected_branch = branch
if branch.onSelect?
$timeout ->
branch.onSelect(branch)
scope.user_clicks_branch = (branch)->
if branch isnt selected_branch
select_branch(branch)
# To make the Angular rendering simpler,
# ( and to avoid recur... | CoffeeScript | CoffeeScript | nickperkinslondon/angular-bootstrap-nav-tree | src/angular_bootstrap_nav_tree.coffee | MIT | ffd7fd20da9ed99f9ece0fef0c09b427024d7684 | 670 | https://github.com/nickperkinslondon/angular-bootstrap-nav-tree/blob/ffd7fd20da9ed99f9ece0fef0c09b427024d7684/src/angular_bootstrap_nav_tree.coffee | 42 | 81 |
nickperkinslondon/angular-bootstrap-nav-tree:src/angular_bootstrap_nav_tree.coffee:3:raw_corpus | raw_corpus | #
# when tree data changes,
# re-create the "tree_rows" data that is used
# to actually render the tree
#
scope.tree_rows = []
on_treedata_change = ->
scope.tree_rows = []
add_all = (level,branch,visible)->
#
# add_all: recursively add one branch
# and all o... | CoffeeScript | nickperkinslondon/angular-bootstrap-nav-tree | src/angular_bootstrap_nav_tree.coffee | MIT | ffd7fd20da9ed99f9ece0fef0c09b427024d7684 | 670 | https://github.com/nickperkinslondon/angular-bootstrap-nav-tree/blob/ffd7fd20da9ed99f9ece0fef0c09b427024d7684/src/angular_bootstrap_nav_tree.coffee | 83 | 123 | ||
nickperkinslondon/angular-bootstrap-nav-tree:src/angular_bootstrap_nav_tree.coffee:3:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
#
# when tree data changes,
# re-create the "tree_rows" data that is used
# to actually render the tree
#
scope.tree_rows = []
on_treedata_change = ->
scope.tree_rows = []
add_all = (level,branch,visible)->
#
... | // when tree data changes,
// re-create the "tree_rows" data that is used
// to actually render the tree
var on_treedata_change;
scope.tree_rows = [];
on_treedata_change = function() {
var add_all;
scope.tree_rows = [];
return add_all = function(level, branch, visible) {
var tree_icon;
// add_all: rec... | CoffeeScript | JavaScript | nickperkinslondon/angular-bootstrap-nav-tree | src/angular_bootstrap_nav_tree.coffee | MIT | ffd7fd20da9ed99f9ece0fef0c09b427024d7684 | 670 | https://github.com/nickperkinslondon/angular-bootstrap-nav-tree/blob/ffd7fd20da9ed99f9ece0fef0c09b427024d7684/src/angular_bootstrap_nav_tree.coffee | 83 | 123 |
nickperkinslondon/angular-bootstrap-nav-tree:src/angular_bootstrap_nav_tree.coffee:3:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
// when tree data changes,
// re-create the "tree_rows" data that is used
// to actually render the tree
var on_treedata_change;
scope.tree_rows = [];
on_treedata_change = function() {
var add_all;
scope.tree_rows = [];
return add_all = function(level, bra... | #
# when tree data changes,
# re-create the "tree_rows" data that is used
# to actually render the tree
#
scope.tree_rows = []
on_treedata_change = ->
scope.tree_rows = []
add_all = (level,branch,visible)->
#
# add_all: recursively add one branch
# and all o... | JavaScript | CoffeeScript | nickperkinslondon/angular-bootstrap-nav-tree | src/angular_bootstrap_nav_tree.coffee | MIT | ffd7fd20da9ed99f9ece0fef0c09b427024d7684 | 670 | https://github.com/nickperkinslondon/angular-bootstrap-nav-tree/blob/ffd7fd20da9ed99f9ece0fef0c09b427024d7684/src/angular_bootstrap_nav_tree.coffee | 83 | 123 |
nickperkinslondon/angular-bootstrap-nav-tree:src/angular_bootstrap_nav_tree.coffee:3:completion | completion | #
# when tree data changes,
# re-create the "tree_rows" data that is used
# to actually render the tree
#
scope.tree_rows = []
on_treedata_change = ->
scope.tree_rows = []
add_all = (level,branch,visible)->
#
# add_all: recursively add one branch
# and all o... | if not branch.expanded?
branch.expanded = false
#
# icons can be Bootstrap or Font-Awesome icons:
# they will be rendered like:
# <i class="icon-plus"></i>
#
tree_icon = attrs.iconExpand if not branch.expanded and branch.children
tree_icon = attrs.iconC... | CoffeeScript | CoffeeScript | nickperkinslondon/angular-bootstrap-nav-tree | src/angular_bootstrap_nav_tree.coffee | MIT | ffd7fd20da9ed99f9ece0fef0c09b427024d7684 | 670 | https://github.com/nickperkinslondon/angular-bootstrap-nav-tree/blob/ffd7fd20da9ed99f9ece0fef0c09b427024d7684/src/angular_bootstrap_nav_tree.coffee | 83 | 123 |
nickperkinslondon/angular-bootstrap-nav-tree:src/angular_bootstrap_nav_tree.coffee:4:raw_corpus | raw_corpus | #
# recursively add all children of this branch...( at Level+1 )
#
if branch.children?
for child in branch.children
#
# all branches are added to the list,
# but some are not visible
# ( if parent is collapsed )
#
... | CoffeeScript | nickperkinslondon/angular-bootstrap-nav-tree | src/angular_bootstrap_nav_tree.coffee | MIT | ffd7fd20da9ed99f9ece0fef0c09b427024d7684 | 670 | https://github.com/nickperkinslondon/angular-bootstrap-nav-tree/blob/ffd7fd20da9ed99f9ece0fef0c09b427024d7684/src/angular_bootstrap_nav_tree.coffee | 126 | 151 | ||
nickperkinslondon/angular-bootstrap-nav-tree:src/angular_bootstrap_nav_tree.coffee:4:completion | completion | #
# recursively add all children of this branch...( at Level+1 )
#
if branch.children?
for child in branch.children
#
# all branches are added to the list,
# but some are not visible
# ( if parent is collapsed )
#
... | #
# start with root branches,
# and recursively add all children to the list
#
for root_branch in scope.treedata
add_all 1, root_branch, true
#
# make sure to do a "deep watch" on the tree data
# ( by passing "true" as the third arg )
#
scope.$watch 'treedata',on_tr... | CoffeeScript | CoffeeScript | nickperkinslondon/angular-bootstrap-nav-tree | src/angular_bootstrap_nav_tree.coffee | MIT | ffd7fd20da9ed99f9ece0fef0c09b427024d7684 | 670 | https://github.com/nickperkinslondon/angular-bootstrap-nav-tree/blob/ffd7fd20da9ed99f9ece0fef0c09b427024d7684/src/angular_bootstrap_nav_tree.coffee | 126 | 151 |
littlebee/git-time-machine:lib/git-revselector-popup.coffee:1:raw_corpus | raw_corpus | module.exports = class GitRevSelectorPopup extends View
@content = (commit, leftOrRight, $hoverElement) ->
dateFormat = "MMM DD YYYY ha"
@div class: "select-list popover-list git-timemachine-revselector-popup", =>
authorDate = moment.unix(commit.authorDate)
linesAdded = commit.linesAdded || 0
... | CoffeeScript | littlebee/git-time-machine | lib/git-revselector-popup.coffee | MIT | 2b2a9b6ccc55dda0429a45aae913d1a0f6666439 | 1,111 | https://github.com/littlebee/git-time-machine/blob/2b2a9b6ccc55dda0429a45aae913d1a0f6666439/lib/git-revselector-popup.coffee | 6 | 55 | ||
littlebee/git-time-machine:lib/git-revselector-popup.coffee:1:completion | completion | module.exports = class GitRevSelectorPopup extends View
@content = (commit, leftOrRight, $hoverElement) ->
dateFormat = "MMM DD YYYY ha"
@div class: "select-list popover-list git-timemachine-revselector-popup", =>
authorDate = moment.unix(commit.authorDate)
linesAdded = commit.linesAdded || 0
... | @_debouncedHide ?= _.debounce @hide, 50
@appendTo atom.views.getView atom.workspace
@_bindMouseEvents()
@show()
_.delay @hide, 5000
_bindMouseEvents: ->
@mouseenter @_onMouseEnterPopup
@mouseleave @_onMouseLeavePopup
@$hoverElement.mouseenter @_onMouseEnterHoverElement
@$hoverElemen... | CoffeeScript | CoffeeScript | littlebee/git-time-machine | lib/git-revselector-popup.coffee | MIT | 2b2a9b6ccc55dda0429a45aae913d1a0f6666439 | 1,111 | https://github.com/littlebee/git-time-machine/blob/2b2a9b6ccc55dda0429a45aae913d1a0f6666439/lib/git-revselector-popup.coffee | 6 | 55 |
littlebee/git-time-machine:lib/git-revselector-popup.coffee:2:raw_corpus | raw_corpus | return @
remove: () =>
super
isMouseInPopup: () =>
return @_mouseInPopup == true
_positionPopup: ->
clientRect = @$hoverElement.offset()
if @leftOrRight == 'left'
left = clientRect.left + @$hoverElement.width() - @width()
else
left = clientRect.left
top = clientRect.top -... | CoffeeScript | littlebee/git-time-machine | lib/git-revselector-popup.coffee | MIT | 2b2a9b6ccc55dda0429a45aae913d1a0f6666439 | 1,111 | https://github.com/littlebee/git-time-machine/blob/2b2a9b6ccc55dda0429a45aae913d1a0f6666439/lib/git-revselector-popup.coffee | 56 | 96 | ||
littlebee/git-time-machine:lib/git-revselector-popup.coffee:2:completion | completion | return @
remove: () =>
super
isMouseInPopup: () =>
return @_mouseInPopup == true
_positionPopup: ->
clientRect = @$hoverElement.offset()
if @leftOrRight == 'left'
left = clientRect.left + @$hoverElement.width() - @width()
else
left = clientRect.left
top = clientRect.top -... | _onMouseEnterPopup: (evt) =>
@_mouseInPopup = true
return
_onMouseLeavePopup: (evt) =>
@_mouseInPopup = false
@_debouncedHide()
return
_onMouseEnterHoverElement: (evt) =>
@_mouseInHoverElement = true
@show()
_onMouseLeaveHoverElement: (evt) =>
@_mouseInHoverElement = false
... | CoffeeScript | CoffeeScript | littlebee/git-time-machine | lib/git-revselector-popup.coffee | MIT | 2b2a9b6ccc55dda0429a45aae913d1a0f6666439 | 1,111 | https://github.com/littlebee/git-time-machine/blob/2b2a9b6ccc55dda0429a45aae913d1a0f6666439/lib/git-revselector-popup.coffee | 56 | 96 |
littlebee/git-time-machine:lib/git-revselector-popup.coffee:1:raw_corpus | raw_corpus | module.exports = class GitRevSelectorPopup extends View
@content = (commit, leftOrRight, $hoverElement) ->
dateFormat = "MMM DD YYYY ha"
@div class: "select-list popover-list git-timemachine-revselector-popup", =>
authorDate = moment.unix(commit.authorDate)
linesAdded = commit.linesAdded || 0
... | CoffeeScript | littlebee/git-time-machine | lib/git-revselector-popup.coffee | MIT | 3b17b78e046fa75ceeb9475cae1d05e4d217ea31 | 1,111 | https://github.com/littlebee/git-time-machine/blob/3b17b78e046fa75ceeb9475cae1d05e4d217ea31/lib/git-revselector-popup.coffee | 6 | 55 | ||
littlebee/git-time-machine:lib/git-revselector-popup.coffee:1:completion | completion | module.exports = class GitRevSelectorPopup extends View
@content = (commit, leftOrRight, $hoverElement) ->
dateFormat = "MMM DD YYYY ha"
@div class: "select-list popover-list git-timemachine-revselector-popup", =>
authorDate = moment.unix(commit.authorDate)
linesAdded = commit.linesAdded || 0
... | @_debouncedHide ?= _.debounce @hide, 50
@appendTo atom.views.getView atom.workspace
@_bindMouseEvents()
@show()
_.delay @hide, 10000
_bindMouseEvents: ->
@mouseenter @_onMouseEnterPopup
@mouseleave @_onMouseLeavePopup
@$hoverElement.mouseenter @_onMouseEnterHoverElement
@$hoverEleme... | CoffeeScript | CoffeeScript | littlebee/git-time-machine | lib/git-revselector-popup.coffee | MIT | 3b17b78e046fa75ceeb9475cae1d05e4d217ea31 | 1,111 | https://github.com/littlebee/git-time-machine/blob/3b17b78e046fa75ceeb9475cae1d05e4d217ea31/lib/git-revselector-popup.coffee | 6 | 55 |
cdglabs/apparatus:src/Util/LiveGetter.coffee:1:raw_corpus | raw_corpus | request = require 'superagent'
xml2js = require 'xml2js'
# Adding XML-parsing support to superagent...
parseXML = (res, fn) ->
# xml2js is fake-async, so we just use the callback to set the closure vals
# and use them immediately.
vals = undefined
xml2js.parseString(res, {async: false}, (err, res) => vals = {... | CoffeeScript | cdglabs/apparatus | src/Util/LiveGetter.coffee | MIT | 107e0c2db5a0adf0f1c3b49f16f7625cff4e523b | 1,052 | https://github.com/cdglabs/apparatus/blob/107e0c2db5a0adf0f1c3b49f16f7625cff4e523b/src/Util/LiveGetter.coffee | 1 | 50 | ||
cdglabs/apparatus:src/Util/LiveGetter.coffee:1:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
request = require 'superagent'
xml2js = require 'xml2js'
# Adding XML-parsing support to superagent...
parseXML = (res, fn) ->
# xml2js is fake-async, so we just use the callback to set the closure vals
# and use them immediately.
vals = undefined
xml2j... | var LiveGetter, parseXML, request, xml2js;
request = require('superagent');
xml2js = require('xml2js');
// Adding XML-parsing support to superagent...
parseXML = function(res, fn) {
var vals;
// xml2js is fake-async, so we just use the callback to set the closure vals
// and use them immediately.
vals = void... | CoffeeScript | JavaScript | cdglabs/apparatus | src/Util/LiveGetter.coffee | MIT | 107e0c2db5a0adf0f1c3b49f16f7625cff4e523b | 1,052 | https://github.com/cdglabs/apparatus/blob/107e0c2db5a0adf0f1c3b49f16f7625cff4e523b/src/Util/LiveGetter.coffee | 1 | 50 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.