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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
octoblu/meshblu:lib/clearCacheRedis.coffee:1:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
var _, clearCache, redis;
_ = require('lodash');
redis = require('./redis');
clearCache = function(uuid, callback = function() {}) {
if (uuid) {
return redis.del(redis.CACHE_KEY + uuid, callback);
}
};
module.exports = clearCache;
``` | _ = require 'lodash'
redis = require './redis'
clearCache = (uuid, callback=->) ->
if uuid
redis.del redis.CACHE_KEY + uuid, callback
module.exports = clearCache | JavaScript | CoffeeScript | octoblu/meshblu | lib/clearCacheRedis.coffee | MIT | cb391c74d09b0a15a42c95b0dc884034632400d8 | 815 | https://github.com/octoblu/meshblu/blob/cb391c74d09b0a15a42c95b0dc884034632400d8/lib/clearCacheRedis.coffee | 1 | 8 |
octoblu/meshblu:lib/clearCacheRedis.coffee:1:completion | completion | _ = require 'lodash'
redis = require './redis'
clearCache = (uuid, callback=->) -> | if uuid
redis.del redis.CACHE_KEY + uuid, callback
module.exports = clearCache | CoffeeScript | CoffeeScript | octoblu/meshblu | lib/clearCacheRedis.coffee | MIT | cb391c74d09b0a15a42c95b0dc884034632400d8 | 815 | https://github.com/octoblu/meshblu/blob/cb391c74d09b0a15a42c95b0dc884034632400d8/lib/clearCacheRedis.coffee | 1 | 8 |
linemanjs/lineman:test/spec-e2e/lib/watching-files-spec.coffee:1:raw_corpus | raw_corpus | describe "watching files", ->
Given (done) -> browser.get "http://admc.io/wd/test-pages/guinea-pig.html", done
When (done) -> browser.title (err, title) => @result = title; done()
Then -> @result == "WD Tests" | CoffeeScript | linemanjs/lineman | test/spec-e2e/lib/watching-files-spec.coffee | MIT | 0af6711c0ec0b192705a7fee01ef9e6d834ffe47 | 1,168 | https://github.com/linemanjs/lineman/blob/0af6711c0ec0b192705a7fee01ef9e6d834ffe47/test/spec-e2e/lib/watching-files-spec.coffee | 1 | 4 | ||
linemanjs/lineman:test/spec-e2e/lib/watching-files-spec.coffee:1:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
describe "watching files", ->
Given (done) -> browser.get "http://admc.io/wd/test-pages/guinea-pig.html", done
When (done) -> browser.title (err, title) => @result = title; done()
Then -> @result == "WD Tests"
``` | describe("watching files", function() {
Given(function(done) {
return browser.get("http://admc.io/wd/test-pages/guinea-pig.html", done);
});
When(function(done) {
return browser.title((err, title) => {
this.result = title;
return done();
});
});
return Then(function() {
return this... | CoffeeScript | JavaScript | linemanjs/lineman | test/spec-e2e/lib/watching-files-spec.coffee | MIT | 0af6711c0ec0b192705a7fee01ef9e6d834ffe47 | 1,168 | https://github.com/linemanjs/lineman/blob/0af6711c0ec0b192705a7fee01ef9e6d834ffe47/test/spec-e2e/lib/watching-files-spec.coffee | 1 | 4 |
linemanjs/lineman:test/spec-e2e/lib/watching-files-spec.coffee:1:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
describe("watching files", function() {
Given(function(done) {
return browser.get("http://admc.io/wd/test-pages/guinea-pig.html", done);
});
When(function(done) {
return browser.title((err, title) => {
this.result = title;
return done();
... | describe "watching files", ->
Given (done) -> browser.get "http://admc.io/wd/test-pages/guinea-pig.html", done
When (done) -> browser.title (err, title) => @result = title; done()
Then -> @result == "WD Tests" | JavaScript | CoffeeScript | linemanjs/lineman | test/spec-e2e/lib/watching-files-spec.coffee | MIT | 0af6711c0ec0b192705a7fee01ef9e6d834ffe47 | 1,168 | https://github.com/linemanjs/lineman/blob/0af6711c0ec0b192705a7fee01ef9e6d834ffe47/test/spec-e2e/lib/watching-files-spec.coffee | 1 | 4 |
linemanjs/lineman:test/spec-e2e/lib/watching-files-spec.coffee:1:completion | completion | describe "watching files", ->
Given (done) -> browser.get "http://admc.io/wd/test-pages/guinea-pig.html", done | When (done) -> browser.title (err, title) => @result = title; done()
Then -> @result == "WD Tests" | CoffeeScript | CoffeeScript | linemanjs/lineman | test/spec-e2e/lib/watching-files-spec.coffee | MIT | 0af6711c0ec0b192705a7fee01ef9e6d834ffe47 | 1,168 | https://github.com/linemanjs/lineman/blob/0af6711c0ec0b192705a7fee01ef9e6d834ffe47/test/spec-e2e/lib/watching-files-spec.coffee | 1 | 4 |
yakyak/yakyak:src/ui/models/convsettings.coffee:1:raw_corpus | raw_corpus | entity = require './entity'
module.exports = exp = {
# This handles the data of conversation add / edit
# where you can specify participants conversation name, etc
searchedEntities: []
selectedEntities: []
initialName: null
initialSearchQuery: null
name: ""
searchQuery: ""
id: null
... | CoffeeScript | yakyak/yakyak | src/ui/models/convsettings.coffee | MIT | 8f8cbc081c66ca00b5e9520a9bef5f2bc1d64dfd | 3,762 | https://github.com/yakyak/yakyak/blob/8f8cbc081c66ca00b5e9520a9bef5f2bc1d64dfd/src/ui/models/convsettings.coffee | 1 | 50 | ||
yakyak/yakyak:src/ui/models/convsettings.coffee:1:completion | completion | entity = require './entity'
module.exports = exp = {
# This handles the data of conversation add / edit
# where you can specify participants conversation name, etc
searchedEntities: []
selectedEntities: []
initialName: null
initialSearchQuery: null
name: ""
searchQuery: ""
id: null
... | updated 'convsettings'
removeSelectedEntity: (entity) ->
id = entity.id?.chat_id or entity # may pass id directly
# if the conversation we are editing is one to one we don't want
# to remove the selected entity
@selectedEntities = (e for e in @selectedEntities when e.id.chat_id != i... | CoffeeScript | CoffeeScript | yakyak/yakyak | src/ui/models/convsettings.coffee | MIT | 8f8cbc081c66ca00b5e9520a9bef5f2bc1d64dfd | 3,762 | https://github.com/yakyak/yakyak/blob/8f8cbc081c66ca00b5e9520a9bef5f2bc1d64dfd/src/ui/models/convsettings.coffee | 1 | 50 |
yakyak/yakyak:src/ui/models/convsettings.coffee:2:raw_corpus | raw_corpus | loadConversation: (c) ->
c.participant_data.forEach (p) =>
id = p.id.chat_id or p.id.gaia_id
if entity.isSelf id then return
p = entity[id]
@selectedEntities.push
id: chat_id: id
properties:
photo_url: p.photo_ur... | CoffeeScript | yakyak/yakyak | src/ui/models/convsettings.coffee | MIT | 8f8cbc081c66ca00b5e9520a9bef5f2bc1d64dfd | 3,762 | https://github.com/yakyak/yakyak/blob/8f8cbc081c66ca00b5e9520a9bef5f2bc1d64dfd/src/ui/models/convsettings.coffee | 51 | 80 | ||
yakyak/yakyak:src/ui/models/convsettings.coffee:2:completion | completion | loadConversation: (c) ->
c.participant_data.forEach (p) =>
id = p.id.chat_id or p.id.gaia_id
if entity.isSelf id then return
p = entity[id]
@selectedEntities.push
id: chat_id: id
properties:
photo_url: p.photo_ur... | updated 'convsettings'
reset: ->
@searchedEntities = []
@selectedEntities = []
@initialName = ""
@initialSearchQuery = ""
@searchQuery = ""
@name = ""
@id = null
@group = false
updated 'convsettings'
} | CoffeeScript | CoffeeScript | yakyak/yakyak | src/ui/models/convsettings.coffee | MIT | 8f8cbc081c66ca00b5e9520a9bef5f2bc1d64dfd | 3,762 | https://github.com/yakyak/yakyak/blob/8f8cbc081c66ca00b5e9520a9bef5f2bc1d64dfd/src/ui/models/convsettings.coffee | 51 | 80 |
yakyak/yakyak:src/ui/models/convsettings.coffee:2:raw_corpus | raw_corpus | loadConversation: (c) ->
c.participant_data.forEach (p) =>
id = p.id.chat_id or p.id.gaia_id
if entity.isSelf id then return
p = entity[id]
@selectedEntities.push
id: chat_id: id
properties:
photo_url: p.photo_ur... | CoffeeScript | yakyak/yakyak | src/ui/models/convsettings.coffee | MIT | c5c853f776ac6c8a546959055afdf8beff3c097f | 3,762 | https://github.com/yakyak/yakyak/blob/c5c853f776ac6c8a546959055afdf8beff3c097f/src/ui/models/convsettings.coffee | 51 | 80 | ||
yakyak/yakyak:src/ui/models/convsettings.coffee:2:completion | completion | loadConversation: (c) ->
c.participant_data.forEach (p) =>
id = p.id.chat_id or p.id.gaia_id
if entity.isSelf id then return
p = entity[id]
@selectedEntities.push
id: chat_id: id
properties:
photo_url: p.photo_ur... | updated 'convsettings'
reset: ->
@searchedEntities = []
@selectedEntities = []
@initialName = ""
@initialSearchQuery = ""
@searchQuery = ""
@name = ""
@id = null
@group = false
updated 'convsettings'
} | CoffeeScript | CoffeeScript | yakyak/yakyak | src/ui/models/convsettings.coffee | MIT | c5c853f776ac6c8a546959055afdf8beff3c097f | 3,762 | https://github.com/yakyak/yakyak/blob/c5c853f776ac6c8a546959055afdf8beff3c097f/src/ui/models/convsettings.coffee | 51 | 80 |
jianliaoim/talk-os:talk-web/client/module/new-modal.coffee:1:raw_corpus | raw_corpus | cx = require 'classnames'
React = require 'react'
PureRenderMixin = require 'react-addons-pure-render-mixin'
mixinLayered = require '../mixin/layered'
Transition = React.createFactory require('react-lite-layered').Transition
a = React.createFactory 'a'
div = React.createFactory 'div'
span = React.createFactory 'span... | CoffeeScript | jianliaoim/talk-os | talk-web/client/module/new-modal.coffee | MIT | 2545c4497865779a55762e03963a39237df9046b | 2,703 | https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-web/client/module/new-modal.coffee | 1 | 50 | ||
jianliaoim/talk-os:talk-web/client/module/new-modal.coffee:1:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
cx = require 'classnames'
React = require 'react'
PureRenderMixin = require 'react-addons-pure-render-mixin'
mixinLayered = require '../mixin/layered'
Transition = React.createFactory require('react-lite-layered').Transition
a = React.createFactory 'a'
div = R... | var PureRenderMixin, React, T, Transition, a, cx, div, mixinLayered, span;
cx = require('classnames');
React = require('react');
PureRenderMixin = require('react-addons-pure-render-mixin');
mixinLayered = require('../mixin/layered');
Transition = React.createFactory(require('react-lite-layered').Transition);
a = ... | CoffeeScript | JavaScript | jianliaoim/talk-os | talk-web/client/module/new-modal.coffee | MIT | 2545c4497865779a55762e03963a39237df9046b | 2,703 | https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-web/client/module/new-modal.coffee | 1 | 50 |
jianliaoim/talk-os:talk-web/client/module/new-modal.coffee:1:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
var PureRenderMixin, React, T, Transition, a, cx, div, mixinLayered, span;
cx = require('classnames');
React = require('react');
PureRenderMixin = require('react-addons-pure-render-mixin');
mixinLayered = require('../mixin/layered');
Transition = React.createF... | cx = require 'classnames'
React = require 'react'
PureRenderMixin = require 'react-addons-pure-render-mixin'
mixinLayered = require '../mixin/layered'
Transition = React.createFactory require('react-lite-layered').Transition
a = React.createFactory 'a'
div = React.createFactory 'div'
span = React.createFactory 'span... | JavaScript | CoffeeScript | jianliaoim/talk-os | talk-web/client/module/new-modal.coffee | MIT | 2545c4497865779a55762e03963a39237df9046b | 2,703 | https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-web/client/module/new-modal.coffee | 1 | 50 |
jianliaoim/talk-os:talk-web/client/module/new-modal.coffee:1:completion | completion | cx = require 'classnames'
React = require 'react'
PureRenderMixin = require 'react-addons-pure-render-mixin'
mixinLayered = require '../mixin/layered'
Transition = React.createFactory require('react-lite-layered').Transition
a = React.createFactory 'a'
div = React.createFactory 'div'
span = React.createFactory 'span... | onBackdropClick: (event) ->
event.stopPropagation()
if not @props.showClose && event.target is event.currentTarget
@onCloseClick()
onCloseClick: ->
@props.onCloseClick()
renderLayer: (afterTransition) ->
className = cx
'lite-new-modal': true
"is-for-#{ @props.name }": @props.name... | CoffeeScript | CoffeeScript | jianliaoim/talk-os | talk-web/client/module/new-modal.coffee | MIT | 2545c4497865779a55762e03963a39237df9046b | 2,703 | https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-web/client/module/new-modal.coffee | 1 | 50 |
soyjavi/QuoJS:src/quo.element.coffee:1:raw_corpus | raw_corpus | do ($$ = Quo) ->
$$.fn.attr = (name, value) ->
if this.length is 0
null
if $$.toType(name) is "string" and value is undefined
this[0].getAttribute name
else
@each -> @setAttribute name, value
$$.fn.removeAttr = (name) ->
@each -> @removeAttri... | CoffeeScript | soyjavi/QuoJS | src/quo.element.coffee | MIT | 524ede30f28d05215e765d3b71d4cc357f853e44 | 2,055 | https://github.com/soyjavi/QuoJS/blob/524ede30f28d05215e765d3b71d4cc357f853e44/src/quo.element.coffee | 1 | 50 | ||
soyjavi/QuoJS:src/quo.element.coffee:1:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
do ($$ = Quo) ->
$$.fn.attr = (name, value) ->
if this.length is 0
null
if $$.toType(name) is "string" and value is undefined
this[0].getAttribute name
else
@each -> @setAttribute name, value
$... | (function($$) {
$$.fn.attr = function(name, value) {
if (this.length === 0) {
null;
}
if ($$.toType(name) === "string" && value === void 0) {
return this[0].getAttribute(name);
} else {
return this.each(function() {
return this.setAttribute(name, value);
});
}
};
... | CoffeeScript | JavaScript | soyjavi/QuoJS | src/quo.element.coffee | MIT | 524ede30f28d05215e765d3b71d4cc357f853e44 | 2,055 | https://github.com/soyjavi/QuoJS/blob/524ede30f28d05215e765d3b71d4cc357f853e44/src/quo.element.coffee | 1 | 50 |
soyjavi/QuoJS:src/quo.element.coffee:1:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
(function($$) {
$$.fn.attr = function(name, value) {
if (this.length === 0) {
null;
}
if ($$.toType(name) === "string" && value === void 0) {
return this[0].getAttribute(name);
} else {
return this.each(function() {
retur... | do ($$ = Quo) ->
$$.fn.attr = (name, value) ->
if this.length is 0
null
if $$.toType(name) is "string" and value is undefined
this[0].getAttribute name
else
@each -> @setAttribute name, value
$$.fn.removeAttr = (name) ->
@each -> @removeAttri... | JavaScript | CoffeeScript | soyjavi/QuoJS | src/quo.element.coffee | MIT | 524ede30f28d05215e765d3b71d4cc357f853e44 | 2,055 | https://github.com/soyjavi/QuoJS/blob/524ede30f28d05215e765d3b71d4cc357f853e44/src/quo.element.coffee | 1 | 50 |
soyjavi/QuoJS:src/quo.element.coffee:1:completion | completion | do ($$ = Quo) ->
$$.fn.attr = (name, value) ->
if this.length is 0
null
if $$.toType(name) is "string" and value is undefined
this[0].getAttribute name
else
@each -> @setAttribute name, value
$$.fn.removeAttr = (name) ->
@each -> @removeAttri... | $$.fn.hide = -> @style "display", "none"
$$.fn.height = ->
offset = @offset()
offset.height
$$.fn.width = ->
offset = @offset()
offset.width
$$.fn.offset = ->
bounding = this[0].getBoundingClientRect()
left: bounding.left + window.pageXOffset
top: ... | CoffeeScript | CoffeeScript | soyjavi/QuoJS | src/quo.element.coffee | MIT | 524ede30f28d05215e765d3b71d4cc357f853e44 | 2,055 | https://github.com/soyjavi/QuoJS/blob/524ede30f28d05215e765d3b71d4cc357f853e44/src/quo.element.coffee | 1 | 50 |
soyjavi/QuoJS:src/quo.element.coffee:1:raw_corpus | raw_corpus | do ($$ = Quo) ->
$$.fn.attr = (name, value) ->
if this.length is 0
null
if $$.toType(name) is "string" and value is undefined
this[0].getAttribute name
else
@each -> @setAttribute name, value
$$.fn.removeAttr = (name) ->
@each -> @removeAttri... | CoffeeScript | soyjavi/QuoJS | src/quo.element.coffee | MIT | 3493a0942f6de0508eaf9d9ccb761c7ecab7c8f8 | 2,055 | https://github.com/soyjavi/QuoJS/blob/3493a0942f6de0508eaf9d9ccb761c7ecab7c8f8/src/quo.element.coffee | 1 | 45 | ||
soyjavi/QuoJS:src/quo.element.coffee:1:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
do ($$ = Quo) ->
$$.fn.attr = (name, value) ->
if this.length is 0
null
if $$.toType(name) is "string" and value is undefined
this[0].getAttribute name
else
@each -> @setAttribute name, value
$... | (function($$) {
$$.fn.attr = function(name, value) {
if (this.length === 0) {
null;
}
if ($$.toType(name) === "string" && value === void 0) {
return this[0].getAttribute(name);
} else {
return this.each(function() {
return this.setAttribute(name, value);
});
}
};
... | CoffeeScript | JavaScript | soyjavi/QuoJS | src/quo.element.coffee | MIT | 3493a0942f6de0508eaf9d9ccb761c7ecab7c8f8 | 2,055 | https://github.com/soyjavi/QuoJS/blob/3493a0942f6de0508eaf9d9ccb761c7ecab7c8f8/src/quo.element.coffee | 1 | 45 |
soyjavi/QuoJS:src/quo.element.coffee:1:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
(function($$) {
$$.fn.attr = function(name, value) {
if (this.length === 0) {
null;
}
if ($$.toType(name) === "string" && value === void 0) {
return this[0].getAttribute(name);
} else {
return this.each(function() {
retur... | do ($$ = Quo) ->
$$.fn.attr = (name, value) ->
if this.length is 0
null
if $$.toType(name) is "string" and value is undefined
this[0].getAttribute name
else
@each -> @setAttribute name, value
$$.fn.removeAttr = (name) ->
@each -> @removeAttri... | JavaScript | CoffeeScript | soyjavi/QuoJS | src/quo.element.coffee | MIT | 3493a0942f6de0508eaf9d9ccb761c7ecab7c8f8 | 2,055 | https://github.com/soyjavi/QuoJS/blob/3493a0942f6de0508eaf9d9ccb761c7ecab7c8f8/src/quo.element.coffee | 1 | 45 |
soyjavi/QuoJS:src/quo.element.coffee:1:completion | completion | do ($$ = Quo) ->
$$.fn.attr = (name, value) ->
if this.length is 0
null
if $$.toType(name) is "string" and value is undefined
this[0].getAttribute name
else
@each -> @setAttribute name, value
$$.fn.removeAttr = (name) ->
@each -> @removeAttri... | $$.fn.show = -> @style "display", "block"
$$.fn.hide = -> @style "display", "none"
$$.fn.height = ->
offset = @offset()
offset.height
$$.fn.width = ->
offset = @offset()
offset.width
$$.fn.offset = ->
bounding = this[0].getBoundingClientRect()
left: b... | CoffeeScript | CoffeeScript | soyjavi/QuoJS | src/quo.element.coffee | MIT | 3493a0942f6de0508eaf9d9ccb761c7ecab7c8f8 | 2,055 | https://github.com/soyjavi/QuoJS/blob/3493a0942f6de0508eaf9d9ccb761c7ecab7c8f8/src/quo.element.coffee | 1 | 45 |
soyjavi/QuoJS:src/quo.element.coffee:1:raw_corpus | raw_corpus | do ($$ = Quo) ->
$$.fn.attr = (name, value) ->
if $$.toType(name) is "string" and value is undefined
this[0].getAttribute name
else
@each -> @setAttribute name, value
$$.fn.removeAttr = (name) ->
@each -> @removeAttribute name
$$.fn.data = (name, value) -> ... | CoffeeScript | soyjavi/QuoJS | src/quo.element.coffee | MIT | 16ffe8834cfcfd1fac35a01223a91bdc7eaadd33 | 2,055 | https://github.com/soyjavi/QuoJS/blob/16ffe8834cfcfd1fac35a01223a91bdc7eaadd33/src/quo.element.coffee | 1 | 43 | ||
soyjavi/QuoJS:src/quo.element.coffee:1:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
do ($$ = Quo) ->
$$.fn.attr = (name, value) ->
if $$.toType(name) is "string" and value is undefined
this[0].getAttribute name
else
@each -> @setAttribute name, value
$$.fn.removeAttr = (name) ->
@each -> ... | (function($$) {
$$.fn.attr = function(name, value) {
if ($$.toType(name) === "string" && value === void 0) {
return this[0].getAttribute(name);
} else {
return this.each(function() {
return this.setAttribute(name, value);
});
}
};
$$.fn.removeAttr = function(name) {
retur... | CoffeeScript | JavaScript | soyjavi/QuoJS | src/quo.element.coffee | MIT | 16ffe8834cfcfd1fac35a01223a91bdc7eaadd33 | 2,055 | https://github.com/soyjavi/QuoJS/blob/16ffe8834cfcfd1fac35a01223a91bdc7eaadd33/src/quo.element.coffee | 1 | 43 |
soyjavi/QuoJS:src/quo.element.coffee:1:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
(function($$) {
$$.fn.attr = function(name, value) {
if ($$.toType(name) === "string" && value === void 0) {
return this[0].getAttribute(name);
} else {
return this.each(function() {
return this.setAttribute(name, value);
});
... | do ($$ = Quo) ->
$$.fn.attr = (name, value) ->
if $$.toType(name) is "string" and value is undefined
this[0].getAttribute name
else
@each -> @setAttribute name, value
$$.fn.removeAttr = (name) ->
@each -> @removeAttribute name
$$.fn.data = (name, value) -> ... | JavaScript | CoffeeScript | soyjavi/QuoJS | src/quo.element.coffee | MIT | 16ffe8834cfcfd1fac35a01223a91bdc7eaadd33 | 2,055 | https://github.com/soyjavi/QuoJS/blob/16ffe8834cfcfd1fac35a01223a91bdc7eaadd33/src/quo.element.coffee | 1 | 43 |
soyjavi/QuoJS:src/quo.element.coffee:1:completion | completion | do ($$ = Quo) ->
$$.fn.attr = (name, value) ->
if $$.toType(name) is "string" and value is undefined
this[0].getAttribute name
else
@each -> @setAttribute name, value
$$.fn.removeAttr = (name) ->
@each -> @removeAttribute name
$$.fn.data = (name, value) -> ... | $$.fn.show = -> @style "display", "block"
$$.fn.hide = -> @style "display", "none"
$$.fn.height = ->
offset = @offset()
offset.height
$$.fn.width = ->
offset = @offset()
offset.width
$$.fn.offset = ->
bounding = this[0].getBoundingClientRect()
left: b... | CoffeeScript | CoffeeScript | soyjavi/QuoJS | src/quo.element.coffee | MIT | 16ffe8834cfcfd1fac35a01223a91bdc7eaadd33 | 2,055 | https://github.com/soyjavi/QuoJS/blob/16ffe8834cfcfd1fac35a01223a91bdc7eaadd33/src/quo.element.coffee | 1 | 43 |
soyjavi/QuoJS:src/quo.element.coffee:1:raw_corpus | raw_corpus | ###
QuoJS
(c) 2011, 2012 Javi Jiménez Villar (@soyjavi)
http://quojs.tapquo.com
###
(($$) ->
$$.fn.attr = (name, value) ->
if $$.toType(name) is "string" and value is undefined
this[0].getAttribute name
else
@each -> @setAttribute name, value
$$.fn.data = (name, ... | CoffeeScript | soyjavi/QuoJS | src/quo.element.coffee | MIT | 3742ee4605295dc1823773b55a3ab9f34cdd021a | 2,055 | https://github.com/soyjavi/QuoJS/blob/3742ee4605295dc1823773b55a3ab9f34cdd021a/src/quo.element.coffee | 1 | 48 | ||
soyjavi/QuoJS:src/quo.element.coffee:1:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
###
QuoJS
(c) 2011, 2012 Javi Jiménez Villar (@soyjavi)
http://quojs.tapquo.com
###
(($$) ->
$$.fn.attr = (name, value) ->
if $$.toType(name) is "string" and value is undefined
this[0].getAttribute name
else
@ea... | /*
QuoJS
(c) 2011, 2012 Javi Jiménez Villar (@soyjavi)
http://quojs.tapquo.com
*/
(function($$) {
$$.fn.attr = function(name, value) {
if ($$.toType(name) === "string" && value === void 0) {
return this[0].getAttribute(name);
} else {
return this.each(function() {
return this.setAttr... | CoffeeScript | JavaScript | soyjavi/QuoJS | src/quo.element.coffee | MIT | 3742ee4605295dc1823773b55a3ab9f34cdd021a | 2,055 | https://github.com/soyjavi/QuoJS/blob/3742ee4605295dc1823773b55a3ab9f34cdd021a/src/quo.element.coffee | 1 | 48 |
soyjavi/QuoJS:src/quo.element.coffee:1:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
/*
QuoJS
(c) 2011, 2012 Javi Jiménez Villar (@soyjavi)
http://quojs.tapquo.com
*/
(function($$) {
$$.fn.attr = function(name, value) {
if ($$.toType(name) === "string" && value === void 0) {
return this[0].getAttribute(name);
} else {
re... | ###
QuoJS
(c) 2011, 2012 Javi Jiménez Villar (@soyjavi)
http://quojs.tapquo.com
###
(($$) ->
$$.fn.attr = (name, value) ->
if $$.toType(name) is "string" and value is undefined
this[0].getAttribute name
else
@each -> @setAttribute name, value
$$.fn.data = (name, ... | JavaScript | CoffeeScript | soyjavi/QuoJS | src/quo.element.coffee | MIT | 3742ee4605295dc1823773b55a3ab9f34cdd021a | 2,055 | https://github.com/soyjavi/QuoJS/blob/3742ee4605295dc1823773b55a3ab9f34cdd021a/src/quo.element.coffee | 1 | 48 |
soyjavi/QuoJS:src/quo.element.coffee:1:completion | completion | ###
QuoJS
(c) 2011, 2012 Javi Jiménez Villar (@soyjavi)
http://quojs.tapquo.com
###
(($$) ->
$$.fn.attr = (name, value) ->
if $$.toType(name) is "string" and value is undefined
this[0].getAttribute name
else
@each -> @setAttribute name, value
$$.fn.data = (name, ... | $$.fn.hide = -> @style "display", "none"
$$.fn.height = ->
offset = @offset()
offset.height
$$.fn.width = ->
offset = @offset()
offset.width
$$.fn.offset = ->
bounding = this[0].getBoundingClientRect()
left: bounding.left + window.pageXOffset
top: ... | CoffeeScript | CoffeeScript | soyjavi/QuoJS | src/quo.element.coffee | MIT | 3742ee4605295dc1823773b55a3ab9f34cdd021a | 2,055 | https://github.com/soyjavi/QuoJS/blob/3742ee4605295dc1823773b55a3ab9f34cdd021a/src/quo.element.coffee | 1 | 48 |
soyjavi/QuoJS:src/quo.element.coffee:1:raw_corpus | raw_corpus | ###
QuoJS 2.2.0
(c) 2011, 2012 Javi Jiménez Villar (@soyjavi)
http://quojs.tapquo.com
###
(($$) ->
$$.fn.attr = (name, value) ->
if $$.toType(name) is "string" and value is undefined
this[0].getAttribute name
else
@each -> @setAttribute name, value
$$.fn.data = (... | CoffeeScript | soyjavi/QuoJS | src/quo.element.coffee | MIT | e640f494375e859b542ad25aaa2b6f7682ab941b | 2,055 | https://github.com/soyjavi/QuoJS/blob/e640f494375e859b542ad25aaa2b6f7682ab941b/src/quo.element.coffee | 1 | 48 | ||
soyjavi/QuoJS:src/quo.element.coffee:1:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
###
QuoJS 2.2.0
(c) 2011, 2012 Javi Jiménez Villar (@soyjavi)
http://quojs.tapquo.com
###
(($$) ->
$$.fn.attr = (name, value) ->
if $$.toType(name) is "string" and value is undefined
this[0].getAttribute name
else
... | /*
QuoJS 2.2.0
(c) 2011, 2012 Javi Jiménez Villar (@soyjavi)
http://quojs.tapquo.com
*/
(function($$) {
$$.fn.attr = function(name, value) {
if ($$.toType(name) === "string" && value === void 0) {
return this[0].getAttribute(name);
} else {
return this.each(function() {
return this.s... | CoffeeScript | JavaScript | soyjavi/QuoJS | src/quo.element.coffee | MIT | e640f494375e859b542ad25aaa2b6f7682ab941b | 2,055 | https://github.com/soyjavi/QuoJS/blob/e640f494375e859b542ad25aaa2b6f7682ab941b/src/quo.element.coffee | 1 | 48 |
soyjavi/QuoJS:src/quo.element.coffee:1:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
/*
QuoJS 2.2.0
(c) 2011, 2012 Javi Jiménez Villar (@soyjavi)
http://quojs.tapquo.com
*/
(function($$) {
$$.fn.attr = function(name, value) {
if ($$.toType(name) === "string" && value === void 0) {
return this[0].getAttribute(name);
} else {
... | ###
QuoJS 2.2.0
(c) 2011, 2012 Javi Jiménez Villar (@soyjavi)
http://quojs.tapquo.com
###
(($$) ->
$$.fn.attr = (name, value) ->
if $$.toType(name) is "string" and value is undefined
this[0].getAttribute name
else
@each -> @setAttribute name, value
$$.fn.data = (... | JavaScript | CoffeeScript | soyjavi/QuoJS | src/quo.element.coffee | MIT | e640f494375e859b542ad25aaa2b6f7682ab941b | 2,055 | https://github.com/soyjavi/QuoJS/blob/e640f494375e859b542ad25aaa2b6f7682ab941b/src/quo.element.coffee | 1 | 48 |
soyjavi/QuoJS:src/quo.element.coffee:1:completion | completion | ###
QuoJS 2.2.0
(c) 2011, 2012 Javi Jiménez Villar (@soyjavi)
http://quojs.tapquo.com
###
(($$) ->
$$.fn.attr = (name, value) ->
if $$.toType(name) is "string" and value is undefined
this[0].getAttribute name
else
@each -> @setAttribute name, value
$$.fn.data = (... | $$.fn.hide = -> @style "display", "none"
$$.fn.height = ->
offset = @offset()
offset.height
$$.fn.width = ->
offset = @offset()
offset.width
$$.fn.offset = ->
bounding = this[0].getBoundingClientRect()
left: bounding.left + window.pageXOffset
top: ... | CoffeeScript | CoffeeScript | soyjavi/QuoJS | src/quo.element.coffee | MIT | e640f494375e859b542ad25aaa2b6f7682ab941b | 2,055 | https://github.com/soyjavi/QuoJS/blob/e640f494375e859b542ad25aaa2b6f7682ab941b/src/quo.element.coffee | 1 | 48 |
soyjavi/QuoJS:src/quo.element.coffee:1:raw_corpus | raw_corpus | ###
QuoJS 2.1
(c) 2011, 2012 Javi Jiménez Villar (@soyjavi)
http://quojs.tapquo.com
###
(($$) ->
$$.fn.attr = (name, value) ->
if $$.toType(name) is "string" and value is undefined
this[0].getAttribute name
else
@each -> @setAttribute name, value
$$.fn.data = (na... | CoffeeScript | soyjavi/QuoJS | src/quo.element.coffee | MIT | 5a6b42ff3e1a702de76dbc80dcce375ff236e0cb | 2,055 | https://github.com/soyjavi/QuoJS/blob/5a6b42ff3e1a702de76dbc80dcce375ff236e0cb/src/quo.element.coffee | 1 | 48 | ||
soyjavi/QuoJS:src/quo.element.coffee:1:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
###
QuoJS 2.1
(c) 2011, 2012 Javi Jiménez Villar (@soyjavi)
http://quojs.tapquo.com
###
(($$) ->
$$.fn.attr = (name, value) ->
if $$.toType(name) is "string" and value is undefined
this[0].getAttribute name
else
... | /*
QuoJS 2.1
(c) 2011, 2012 Javi Jiménez Villar (@soyjavi)
http://quojs.tapquo.com
*/
(function($$) {
$$.fn.attr = function(name, value) {
if ($$.toType(name) === "string" && value === void 0) {
return this[0].getAttribute(name);
} else {
return this.each(function() {
return this.set... | CoffeeScript | JavaScript | soyjavi/QuoJS | src/quo.element.coffee | MIT | 5a6b42ff3e1a702de76dbc80dcce375ff236e0cb | 2,055 | https://github.com/soyjavi/QuoJS/blob/5a6b42ff3e1a702de76dbc80dcce375ff236e0cb/src/quo.element.coffee | 1 | 48 |
soyjavi/QuoJS:src/quo.element.coffee:1:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
/*
QuoJS 2.1
(c) 2011, 2012 Javi Jiménez Villar (@soyjavi)
http://quojs.tapquo.com
*/
(function($$) {
$$.fn.attr = function(name, value) {
if ($$.toType(name) === "string" && value === void 0) {
return this[0].getAttribute(name);
} else {
... | ###
QuoJS 2.1
(c) 2011, 2012 Javi Jiménez Villar (@soyjavi)
http://quojs.tapquo.com
###
(($$) ->
$$.fn.attr = (name, value) ->
if $$.toType(name) is "string" and value is undefined
this[0].getAttribute name
else
@each -> @setAttribute name, value
$$.fn.data = (na... | JavaScript | CoffeeScript | soyjavi/QuoJS | src/quo.element.coffee | MIT | 5a6b42ff3e1a702de76dbc80dcce375ff236e0cb | 2,055 | https://github.com/soyjavi/QuoJS/blob/5a6b42ff3e1a702de76dbc80dcce375ff236e0cb/src/quo.element.coffee | 1 | 48 |
soyjavi/QuoJS:src/quo.element.coffee:1:completion | completion | ###
QuoJS 2.1
(c) 2011, 2012 Javi Jiménez Villar (@soyjavi)
http://quojs.tapquo.com
###
(($$) ->
$$.fn.attr = (name, value) ->
if $$.toType(name) is "string" and value is undefined
this[0].getAttribute name
else
@each -> @setAttribute name, value
$$.fn.data = (na... | $$.fn.hide = -> @style "display", "none"
$$.fn.height = ->
offset = @offset()
offset.height
$$.fn.width = ->
offset = @offset()
offset.width
$$.fn.offset = ->
bounding = this[0].getBoundingClientRect()
left: bounding.left + window.pageXOffset
top: ... | CoffeeScript | CoffeeScript | soyjavi/QuoJS | src/quo.element.coffee | MIT | 5a6b42ff3e1a702de76dbc80dcce375ff236e0cb | 2,055 | https://github.com/soyjavi/QuoJS/blob/5a6b42ff3e1a702de76dbc80dcce375ff236e0cb/src/quo.element.coffee | 1 | 48 |
soyjavi/QuoJS:src/quo.element.coffee:1:raw_corpus | raw_corpus | ###
QuoJS 2.1
(c) 2011, 2012 Javi Jiménez Villar (@soyjavi)
http://quojs.tapquo.com
###
(($$) ->
$$.fn.attr = (name, value) ->
if $$.toType(name) is "string" and value is undefined
this[0].getAttribute name
else
@each -> @setAttribute name, value
$$.fn.data = (na... | CoffeeScript | soyjavi/QuoJS | src/quo.element.coffee | MIT | 6c826ffa6d74267c88b9ed09493ef7ad0c913126 | 2,055 | https://github.com/soyjavi/QuoJS/blob/6c826ffa6d74267c88b9ed09493ef7ad0c913126/src/quo.element.coffee | 1 | 50 | ||
soyjavi/QuoJS:src/quo.element.coffee:1:completion | completion | ###
QuoJS 2.1
(c) 2011, 2012 Javi Jiménez Villar (@soyjavi)
http://quojs.tapquo.com
###
(($$) ->
$$.fn.attr = (name, value) ->
if $$.toType(name) is "string" and value is undefined
this[0].getAttribute name
else
@each -> @setAttribute name, value
$$.fn.data = (na... | $$.fn.hide = -> @style "display", "none"
$$.fn.toggle = ->
@style "display", if @style "display" is "block" then "none" else "block"
$$.fn.height = ->
offset = @offset()
offset.height
$$.fn.width = ->
offset = @offset()
offset.width
$$.fn.offset = ->
b... | CoffeeScript | CoffeeScript | soyjavi/QuoJS | src/quo.element.coffee | MIT | 6c826ffa6d74267c88b9ed09493ef7ad0c913126 | 2,055 | https://github.com/soyjavi/QuoJS/blob/6c826ffa6d74267c88b9ed09493ef7ad0c913126/src/quo.element.coffee | 1 | 50 |
jianliaoim/talk-os:talk-web/client/module/time-divider.coffee:1:raw_corpus | raw_corpus | React = require 'react'
time = require '../util/time'
PureRenderMixin = require 'react-addons-pure-render-mixin'
div = React.createFactory 'div'
span = React.createFactory 'span'
hr = React.createFactory 'hr'
T = React.PropTypes
module.exports = React.createClass
displayName: 'time-divider'
mixins: [PureRende... | CoffeeScript | jianliaoim/talk-os | talk-web/client/module/time-divider.coffee | MIT | 2545c4497865779a55762e03963a39237df9046b | 2,703 | https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-web/client/module/time-divider.coffee | 1 | 23 | ||
jianliaoim/talk-os:talk-web/client/module/time-divider.coffee:1:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
React = require 'react'
time = require '../util/time'
PureRenderMixin = require 'react-addons-pure-render-mixin'
div = React.createFactory 'div'
span = React.createFactory 'span'
hr = React.createFactory 'hr'
T = React.PropTypes
module.exports = React.creat... | var PureRenderMixin, React, T, div, hr, span, time;
React = require('react');
time = require('../util/time');
PureRenderMixin = require('react-addons-pure-render-mixin');
div = React.createFactory('div');
span = React.createFactory('span');
hr = React.createFactory('hr');
T = React.PropTypes;
module.exports = R... | CoffeeScript | JavaScript | jianliaoim/talk-os | talk-web/client/module/time-divider.coffee | MIT | 2545c4497865779a55762e03963a39237df9046b | 2,703 | https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-web/client/module/time-divider.coffee | 1 | 23 |
jianliaoim/talk-os:talk-web/client/module/time-divider.coffee:1:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
var PureRenderMixin, React, T, div, hr, span, time;
React = require('react');
time = require('../util/time');
PureRenderMixin = require('react-addons-pure-render-mixin');
div = React.createFactory('div');
span = React.createFactory('span');
hr = React.createF... | React = require 'react'
time = require '../util/time'
PureRenderMixin = require 'react-addons-pure-render-mixin'
div = React.createFactory 'div'
span = React.createFactory 'span'
hr = React.createFactory 'hr'
T = React.PropTypes
module.exports = React.createClass
displayName: 'time-divider'
mixins: [PureRende... | JavaScript | CoffeeScript | jianliaoim/talk-os | talk-web/client/module/time-divider.coffee | MIT | 2545c4497865779a55762e03963a39237df9046b | 2,703 | https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-web/client/module/time-divider.coffee | 1 | 23 |
jianliaoim/talk-os:talk-web/client/module/time-divider.coffee:1:completion | completion | React = require 'react'
time = require '../util/time'
PureRenderMixin = require 'react-addons-pure-render-mixin'
div = React.createFactory 'div'
span = React.createFactory 'span'
hr = React.createFactory 'hr'
T = React.PropTypes
module.exports = React.createClass | displayName: 'time-divider'
mixins: [PureRenderMixin]
propTypes:
data: T.string.isRequired
render: ->
text = time.formatDayGap @props.data
div className: 'time-divider muted flex-horiz flex-vcenter',
hr className: 'flex-fill'
span className: 'time flex-static', text | CoffeeScript | CoffeeScript | jianliaoim/talk-os | talk-web/client/module/time-divider.coffee | MIT | 2545c4497865779a55762e03963a39237df9046b | 2,703 | https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-web/client/module/time-divider.coffee | 1 | 23 |
jashkenas/coffeescript:src/cake.coffee:1:raw_corpus | raw_corpus | exports.run = ->
global.__originalDirname = fs.realpathSync '.'
process.chdir cakefileDirectory __originalDirname
args = process.argv[2..]
CoffeeScript.run fs.readFileSync('Cakefile').toString(), filename: 'Cakefile'
oparse = new optparse.OptionParser switches
return printTasks() unless args.length
try
... | CoffeeScript | jashkenas/coffeescript | src/cake.coffee | MIT | 817c39a13065a900725943c33a79252a69d779e2 | 16,577 | https://github.com/jashkenas/coffeescript/blob/817c39a13065a900725943c33a79252a69d779e2/src/cake.coffee | 49 | 62 | ||
jashkenas/coffeescript:src/cake.coffee:1:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
exports.run = ->
global.__originalDirname = fs.realpathSync '.'
process.chdir cakefileDirectory __originalDirname
args = process.argv[2..]
CoffeeScript.run fs.readFileSync('Cakefile').toString(), filename: 'Cakefile'
oparse = new optparse.OptionParser s... | exports.run = function() {
var arg, args, e, i, len, oparse, options, ref, results;
global.__originalDirname = fs.realpathSync('.');
process.chdir(cakefileDirectory(__originalDirname));
args = process.argv.slice(2);
CoffeeScript.run(fs.readFileSync('Cakefile').toString(), {
filename: 'Cakefile'
});
op... | CoffeeScript | JavaScript | jashkenas/coffeescript | src/cake.coffee | MIT | 817c39a13065a900725943c33a79252a69d779e2 | 16,577 | https://github.com/jashkenas/coffeescript/blob/817c39a13065a900725943c33a79252a69d779e2/src/cake.coffee | 49 | 62 |
jashkenas/coffeescript:src/cake.coffee:1:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
exports.run = function() {
var arg, args, e, i, len, oparse, options, ref, results;
global.__originalDirname = fs.realpathSync('.');
process.chdir(cakefileDirectory(__originalDirname));
args = process.argv.slice(2);
CoffeeScript.run(fs.readFileSync('Cakef... | exports.run = ->
global.__originalDirname = fs.realpathSync '.'
process.chdir cakefileDirectory __originalDirname
args = process.argv[2..]
CoffeeScript.run fs.readFileSync('Cakefile').toString(), filename: 'Cakefile'
oparse = new optparse.OptionParser switches
return printTasks() unless args.length
try
... | JavaScript | CoffeeScript | jashkenas/coffeescript | src/cake.coffee | MIT | 817c39a13065a900725943c33a79252a69d779e2 | 16,577 | https://github.com/jashkenas/coffeescript/blob/817c39a13065a900725943c33a79252a69d779e2/src/cake.coffee | 49 | 62 |
jashkenas/coffeescript:src/cake.coffee:1:completion | completion | exports.run = ->
global.__originalDirname = fs.realpathSync '.'
process.chdir cakefileDirectory __originalDirname
args = process.argv[2..]
CoffeeScript.run fs.readFileSync('Cakefile').toString(), filename: 'Cakefile'
oparse = new optparse.OptionParser switches
return printTasks() unless args.length | try
options = oparse.parse(args)
catch e
return fatalError "#{e}"
invoke arg for arg in options.arguments
# Display the list of Cake tasks in a format similar to `rake -T` | CoffeeScript | CoffeeScript | jashkenas/coffeescript | src/cake.coffee | MIT | 817c39a13065a900725943c33a79252a69d779e2 | 16,577 | https://github.com/jashkenas/coffeescript/blob/817c39a13065a900725943c33a79252a69d779e2/src/cake.coffee | 49 | 62 |
jashkenas/coffeescript:src/cake.coffee:2:raw_corpus | raw_corpus | printTasks = ->
relative = path.relative or path.resolve
cakefilePath = path.join relative(__originalDirname, process.cwd()), 'Cakefile'
console.log "#{cakefilePath} defines the following tasks:\n"
for name, task of tasks
spaces = 20 - name.length
spaces = if spaces > 0 then Array(spaces + 1).join(' ') ... | CoffeeScript | jashkenas/coffeescript | src/cake.coffee | MIT | 817c39a13065a900725943c33a79252a69d779e2 | 16,577 | https://github.com/jashkenas/coffeescript/blob/817c39a13065a900725943c33a79252a69d779e2/src/cake.coffee | 63 | 74 | ||
jashkenas/coffeescript:src/cake.coffee:2:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
printTasks = ->
relative = path.relative or path.resolve
cakefilePath = path.join relative(__originalDirname, process.cwd()), 'Cakefile'
console.log "#{cakefilePath} defines the following tasks:\n"
for name, task of tasks
spaces = 20 - name.length
... | var printTasks;
printTasks = function() {
var cakefilePath, desc, name, relative, spaces, task;
relative = path.relative || path.resolve;
cakefilePath = path.join(relative(__originalDirname, process.cwd()), 'Cakefile');
console.log(`${cakefilePath} defines the following tasks:\n`);
for (name in tasks) {
... | CoffeeScript | JavaScript | jashkenas/coffeescript | src/cake.coffee | MIT | 817c39a13065a900725943c33a79252a69d779e2 | 16,577 | https://github.com/jashkenas/coffeescript/blob/817c39a13065a900725943c33a79252a69d779e2/src/cake.coffee | 63 | 74 |
jashkenas/coffeescript:src/cake.coffee:2:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
var printTasks;
printTasks = function() {
var cakefilePath, desc, name, relative, spaces, task;
relative = path.relative || path.resolve;
cakefilePath = path.join(relative(__originalDirname, process.cwd()), 'Cakefile');
console.log(`${cakefilePath} defines... | printTasks = ->
relative = path.relative or path.resolve
cakefilePath = path.join relative(__originalDirname, process.cwd()), 'Cakefile'
console.log "#{cakefilePath} defines the following tasks:\n"
for name, task of tasks
spaces = 20 - name.length
spaces = if spaces > 0 then Array(spaces + 1).join(' ') ... | JavaScript | CoffeeScript | jashkenas/coffeescript | src/cake.coffee | MIT | 817c39a13065a900725943c33a79252a69d779e2 | 16,577 | https://github.com/jashkenas/coffeescript/blob/817c39a13065a900725943c33a79252a69d779e2/src/cake.coffee | 63 | 74 |
jashkenas/coffeescript:src/cake.coffee:2:completion | completion | printTasks = ->
relative = path.relative or path.resolve
cakefilePath = path.join relative(__originalDirname, process.cwd()), 'Cakefile'
console.log "#{cakefilePath} defines the following tasks:\n"
for name, task of tasks
spaces = 20 - name.length | spaces = if spaces > 0 then Array(spaces + 1).join(' ') else ''
desc = if task.description then "# #{task.description}" else ''
console.log "cake #{name}#{spaces} #{desc}"
console.log oparse.help() if switches.length
# Print an error and exit when attempting to use an invalid task/option. | CoffeeScript | CoffeeScript | jashkenas/coffeescript | src/cake.coffee | MIT | 817c39a13065a900725943c33a79252a69d779e2 | 16,577 | https://github.com/jashkenas/coffeescript/blob/817c39a13065a900725943c33a79252a69d779e2/src/cake.coffee | 63 | 74 |
jashkenas/coffeescript:src/cake.coffee:3:raw_corpus | raw_corpus | fatalError = (message) ->
console.error message + '\n'
console.log 'To see a list of all tasks/options, run "cake"'
process.exit 1 | CoffeeScript | jashkenas/coffeescript | src/cake.coffee | MIT | 817c39a13065a900725943c33a79252a69d779e2 | 16,577 | https://github.com/jashkenas/coffeescript/blob/817c39a13065a900725943c33a79252a69d779e2/src/cake.coffee | 75 | 78 | ||
jashkenas/coffeescript:src/cake.coffee:3:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
fatalError = (message) ->
console.error message + '\n'
console.log 'To see a list of all tasks/options, run "cake"'
process.exit 1
``` | var fatalError;
fatalError = function(message) {
console.error(message + '\n');
console.log('To see a list of all tasks/options, run "cake"');
return process.exit(1);
}; | CoffeeScript | JavaScript | jashkenas/coffeescript | src/cake.coffee | MIT | 817c39a13065a900725943c33a79252a69d779e2 | 16,577 | https://github.com/jashkenas/coffeescript/blob/817c39a13065a900725943c33a79252a69d779e2/src/cake.coffee | 75 | 78 |
jashkenas/coffeescript:src/cake.coffee:3:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
var fatalError;
fatalError = function(message) {
console.error(message + '\n');
console.log('To see a list of all tasks/options, run "cake"');
return process.exit(1);
};
``` | fatalError = (message) ->
console.error message + '\n'
console.log 'To see a list of all tasks/options, run "cake"'
process.exit 1 | JavaScript | CoffeeScript | jashkenas/coffeescript | src/cake.coffee | MIT | 817c39a13065a900725943c33a79252a69d779e2 | 16,577 | https://github.com/jashkenas/coffeescript/blob/817c39a13065a900725943c33a79252a69d779e2/src/cake.coffee | 75 | 78 |
jashkenas/coffeescript:src/cake.coffee:3:completion | completion | fatalError = (message) ->
console.error message + '\n' | console.log 'To see a list of all tasks/options, run "cake"'
process.exit 1 | CoffeeScript | CoffeeScript | jashkenas/coffeescript | src/cake.coffee | MIT | 817c39a13065a900725943c33a79252a69d779e2 | 16,577 | https://github.com/jashkenas/coffeescript/blob/817c39a13065a900725943c33a79252a69d779e2/src/cake.coffee | 75 | 78 |
jashkenas/coffeescript:src/cake.coffee:5:raw_corpus | raw_corpus | cakefileDirectory = (dir) ->
return dir if fs.existsSync path.join dir, 'Cakefile'
parent = path.normalize path.join dir, '..'
return cakefileDirectory parent unless parent is dir
throw new Error "Cakefile not found in #{process.cwd()}" | CoffeeScript | jashkenas/coffeescript | src/cake.coffee | MIT | 817c39a13065a900725943c33a79252a69d779e2 | 16,577 | https://github.com/jashkenas/coffeescript/blob/817c39a13065a900725943c33a79252a69d779e2/src/cake.coffee | 84 | 88 | ||
jashkenas/coffeescript:src/cake.coffee:5:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
cakefileDirectory = (dir) ->
return dir if fs.existsSync path.join dir, 'Cakefile'
parent = path.normalize path.join dir, '..'
return cakefileDirectory parent unless parent is dir
throw new Error "Cakefile not found in #{process.cwd()}"
``` | var cakefileDirectory;
cakefileDirectory = function(dir) {
var parent;
if (fs.existsSync(path.join(dir, 'Cakefile'))) {
return dir;
}
parent = path.normalize(path.join(dir, '..'));
if (parent !== dir) {
return cakefileDirectory(parent);
}
throw new Error(`Cakefile not found in ${process.cwd()}`);... | CoffeeScript | JavaScript | jashkenas/coffeescript | src/cake.coffee | MIT | 817c39a13065a900725943c33a79252a69d779e2 | 16,577 | https://github.com/jashkenas/coffeescript/blob/817c39a13065a900725943c33a79252a69d779e2/src/cake.coffee | 84 | 88 |
jashkenas/coffeescript:src/cake.coffee:5:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
var cakefileDirectory;
cakefileDirectory = function(dir) {
var parent;
if (fs.existsSync(path.join(dir, 'Cakefile'))) {
return dir;
}
parent = path.normalize(path.join(dir, '..'));
if (parent !== dir) {
return cakefileDirectory(parent);
}
thr... | cakefileDirectory = (dir) ->
return dir if fs.existsSync path.join dir, 'Cakefile'
parent = path.normalize path.join dir, '..'
return cakefileDirectory parent unless parent is dir
throw new Error "Cakefile not found in #{process.cwd()}" | JavaScript | CoffeeScript | jashkenas/coffeescript | src/cake.coffee | MIT | 817c39a13065a900725943c33a79252a69d779e2 | 16,577 | https://github.com/jashkenas/coffeescript/blob/817c39a13065a900725943c33a79252a69d779e2/src/cake.coffee | 84 | 88 |
jashkenas/coffeescript:src/cake.coffee:5:completion | completion | cakefileDirectory = (dir) ->
return dir if fs.existsSync path.join dir, 'Cakefile' | parent = path.normalize path.join dir, '..'
return cakefileDirectory parent unless parent is dir
throw new Error "Cakefile not found in #{process.cwd()}" | CoffeeScript | CoffeeScript | jashkenas/coffeescript | src/cake.coffee | MIT | 817c39a13065a900725943c33a79252a69d779e2 | 16,577 | https://github.com/jashkenas/coffeescript/blob/817c39a13065a900725943c33a79252a69d779e2/src/cake.coffee | 84 | 88 |
jianliaoim/talk-os:talk-api2x/server/components/schedule.coffee:1:raw_corpus | raw_corpus | schedule =
addTask: (task) ->
Promise.resolve().then ->
task.executeAt = new Date(task.executeAt).getTime()
throw new Err('PARAMS_INVALID', 'Task.executeAt') if isNaN(task.executeAt)
task.id or= "#{task.action}#{shortid()}"
logger.info 'Add task', task.id
redis.multi()
.hs... | CoffeeScript | jianliaoim/talk-os | talk-api2x/server/components/schedule.coffee | MIT | 2545c4497865779a55762e03963a39237df9046b | 2,703 | https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-api2x/server/components/schedule.coffee | 10 | 59 | ||
jianliaoim/talk-os:talk-api2x/server/components/schedule.coffee:1:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
schedule =
addTask: (task) ->
Promise.resolve().then ->
task.executeAt = new Date(task.executeAt).getTime()
throw new Err('PARAMS_INVALID', 'Task.executeAt') if isNaN(task.executeAt)
task.id or= "#{task.action}#{shortid()}"
logge... | var schedule;
schedule = {
addTask: function(task) {
return Promise.resolve().then(function() {
task.executeAt = new Date(task.executeAt).getTime();
if (isNaN(task.executeAt)) {
throw new Err('PARAMS_INVALID', 'Task.executeAt');
}
task.id || (task.id = `${task.action}${shortid()}`... | CoffeeScript | JavaScript | jianliaoim/talk-os | talk-api2x/server/components/schedule.coffee | MIT | 2545c4497865779a55762e03963a39237df9046b | 2,703 | https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-api2x/server/components/schedule.coffee | 10 | 59 |
jianliaoim/talk-os:talk-api2x/server/components/schedule.coffee:1:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
var schedule;
schedule = {
addTask: function(task) {
return Promise.resolve().then(function() {
task.executeAt = new Date(task.executeAt).getTime();
if (isNaN(task.executeAt)) {
throw new Err('PARAMS_INVALID', 'Task.executeAt');
}
... | schedule =
addTask: (task) ->
Promise.resolve().then ->
task.executeAt = new Date(task.executeAt).getTime()
throw new Err('PARAMS_INVALID', 'Task.executeAt') if isNaN(task.executeAt)
task.id or= "#{task.action}#{shortid()}"
logger.info 'Add task', task.id
redis.multi()
.hs... | JavaScript | CoffeeScript | jianliaoim/talk-os | talk-api2x/server/components/schedule.coffee | MIT | 2545c4497865779a55762e03963a39237df9046b | 2,703 | https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-api2x/server/components/schedule.coffee | 10 | 59 |
jianliaoim/talk-os:talk-api2x/server/components/schedule.coffee:1:completion | completion | schedule =
addTask: (task) ->
Promise.resolve().then ->
task.executeAt = new Date(task.executeAt).getTime()
throw new Err('PARAMS_INVALID', 'Task.executeAt') if isNaN(task.executeAt)
task.id or= "#{task.action}#{shortid()}"
logger.info 'Add task', task.id
redis.multi()
.hs... | .execAsync()
onTick: ->
now = Date.now()
redis.multi()
.zrangebyscore "scheduler:taskidlist", 0, now
.zremrangebyscore "scheduler:taskidlist", 0, now
.exec (err, [taskIds]) -> taskIds?.forEach schedule.runTask
###*
* Execute the task
* @param {String} taskId [description]
* @return {... | CoffeeScript | CoffeeScript | jianliaoim/talk-os | talk-api2x/server/components/schedule.coffee | MIT | 2545c4497865779a55762e03963a39237df9046b | 2,703 | https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-api2x/server/components/schedule.coffee | 10 | 59 |
jianliaoim/talk-os:talk-api2x/server/components/schedule.coffee:2:raw_corpus | raw_corpus | throw new Error("job missing: can not find the job by id #{taskId}") unless task
task = JSON.parse task
{id, action, args, executeAt} = task
args or= []
delay = executeAt - Date.now()
throw new Error("Job error [#{id}]: no such job") unless typeof jobs[action] is 'function'
_exec... | CoffeeScript | jianliaoim/talk-os | talk-api2x/server/components/schedule.coffee | MIT | 2545c4497865779a55762e03963a39237df9046b | 2,703 | https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-api2x/server/components/schedule.coffee | 60 | 83 | ||
jianliaoim/talk-os:talk-api2x/server/components/schedule.coffee:2:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
throw new Error("job missing: can not find the job by id #{taskId}") unless task
task = JSON.parse task
{id, action, args, executeAt} = task
args or= []
delay = executeAt - Date.now()
throw new Error("Job error [#{id}]: no such jo... | var _execute, action, args, delay, executeAt, id, task;
throw new Error(`job missing: can not find the job by id ${taskId}`)((function() {
if (!task) {
task = JSON.parse(task);
({id, action, args, executeAt} = task);
args || (args = []);
delay = executeAt - Date.now();
if (typeof jobs[action] !==... | CoffeeScript | JavaScript | jianliaoim/talk-os | talk-api2x/server/components/schedule.coffee | MIT | 2545c4497865779a55762e03963a39237df9046b | 2,703 | https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-api2x/server/components/schedule.coffee | 60 | 83 |
jianliaoim/talk-os:talk-api2x/server/components/schedule.coffee:2:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
var _execute, action, args, delay, executeAt, id, task;
throw new Error(`job missing: can not find the job by id ${taskId}`)((function() {
if (!task) {
task = JSON.parse(task);
({id, action, args, executeAt} = task);
args || (args = []);
delay = ... | throw new Error("job missing: can not find the job by id #{taskId}") unless task
task = JSON.parse task
{id, action, args, executeAt} = task
args or= []
delay = executeAt - Date.now()
throw new Error("Job error [#{id}]: no such job") unless typeof jobs[action] is 'function'
_exec... | JavaScript | CoffeeScript | jianliaoim/talk-os | talk-api2x/server/components/schedule.coffee | MIT | 2545c4497865779a55762e03963a39237df9046b | 2,703 | https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-api2x/server/components/schedule.coffee | 60 | 83 |
jianliaoim/talk-os:talk-api2x/server/components/schedule.coffee:2:completion | completion | throw new Error("job missing: can not find the job by id #{taskId}") unless task
task = JSON.parse task
{id, action, args, executeAt} = task
args or= []
delay = executeAt - Date.now()
throw new Error("Job error [#{id}]: no such job") unless typeof jobs[action] is 'function'
_exec... | jobs[action].apply jobs, args
if delay > 0
Promise.delay(delay).then _execute
else
_execute()
.then -> logger.info "job finish [#{task.id}]"
.catch (err) -> logger.warn "#{err.stack}"
.then -> redis.hdelAsync 'scheduler:tasks', taskId | CoffeeScript | CoffeeScript | jianliaoim/talk-os | talk-api2x/server/components/schedule.coffee | MIT | 2545c4497865779a55762e03963a39237df9046b | 2,703 | https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-api2x/server/components/schedule.coffee | 60 | 83 |
jianliaoim/talk-os:talk-web/client/app/topic-settings.coffee:1:raw_corpus | raw_corpus | module.exports = React.createClass
displayName: 'topic-settings'
mixins: [mixinSubscribe, PureRenderMixin]
propTypes:
topic: T.instanceOf(Immutable.Map)
closeView: T.func.isRequired
getInitialState: ->
showComfirmModal: false
prefs: @getTopicPrefs()
componentDidMount: ->
@... | CoffeeScript | jianliaoim/talk-os | talk-web/client/app/topic-settings.coffee | MIT | 2545c4497865779a55762e03963a39237df9046b | 2,703 | https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-web/client/app/topic-settings.coffee | 31 | 80 | ||
jianliaoim/talk-os:talk-web/client/app/topic-settings.coffee:1:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
module.exports = React.createClass
displayName: 'topic-settings'
mixins: [mixinSubscribe, PureRenderMixin]
propTypes:
topic: T.instanceOf(Immutable.Map)
closeView: T.func.isRequired
getInitialState: ->
showComfirmModal: false
... | module.exports = React.createClass({
displayName: 'topic-settings',
mixins: [mixinSubscribe, PureRenderMixin],
propTypes: {
topic: T.instanceOf(Immutable.Map),
closeView: T.func.isRequired
},
getInitialState: function() {
return {
showComfirmModal: false,
prefs: this.getTopicPrefs()
... | CoffeeScript | JavaScript | jianliaoim/talk-os | talk-web/client/app/topic-settings.coffee | MIT | 2545c4497865779a55762e03963a39237df9046b | 2,703 | https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-web/client/app/topic-settings.coffee | 31 | 80 |
jianliaoim/talk-os:talk-web/client/app/topic-settings.coffee:1:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
module.exports = React.createClass({
displayName: 'topic-settings',
mixins: [mixinSubscribe, PureRenderMixin],
propTypes: {
topic: T.instanceOf(Immutable.Map),
closeView: T.func.isRequired
},
getInitialState: function() {
return {
showCo... | module.exports = React.createClass
displayName: 'topic-settings'
mixins: [mixinSubscribe, PureRenderMixin]
propTypes:
topic: T.instanceOf(Immutable.Map)
closeView: T.func.isRequired
getInitialState: ->
showComfirmModal: false
prefs: @getTopicPrefs()
componentDidMount: ->
@... | JavaScript | CoffeeScript | jianliaoim/talk-os | talk-web/client/app/topic-settings.coffee | MIT | 2545c4497865779a55762e03963a39237df9046b | 2,703 | https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-web/client/app/topic-settings.coffee | 31 | 80 |
jianliaoim/talk-os:talk-web/client/app/topic-settings.coffee:1:completion | completion | module.exports = React.createClass
displayName: 'topic-settings'
mixins: [mixinSubscribe, PureRenderMixin]
propTypes:
topic: T.instanceOf(Immutable.Map)
closeView: T.func.isRequired
getInitialState: ->
showComfirmModal: false
prefs: @getTopicPrefs()
componentDidMount: ->
@... | routerHandlers.team @props.topic.get('_teamId')
roomActions.roomRemove @props.topic.get('_id')
@setState showComfirmModal: false
@props.closeView()
archiveTopic: ->
_notyId = query.notificationIdByTarget recorder.getState(), @props.topic.get('_teamId'), @props.topic.get('_id')
routerHandlers.te... | CoffeeScript | CoffeeScript | jianliaoim/talk-os | talk-web/client/app/topic-settings.coffee | MIT | 2545c4497865779a55762e03963a39237df9046b | 2,703 | https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-web/client/app/topic-settings.coffee | 31 | 80 |
jianliaoim/talk-os:talk-web/client/app/topic-settings.coffee:2:raw_corpus | raw_corpus | # renderers
renderConfirmModal: ->
LightModal
name: 'delete-topic'
onCloseClick: @onCloseComfirm
show: @state.showComfirmModal
div className: 'title', lang.getText('confirm-delete-topic')
div className: 'menu',
button className: 'button is-link', onClick: @... | CoffeeScript | jianliaoim/talk-os | talk-web/client/app/topic-settings.coffee | MIT | 2545c4497865779a55762e03963a39237df9046b | 2,703 | https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-web/client/app/topic-settings.coffee | 81 | 130 | ||
jianliaoim/talk-os:talk-web/client/app/topic-settings.coffee:2:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
# renderers
renderConfirmModal: ->
LightModal
name: 'delete-topic'
onCloseClick: @onCloseComfirm
show: @state.showComfirmModal
div className: 'title', lang.getText('confirm-delete-topic')
div className: 'menu'... | // renderers
({
renderConfirmModal: function() {
return LightModal({
name: 'delete-topic',
onCloseClick: this.onCloseComfirm,
show: this.state.showComfirmModal
}, div({
className: 'title'
}, lang.getText('confirm-delete-topic')), div({
className: 'menu'
}, button({
... | CoffeeScript | JavaScript | jianliaoim/talk-os | talk-web/client/app/topic-settings.coffee | MIT | 2545c4497865779a55762e03963a39237df9046b | 2,703 | https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-web/client/app/topic-settings.coffee | 81 | 130 |
jianliaoim/talk-os:talk-web/client/app/topic-settings.coffee:2:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
// renderers
({
renderConfirmModal: function() {
return LightModal({
name: 'delete-topic',
onCloseClick: this.onCloseComfirm,
show: this.state.showComfirmModal
}, div({
className: 'title'
}, lang.getText('confirm-delete-topic')... | # renderers
renderConfirmModal: ->
LightModal
name: 'delete-topic'
onCloseClick: @onCloseComfirm
show: @state.showComfirmModal
div className: 'title', lang.getText('confirm-delete-topic')
div className: 'menu',
button className: 'button is-link', onClick: @... | JavaScript | CoffeeScript | jianliaoim/talk-os | talk-web/client/app/topic-settings.coffee | MIT | 2545c4497865779a55762e03963a39237df9046b | 2,703 | https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-web/client/app/topic-settings.coffee | 81 | 130 |
jianliaoim/talk-os:talk-web/client/app/topic-settings.coffee:2:completion | completion | # renderers
renderConfirmModal: ->
LightModal
name: 'delete-topic'
onCloseClick: @onCloseComfirm
show: @state.showComfirmModal
div className: 'title', lang.getText('confirm-delete-topic')
div className: 'menu',
button className: 'button is-link', onClick: @... | div className: 'modal-name', lang.getText('email-message')
p className: 'muted', text
input
type: 'text'
className: 'form-control', value: email
onMouseEnter: @onEmailOver, onChange: ->
renderActionsSection: ->
_userId = query.userId(recorder.getState())
isTopicCreator = @... | CoffeeScript | CoffeeScript | jianliaoim/talk-os | talk-web/client/app/topic-settings.coffee | MIT | 2545c4497865779a55762e03963a39237df9046b | 2,703 | https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-web/client/app/topic-settings.coffee | 81 | 130 |
jianliaoim/talk-os:talk-web/client/app/topic-settings.coffee:3:raw_corpus | raw_corpus | render: ->
div className: 'topic-settings lm-content',
@renderGuestSection()
@renderEmailSection()
unless @props.topic.get('isGeneral')
@renderActionsSection()
@renderConfirmModal()
TopicArchiveButtonClass = React.createClass
displayName: 'topic-archive-button'
propTypes:
... | CoffeeScript | jianliaoim/talk-os | talk-web/client/app/topic-settings.coffee | MIT | 2545c4497865779a55762e03963a39237df9046b | 2,703 | https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-web/client/app/topic-settings.coffee | 131 | 167 | ||
jianliaoim/talk-os:talk-web/client/app/topic-settings.coffee:3:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
render: ->
div className: 'topic-settings lm-content',
@renderGuestSection()
@renderEmailSection()
unless @props.topic.get('isGeneral')
@renderActionsSection()
@renderConfirmModal()
TopicArchiveButtonClass = React.createClas... | var TopicArchiveButtonClass, TopicArchiveButtonPermission, TopicGuestModeClass, TopicGuestModePermission, TopicRemoveButtonClass, TopicRemoveButtonPermission;
({
render: function() {
return div({
className: 'topic-settings lm-content'
}, this.renderGuestSection(), this.renderEmailSection(), !this.props... | CoffeeScript | JavaScript | jianliaoim/talk-os | talk-web/client/app/topic-settings.coffee | MIT | 2545c4497865779a55762e03963a39237df9046b | 2,703 | https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-web/client/app/topic-settings.coffee | 131 | 167 |
jianliaoim/talk-os:talk-web/client/app/topic-settings.coffee:3:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
var TopicArchiveButtonClass, TopicArchiveButtonPermission, TopicGuestModeClass, TopicGuestModePermission, TopicRemoveButtonClass, TopicRemoveButtonPermission;
({
render: function() {
return div({
className: 'topic-settings lm-content'
}, this.rende... | render: ->
div className: 'topic-settings lm-content',
@renderGuestSection()
@renderEmailSection()
unless @props.topic.get('isGeneral')
@renderActionsSection()
@renderConfirmModal()
TopicArchiveButtonClass = React.createClass
displayName: 'topic-archive-button'
propTypes:
... | JavaScript | CoffeeScript | jianliaoim/talk-os | talk-web/client/app/topic-settings.coffee | MIT | 2545c4497865779a55762e03963a39237df9046b | 2,703 | https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-web/client/app/topic-settings.coffee | 131 | 167 |
jianliaoim/talk-os:talk-web/client/app/topic-settings.coffee:3:completion | completion | render: ->
div className: 'topic-settings lm-content',
@renderGuestSection()
@renderEmailSection()
unless @props.topic.get('isGeneral')
@renderActionsSection()
@renderConfirmModal()
TopicArchiveButtonClass = React.createClass
displayName: 'topic-archive-button'
propTypes:
... | lang.getText('topic-archive')
TopicRemoveButtonClass = React.createClass
displayName: 'topic-remove-button'
propTypes:
onShowConfirm: T.func.isRequired
render: ->
div className: 'button is-danger', onClick: @props.onShowConfirm,
lang.getText('topic-remove')
TopicGuestModeClass = require './top... | CoffeeScript | CoffeeScript | jianliaoim/talk-os | talk-web/client/app/topic-settings.coffee | MIT | 2545c4497865779a55762e03963a39237df9046b | 2,703 | https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-web/client/app/topic-settings.coffee | 131 | 167 |
elving/swag:src/swag.dates.coffee:1:raw_corpus | raw_corpus | Dates.padNumber = (num, count, padCharacter) ->
padCharacter = '0' if typeof padCharacter is 'undefined'
lenDiff = count - String(num).length
padding = ''
padding += padCharacter while lenDiff-- if lenDiff > 0
padding + num | CoffeeScript | elving/swag | src/swag.dates.coffee | MIT | e9c8788dfc9f640038c00eaafe33f4137ff5f465 | 675 | https://github.com/elving/swag/blob/e9c8788dfc9f640038c00eaafe33f4137ff5f465/src/swag.dates.coffee | 3 | 8 | ||
elving/swag:src/swag.dates.coffee:1:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
Dates.padNumber = (num, count, padCharacter) ->
padCharacter = '0' if typeof padCharacter is 'undefined'
lenDiff = count - String(num).length
padding = ''
padding += padCharacter while lenDiff-- if lenDiff > 0
padding + num
``` | Dates.padNumber = function(num, count, padCharacter) {
var lenDiff, padding;
if (typeof padCharacter === 'undefined') {
padCharacter = '0';
}
lenDiff = count - String(num).length;
padding = '';
if (lenDiff > 0) {
while (lenDiff--) {
padding += padCharacter;
}
}
return padding + num;
}; | CoffeeScript | JavaScript | elving/swag | src/swag.dates.coffee | MIT | e9c8788dfc9f640038c00eaafe33f4137ff5f465 | 675 | https://github.com/elving/swag/blob/e9c8788dfc9f640038c00eaafe33f4137ff5f465/src/swag.dates.coffee | 3 | 8 |
elving/swag:src/swag.dates.coffee:1:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
Dates.padNumber = function(num, count, padCharacter) {
var lenDiff, padding;
if (typeof padCharacter === 'undefined') {
padCharacter = '0';
}
lenDiff = count - String(num).length;
padding = '';
if (lenDiff > 0) {
while (lenDiff--) {
paddin... | Dates.padNumber = (num, count, padCharacter) ->
padCharacter = '0' if typeof padCharacter is 'undefined'
lenDiff = count - String(num).length
padding = ''
padding += padCharacter while lenDiff-- if lenDiff > 0
padding + num | JavaScript | CoffeeScript | elving/swag | src/swag.dates.coffee | MIT | e9c8788dfc9f640038c00eaafe33f4137ff5f465 | 675 | https://github.com/elving/swag/blob/e9c8788dfc9f640038c00eaafe33f4137ff5f465/src/swag.dates.coffee | 3 | 8 |
elving/swag:src/swag.dates.coffee:1:completion | completion | Dates.padNumber = (num, count, padCharacter) ->
padCharacter = '0' if typeof padCharacter is 'undefined'
lenDiff = count - String(num).length | padding = ''
padding += padCharacter while lenDiff-- if lenDiff > 0
padding + num | CoffeeScript | CoffeeScript | elving/swag | src/swag.dates.coffee | MIT | e9c8788dfc9f640038c00eaafe33f4137ff5f465 | 675 | https://github.com/elving/swag/blob/e9c8788dfc9f640038c00eaafe33f4137ff5f465/src/swag.dates.coffee | 3 | 8 |
elving/swag:src/swag.dates.coffee:2:raw_corpus | raw_corpus | Dates.dayOfYear = (date) ->
oneJan = new Date(date.getFullYear(), 0, 1)
Math.ceil (date - oneJan) / 86400000 | CoffeeScript | elving/swag | src/swag.dates.coffee | MIT | e9c8788dfc9f640038c00eaafe33f4137ff5f465 | 675 | https://github.com/elving/swag/blob/e9c8788dfc9f640038c00eaafe33f4137ff5f465/src/swag.dates.coffee | 10 | 12 | ||
elving/swag:src/swag.dates.coffee:2:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
Dates.dayOfYear = (date) ->
oneJan = new Date(date.getFullYear(), 0, 1)
Math.ceil (date - oneJan) / 86400000
``` | Dates.dayOfYear = function(date) {
var oneJan;
oneJan = new Date(date.getFullYear(), 0, 1);
return Math.ceil((date - oneJan) / 86400000);
}; | CoffeeScript | JavaScript | elving/swag | src/swag.dates.coffee | MIT | e9c8788dfc9f640038c00eaafe33f4137ff5f465 | 675 | https://github.com/elving/swag/blob/e9c8788dfc9f640038c00eaafe33f4137ff5f465/src/swag.dates.coffee | 10 | 12 |
elving/swag:src/swag.dates.coffee:2:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
Dates.dayOfYear = function(date) {
var oneJan;
oneJan = new Date(date.getFullYear(), 0, 1);
return Math.ceil((date - oneJan) / 86400000);
};
``` | Dates.dayOfYear = (date) ->
oneJan = new Date(date.getFullYear(), 0, 1)
Math.ceil (date - oneJan) / 86400000 | JavaScript | CoffeeScript | elving/swag | src/swag.dates.coffee | MIT | e9c8788dfc9f640038c00eaafe33f4137ff5f465 | 675 | https://github.com/elving/swag/blob/e9c8788dfc9f640038c00eaafe33f4137ff5f465/src/swag.dates.coffee | 10 | 12 |
elving/swag:src/swag.dates.coffee:3:raw_corpus | raw_corpus | Dates.weekOfYear = (date) ->
oneJan = new Date(date.getFullYear(), 0, 1)
Math.ceil (((date - oneJan) / 86400000) + oneJan.getDay() + 1) / 7 | CoffeeScript | elving/swag | src/swag.dates.coffee | MIT | e9c8788dfc9f640038c00eaafe33f4137ff5f465 | 675 | https://github.com/elving/swag/blob/e9c8788dfc9f640038c00eaafe33f4137ff5f465/src/swag.dates.coffee | 14 | 16 | ||
elving/swag:src/swag.dates.coffee:3:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
Dates.weekOfYear = (date) ->
oneJan = new Date(date.getFullYear(), 0, 1)
Math.ceil (((date - oneJan) / 86400000) + oneJan.getDay() + 1) / 7
``` | Dates.weekOfYear = function(date) {
var oneJan;
oneJan = new Date(date.getFullYear(), 0, 1);
return Math.ceil((((date - oneJan) / 86400000) + oneJan.getDay() + 1) / 7);
}; | CoffeeScript | JavaScript | elving/swag | src/swag.dates.coffee | MIT | e9c8788dfc9f640038c00eaafe33f4137ff5f465 | 675 | https://github.com/elving/swag/blob/e9c8788dfc9f640038c00eaafe33f4137ff5f465/src/swag.dates.coffee | 14 | 16 |
elving/swag:src/swag.dates.coffee:3:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
Dates.weekOfYear = function(date) {
var oneJan;
oneJan = new Date(date.getFullYear(), 0, 1);
return Math.ceil((((date - oneJan) / 86400000) + oneJan.getDay() + 1) / 7);
};
``` | Dates.weekOfYear = (date) ->
oneJan = new Date(date.getFullYear(), 0, 1)
Math.ceil (((date - oneJan) / 86400000) + oneJan.getDay() + 1) / 7 | JavaScript | CoffeeScript | elving/swag | src/swag.dates.coffee | MIT | e9c8788dfc9f640038c00eaafe33f4137ff5f465 | 675 | https://github.com/elving/swag/blob/e9c8788dfc9f640038c00eaafe33f4137ff5f465/src/swag.dates.coffee | 14 | 16 |
elving/swag:src/swag.dates.coffee:4:raw_corpus | raw_corpus | Dates.isoWeekOfYear = (date) ->
target = new Date(date.valueOf())
dayNr = (date.getDay() + 6) % 7
target.setDate target.getDate() - dayNr + 3
jan4 = new Date(target.getFullYear(), 0, 4)
dayDiff = (target - jan4) / 86400000
1 + Math.ceil(dayDiff / 7) | CoffeeScript | elving/swag | src/swag.dates.coffee | MIT | e9c8788dfc9f640038c00eaafe33f4137ff5f465 | 675 | https://github.com/elving/swag/blob/e9c8788dfc9f640038c00eaafe33f4137ff5f465/src/swag.dates.coffee | 18 | 24 | ||
elving/swag:src/swag.dates.coffee:4:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
Dates.isoWeekOfYear = (date) ->
target = new Date(date.valueOf())
dayNr = (date.getDay() + 6) % 7
target.setDate target.getDate() - dayNr + 3
jan4 = new Date(target.getFullYear(), 0, 4)
dayDiff = (target - jan4) / 86400000
1 + Math.ceil(da... | Dates.isoWeekOfYear = function(date) {
var dayDiff, dayNr, jan4, target;
target = new Date(date.valueOf());
dayNr = (date.getDay() + 6) % 7;
target.setDate(target.getDate() - dayNr + 3);
jan4 = new Date(target.getFullYear(), 0, 4);
dayDiff = (target - jan4) / 86400000;
return 1 + Math.ceil(dayDiff / 7);
}... | CoffeeScript | JavaScript | elving/swag | src/swag.dates.coffee | MIT | e9c8788dfc9f640038c00eaafe33f4137ff5f465 | 675 | https://github.com/elving/swag/blob/e9c8788dfc9f640038c00eaafe33f4137ff5f465/src/swag.dates.coffee | 18 | 24 |
elving/swag:src/swag.dates.coffee:4:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
Dates.isoWeekOfYear = function(date) {
var dayDiff, dayNr, jan4, target;
target = new Date(date.valueOf());
dayNr = (date.getDay() + 6) % 7;
target.setDate(target.getDate() - dayNr + 3);
jan4 = new Date(target.getFullYear(), 0, 4);
dayDiff = (target - j... | Dates.isoWeekOfYear = (date) ->
target = new Date(date.valueOf())
dayNr = (date.getDay() + 6) % 7
target.setDate target.getDate() - dayNr + 3
jan4 = new Date(target.getFullYear(), 0, 4)
dayDiff = (target - jan4) / 86400000
1 + Math.ceil(dayDiff / 7) | JavaScript | CoffeeScript | elving/swag | src/swag.dates.coffee | MIT | e9c8788dfc9f640038c00eaafe33f4137ff5f465 | 675 | https://github.com/elving/swag/blob/e9c8788dfc9f640038c00eaafe33f4137ff5f465/src/swag.dates.coffee | 18 | 24 |
elving/swag:src/swag.dates.coffee:4:completion | completion | Dates.isoWeekOfYear = (date) ->
target = new Date(date.valueOf())
dayNr = (date.getDay() + 6) % 7 | target.setDate target.getDate() - dayNr + 3
jan4 = new Date(target.getFullYear(), 0, 4)
dayDiff = (target - jan4) / 86400000
1 + Math.ceil(dayDiff / 7) | CoffeeScript | CoffeeScript | elving/swag | src/swag.dates.coffee | MIT | e9c8788dfc9f640038c00eaafe33f4137ff5f465 | 675 | https://github.com/elving/swag/blob/e9c8788dfc9f640038c00eaafe33f4137ff5f465/src/swag.dates.coffee | 18 | 24 |
elving/swag:src/swag.dates.coffee:6:raw_corpus | raw_corpus | Dates.timeZoneOffset = (date) ->
hoursDiff = (-date.getTimezoneOffset() / 60)
result = Dates.padNumber Math.abs(hoursDiff), 4
(if hoursDiff > 0 then '+' else '-') + result | CoffeeScript | elving/swag | src/swag.dates.coffee | MIT | e9c8788dfc9f640038c00eaafe33f4137ff5f465 | 675 | https://github.com/elving/swag/blob/e9c8788dfc9f640038c00eaafe33f4137ff5f465/src/swag.dates.coffee | 29 | 32 | ||
elving/swag:src/swag.dates.coffee:6:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
Dates.timeZoneOffset = (date) ->
hoursDiff = (-date.getTimezoneOffset() / 60)
result = Dates.padNumber Math.abs(hoursDiff), 4
(if hoursDiff > 0 then '+' else '-') + result
``` | Dates.timeZoneOffset = function(date) {
var hoursDiff, result;
hoursDiff = -date.getTimezoneOffset() / 60;
result = Dates.padNumber(Math.abs(hoursDiff), 4);
return (hoursDiff > 0 ? '+' : '-') + result;
}; | CoffeeScript | JavaScript | elving/swag | src/swag.dates.coffee | MIT | e9c8788dfc9f640038c00eaafe33f4137ff5f465 | 675 | https://github.com/elving/swag/blob/e9c8788dfc9f640038c00eaafe33f4137ff5f465/src/swag.dates.coffee | 29 | 32 |
elving/swag:src/swag.dates.coffee:6:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
Dates.timeZoneOffset = function(date) {
var hoursDiff, result;
hoursDiff = -date.getTimezoneOffset() / 60;
result = Dates.padNumber(Math.abs(hoursDiff), 4);
return (hoursDiff > 0 ? '+' : '-') + result;
};
``` | Dates.timeZoneOffset = (date) ->
hoursDiff = (-date.getTimezoneOffset() / 60)
result = Dates.padNumber Math.abs(hoursDiff), 4
(if hoursDiff > 0 then '+' else '-') + result | JavaScript | CoffeeScript | elving/swag | src/swag.dates.coffee | MIT | e9c8788dfc9f640038c00eaafe33f4137ff5f465 | 675 | https://github.com/elving/swag/blob/e9c8788dfc9f640038c00eaafe33f4137ff5f465/src/swag.dates.coffee | 29 | 32 |
elving/swag:src/swag.dates.coffee:6:completion | completion | Dates.timeZoneOffset = (date) ->
hoursDiff = (-date.getTimezoneOffset() / 60) | result = Dates.padNumber Math.abs(hoursDiff), 4
(if hoursDiff > 0 then '+' else '-') + result | CoffeeScript | CoffeeScript | elving/swag | src/swag.dates.coffee | MIT | e9c8788dfc9f640038c00eaafe33f4137ff5f465 | 675 | https://github.com/elving/swag/blob/e9c8788dfc9f640038c00eaafe33f4137ff5f465/src/swag.dates.coffee | 29 | 32 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.