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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
linemanjs/lineman:tasks/server.coffee:1:raw_corpus | raw_corpus | module.exports = (grunt) ->
_ = grunt.util._
express = require("express")
httpProxy = require("http-proxy")
fileUtils = require("./../lib/file-utils")
watchr = require('watch_r');
grunt.registerTask "server", "static file & api proxy development server", ->
apiPort = process.env.API_PORT || grunt.confi... | CoffeeScript | linemanjs/lineman | tasks/server.coffee | MIT | 9162ec704bdac8c5c21d3fd1f1063fb6c5859fa0 | 1,168 | https://github.com/linemanjs/lineman/blob/9162ec704bdac8c5c21d3fd1f1063fb6c5859fa0/tasks/server.coffee | 15 | 64 | ||
linemanjs/lineman:tasks/server.coffee:1:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
module.exports = (grunt) ->
_ = grunt.util._
express = require("express")
httpProxy = require("http-proxy")
fileUtils = require("./../lib/file-utils")
watchr = require('watch_r');
grunt.registerTask "server", "static file & api proxy development serv... | module.exports = function(grunt) {
var _, express, fileUtils, handleProxyError, httpProxy, pushStateSimulator, watchr;
_ = grunt.util._;
express = require("express");
httpProxy = require("http-proxy");
fileUtils = require("./../lib/file-utils");
watchr = require('watch_r');
grunt.registerTask("server", "s... | CoffeeScript | JavaScript | linemanjs/lineman | tasks/server.coffee | MIT | 9162ec704bdac8c5c21d3fd1f1063fb6c5859fa0 | 1,168 | https://github.com/linemanjs/lineman/blob/9162ec704bdac8c5c21d3fd1f1063fb6c5859fa0/tasks/server.coffee | 15 | 64 |
linemanjs/lineman:tasks/server.coffee:1:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
module.exports = function(grunt) {
var _, express, fileUtils, handleProxyError, httpProxy, pushStateSimulator, watchr;
_ = grunt.util._;
express = require("express");
httpProxy = require("http-proxy");
fileUtils = require("./../lib/file-utils");
watchr ... | module.exports = (grunt) ->
_ = grunt.util._
express = require("express")
httpProxy = require("http-proxy")
fileUtils = require("./../lib/file-utils")
watchr = require('watch_r');
grunt.registerTask "server", "static file & api proxy development server", ->
apiPort = process.env.API_PORT || grunt.confi... | JavaScript | CoffeeScript | linemanjs/lineman | tasks/server.coffee | MIT | 9162ec704bdac8c5c21d3fd1f1063fb6c5859fa0 | 1,168 | https://github.com/linemanjs/lineman/blob/9162ec704bdac8c5c21d3fd1f1063fb6c5859fa0/tasks/server.coffee | 15 | 64 |
linemanjs/lineman:tasks/server.coffee:1:completion | completion | module.exports = (grunt) ->
_ = grunt.util._
express = require("express")
httpProxy = require("http-proxy")
fileUtils = require("./../lib/file-utils")
watchr = require('watch_r');
grunt.registerTask "server", "static file & api proxy development server", ->
apiPort = process.env.API_PORT || grunt.confi... | if apiProxyEnabled
if pushStateEnabled
grunt.log.writeln("Proxying API requests prefixed with '#{apiProxyPrefix}' to #{apiProxyHost}:#{apiPort}")
app.use(prefixMatchingApiProxy(apiProxyPrefix, apiProxyHost, apiPort, new httpProxy.RoutingProxy()))
else
grunt.log.writeln("Pro... | CoffeeScript | CoffeeScript | linemanjs/lineman | tasks/server.coffee | MIT | 9162ec704bdac8c5c21d3fd1f1063fb6c5859fa0 | 1,168 | https://github.com/linemanjs/lineman/blob/9162ec704bdac8c5c21d3fd1f1063fb6c5859fa0/tasks/server.coffee | 15 | 64 |
linemanjs/lineman:tasks/server.coffee:2:raw_corpus | raw_corpus | res.statusCode = 500
res.write("API Proxying to `#{req.url}` failed with: `#{err.toString()}`")
res.end()
prefixMatchingApiProxy = (prefix, host, port, proxy) ->
prefixMatcher = new RegExp(prefix)
proxy.on "proxyError", handleProxyError
return (req, res, next) ->
if prefix and prefixMatch... | CoffeeScript | linemanjs/lineman | tasks/server.coffee | MIT | 9162ec704bdac8c5c21d3fd1f1063fb6c5859fa0 | 1,168 | https://github.com/linemanjs/lineman/blob/9162ec704bdac8c5c21d3fd1f1063fb6c5859fa0/tasks/server.coffee | 65 | 100 | ||
linemanjs/lineman:tasks/server.coffee:2:completion | completion | res.statusCode = 500
res.write("API Proxying to `#{req.url}` failed with: `#{err.toString()}`")
res.end()
prefixMatchingApiProxy = (prefix, host, port, proxy) ->
prefixMatcher = new RegExp(prefix)
proxy.on "proxyError", handleProxyError
return (req, res, next) ->
if prefix and prefixMatch... | return (req, res, next) ->
proxy.proxyRequest(req, res, {host, port})
addBodyParserCallbackToRoutes = (app) ->
bodyParser = express.bodyParser()
_(["get", "post", "patch", "put", "delete", "options", "head"]).each (verb) ->
_(app.routes[verb]).each (route) ->
route.callbacks.unshift(bodyP... | CoffeeScript | CoffeeScript | linemanjs/lineman | tasks/server.coffee | MIT | 9162ec704bdac8c5c21d3fd1f1063fb6c5859fa0 | 1,168 | https://github.com/linemanjs/lineman/blob/9162ec704bdac8c5c21d3fd1f1063fb6c5859fa0/tasks/server.coffee | 65 | 100 |
linemanjs/lineman:tasks/server.coffee:1:raw_corpus | raw_corpus | module.exports = (grunt) ->
_ = grunt.util._
express = require("express")
httpProxy = require("http-proxy")
fileUtils = require("./../lib/file-utils")
watchr = require('watch_r');
grunt.registerTask "server", "static file & api proxy development server", ->
apiPort = process.env.API_PORT || grunt.confi... | CoffeeScript | linemanjs/lineman | tasks/server.coffee | MIT | 67f2ede791faf4db24e03ac06a5053b49aac890d | 1,168 | https://github.com/linemanjs/lineman/blob/67f2ede791faf4db24e03ac06a5053b49aac890d/tasks/server.coffee | 15 | 64 | ||
linemanjs/lineman:tasks/server.coffee:1:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
module.exports = (grunt) ->
_ = grunt.util._
express = require("express")
httpProxy = require("http-proxy")
fileUtils = require("./../lib/file-utils")
watchr = require('watch_r');
grunt.registerTask "server", "static file & api proxy development serv... | module.exports = function(grunt) {
var _, express, fileUtils, handleProxyError, httpProxy, pushStateSimulator, watchr;
_ = grunt.util._;
express = require("express");
httpProxy = require("http-proxy");
fileUtils = require("./../lib/file-utils");
watchr = require('watch_r');
grunt.registerTask("server", "s... | CoffeeScript | JavaScript | linemanjs/lineman | tasks/server.coffee | MIT | 67f2ede791faf4db24e03ac06a5053b49aac890d | 1,168 | https://github.com/linemanjs/lineman/blob/67f2ede791faf4db24e03ac06a5053b49aac890d/tasks/server.coffee | 15 | 64 |
linemanjs/lineman:tasks/server.coffee:1:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
module.exports = function(grunt) {
var _, express, fileUtils, handleProxyError, httpProxy, pushStateSimulator, watchr;
_ = grunt.util._;
express = require("express");
httpProxy = require("http-proxy");
fileUtils = require("./../lib/file-utils");
watchr ... | module.exports = (grunt) ->
_ = grunt.util._
express = require("express")
httpProxy = require("http-proxy")
fileUtils = require("./../lib/file-utils")
watchr = require('watch_r');
grunt.registerTask "server", "static file & api proxy development server", ->
apiPort = process.env.API_PORT || grunt.confi... | JavaScript | CoffeeScript | linemanjs/lineman | tasks/server.coffee | MIT | 67f2ede791faf4db24e03ac06a5053b49aac890d | 1,168 | https://github.com/linemanjs/lineman/blob/67f2ede791faf4db24e03ac06a5053b49aac890d/tasks/server.coffee | 15 | 64 |
linemanjs/lineman:tasks/server.coffee:1:completion | completion | module.exports = (grunt) ->
_ = grunt.util._
express = require("express")
httpProxy = require("http-proxy")
fileUtils = require("./../lib/file-utils")
watchr = require('watch_r');
grunt.registerTask "server", "static file & api proxy development server", ->
apiPort = process.env.API_PORT || grunt.confi... | app.use(prefixMatchingApiProxy(apiProxyPrefix, apiProxyHost, apiPort, new httpProxy.RoutingProxy()))
else if apiProxyEnabled
grunt.log.writeln("Proxying API requests to #{apiProxyHost}:#{apiPort}")
app.use(apiProxy(apiProxyHost, apiPort, new httpProxy.RoutingProxy()))
app.use(express.bodyPa... | CoffeeScript | CoffeeScript | linemanjs/lineman | tasks/server.coffee | MIT | 67f2ede791faf4db24e03ac06a5053b49aac890d | 1,168 | https://github.com/linemanjs/lineman/blob/67f2ede791faf4db24e03ac06a5053b49aac890d/tasks/server.coffee | 15 | 64 |
linemanjs/lineman:tasks/server.coffee:2:raw_corpus | raw_corpus | prefixMatchingApiProxy = (prefix, host, port, proxy) ->
prefixMatcher = new RegExp(prefix)
proxy.on "proxyError", handleProxyError
return (req, res, next) ->
if prefix and prefixMatcher.exec(req.path)
proxy.proxyRequest(req, res, {host, port})
else
next()
apiProxy = (host, p... | CoffeeScript | linemanjs/lineman | tasks/server.coffee | MIT | 67f2ede791faf4db24e03ac06a5053b49aac890d | 1,168 | https://github.com/linemanjs/lineman/blob/67f2ede791faf4db24e03ac06a5053b49aac890d/tasks/server.coffee | 65 | 90 | ||
linemanjs/lineman:tasks/server.coffee:2:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
prefixMatchingApiProxy = (prefix, host, port, proxy) ->
prefixMatcher = new RegExp(prefix)
proxy.on "proxyError", handleProxyError
return (req, res, next) ->
if prefix and prefixMatcher.exec(req.path)
proxy.proxyRequest(req, res, {host... | var apiProxy, prefixMatchingApiProxy, resetRoutesOnServerConfigChange;
prefixMatchingApiProxy = function(prefix, host, port, proxy) {
var prefixMatcher;
prefixMatcher = new RegExp(prefix);
proxy.on("proxyError", handleProxyError);
return function(req, res, next) {
if (prefix && prefixMatcher.exec(req.path)... | CoffeeScript | JavaScript | linemanjs/lineman | tasks/server.coffee | MIT | 67f2ede791faf4db24e03ac06a5053b49aac890d | 1,168 | https://github.com/linemanjs/lineman/blob/67f2ede791faf4db24e03ac06a5053b49aac890d/tasks/server.coffee | 65 | 90 |
linemanjs/lineman:tasks/server.coffee:2:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
var apiProxy, prefixMatchingApiProxy, resetRoutesOnServerConfigChange;
prefixMatchingApiProxy = function(prefix, host, port, proxy) {
var prefixMatcher;
prefixMatcher = new RegExp(prefix);
proxy.on("proxyError", handleProxyError);
return function(req, res,... | prefixMatchingApiProxy = (prefix, host, port, proxy) ->
prefixMatcher = new RegExp(prefix)
proxy.on "proxyError", handleProxyError
return (req, res, next) ->
if prefix and prefixMatcher.exec(req.path)
proxy.proxyRequest(req, res, {host, port})
else
next()
apiProxy = (host, p... | JavaScript | CoffeeScript | linemanjs/lineman | tasks/server.coffee | MIT | 67f2ede791faf4db24e03ac06a5053b49aac890d | 1,168 | https://github.com/linemanjs/lineman/blob/67f2ede791faf4db24e03ac06a5053b49aac890d/tasks/server.coffee | 65 | 90 |
linemanjs/lineman:tasks/server.coffee:2:completion | completion | prefixMatchingApiProxy = (prefix, host, port, proxy) ->
prefixMatcher = new RegExp(prefix)
proxy.on "proxyError", handleProxyError
return (req, res, next) ->
if prefix and prefixMatcher.exec(req.path)
proxy.proxyRequest(req, res, {host, port})
else
next()
apiProxy = (host, p... | return (req, res, next) ->
proxy.proxyRequest(req, res, {host, port})
resetRoutesOnServerConfigChange = (app) ->
watchr grunt.file.expand('config/server.*'), (err, watcher) ->
watcher.on 'change', (contexts) ->
_(contexts).each (context) ->
userConfig = fileUtils.reloadConfiguratio... | CoffeeScript | CoffeeScript | linemanjs/lineman | tasks/server.coffee | MIT | 67f2ede791faf4db24e03ac06a5053b49aac890d | 1,168 | https://github.com/linemanjs/lineman/blob/67f2ede791faf4db24e03ac06a5053b49aac890d/tasks/server.coffee | 65 | 90 |
linemanjs/lineman:tasks/server.coffee:1:raw_corpus | raw_corpus | module.exports = (grunt) ->
_ = grunt.util._
express = require("express")
httpProxy = require("http-proxy")
fileUtils = require("./../lib/file-utils")
watchr = require('watch_r');
grunt.registerTask "server", "static file & api proxy development server", ->
apiPort = process.env.API_PORT || grunt.confi... | CoffeeScript | linemanjs/lineman | tasks/server.coffee | MIT | eb8b6c73ff330accc870ded706886f7c54fd0004 | 1,168 | https://github.com/linemanjs/lineman/blob/eb8b6c73ff330accc870ded706886f7c54fd0004/tasks/server.coffee | 15 | 64 | ||
linemanjs/lineman:tasks/server.coffee:1:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
module.exports = (grunt) ->
_ = grunt.util._
express = require("express")
httpProxy = require("http-proxy")
fileUtils = require("./../lib/file-utils")
watchr = require('watch_r');
grunt.registerTask "server", "static file & api proxy development serv... | module.exports = function(grunt) {
var _, express, fileUtils, handleProxyError, httpProxy, pushStateSimulator, watchr;
_ = grunt.util._;
express = require("express");
httpProxy = require("http-proxy");
fileUtils = require("./../lib/file-utils");
watchr = require('watch_r');
grunt.registerTask("server", "s... | CoffeeScript | JavaScript | linemanjs/lineman | tasks/server.coffee | MIT | eb8b6c73ff330accc870ded706886f7c54fd0004 | 1,168 | https://github.com/linemanjs/lineman/blob/eb8b6c73ff330accc870ded706886f7c54fd0004/tasks/server.coffee | 15 | 64 |
linemanjs/lineman:tasks/server.coffee:1:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
module.exports = function(grunt) {
var _, express, fileUtils, handleProxyError, httpProxy, pushStateSimulator, watchr;
_ = grunt.util._;
express = require("express");
httpProxy = require("http-proxy");
fileUtils = require("./../lib/file-utils");
watchr ... | module.exports = (grunt) ->
_ = grunt.util._
express = require("express")
httpProxy = require("http-proxy")
fileUtils = require("./../lib/file-utils")
watchr = require('watch_r');
grunt.registerTask "server", "static file & api proxy development server", ->
apiPort = process.env.API_PORT || grunt.confi... | JavaScript | CoffeeScript | linemanjs/lineman | tasks/server.coffee | MIT | eb8b6c73ff330accc870ded706886f7c54fd0004 | 1,168 | https://github.com/linemanjs/lineman/blob/eb8b6c73ff330accc870ded706886f7c54fd0004/tasks/server.coffee | 15 | 64 |
linemanjs/lineman:tasks/server.coffee:1:completion | completion | module.exports = (grunt) ->
_ = grunt.util._
express = require("express")
httpProxy = require("http-proxy")
fileUtils = require("./../lib/file-utils")
watchr = require('watch_r');
grunt.registerTask "server", "static file & api proxy development server", ->
apiPort = process.env.API_PORT || grunt.confi... | app.use prefixMatchingApiProxy(apiProxyPrefix, apiProxyHost, apiPort, new httpProxy.RoutingProxy())
grunt.log.writeln("Proxying API requests prefixed with '#{apiProxyPrefix}' to #{apiProxyHost}:#{apiPort}")
else if apiProxyEnabled
app.use apiProxy(apiProxyHost, apiPort, new httpProxy.RoutingProxy(... | CoffeeScript | CoffeeScript | linemanjs/lineman | tasks/server.coffee | MIT | eb8b6c73ff330accc870ded706886f7c54fd0004 | 1,168 | https://github.com/linemanjs/lineman/blob/eb8b6c73ff330accc870ded706886f7c54fd0004/tasks/server.coffee | 15 | 64 |
jianliaoim/talk-os:talk-web/client/updater/tag.coffee:1:raw_corpus | raw_corpus | exports.read = (store, actionData) ->
_teamId = actionData.get('_teamId')
tagsList = actionData.get('tags')
store.setIn ['tags', _teamId], tagsList | CoffeeScript | jianliaoim/talk-os | talk-web/client/updater/tag.coffee | MIT | 2545c4497865779a55762e03963a39237df9046b | 2,703 | https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-web/client/updater/tag.coffee | 8 | 12 | ||
jianliaoim/talk-os:talk-web/client/updater/tag.coffee:1:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
exports.read = (store, actionData) ->
_teamId = actionData.get('_teamId')
tagsList = actionData.get('tags')
store.setIn ['tags', _teamId], tagsList
``` | exports.read = function(store, actionData) {
var _teamId, tagsList;
_teamId = actionData.get('_teamId');
tagsList = actionData.get('tags');
return store.setIn(['tags', _teamId], tagsList);
}; | CoffeeScript | JavaScript | jianliaoim/talk-os | talk-web/client/updater/tag.coffee | MIT | 2545c4497865779a55762e03963a39237df9046b | 2,703 | https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-web/client/updater/tag.coffee | 8 | 12 |
jianliaoim/talk-os:talk-web/client/updater/tag.coffee:1:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
exports.read = function(store, actionData) {
var _teamId, tagsList;
_teamId = actionData.get('_teamId');
tagsList = actionData.get('tags');
return store.setIn(['tags', _teamId], tagsList);
};
``` | exports.read = (store, actionData) ->
_teamId = actionData.get('_teamId')
tagsList = actionData.get('tags')
store.setIn ['tags', _teamId], tagsList | JavaScript | CoffeeScript | jianliaoim/talk-os | talk-web/client/updater/tag.coffee | MIT | 2545c4497865779a55762e03963a39237df9046b | 2,703 | https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-web/client/updater/tag.coffee | 8 | 12 |
jianliaoim/talk-os:talk-web/client/updater/tag.coffee:1:completion | completion | exports.read = (store, actionData) ->
_teamId = actionData.get('_teamId') | tagsList = actionData.get('tags')
store.setIn ['tags', _teamId], tagsList | CoffeeScript | CoffeeScript | jianliaoim/talk-os | talk-web/client/updater/tag.coffee | MIT | 2545c4497865779a55762e03963a39237df9046b | 2,703 | https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-web/client/updater/tag.coffee | 8 | 12 |
jianliaoim/talk-os:talk-web/client/updater/tag.coffee:2:raw_corpus | raw_corpus | exports.create = (store, tagData) ->
_teamId = tagData.get('_teamId')
store.update 'tags', (cursor) ->
if cursor.get(_teamId)?
cursor.update _teamId, (tags) ->
tags.push tagData
else
cursor.set _teamId, Immutable.List([tagData])
# http://talk.ci/doc/event/tag.update.html | CoffeeScript | jianliaoim/talk-os | talk-web/client/updater/tag.coffee | MIT | 2545c4497865779a55762e03963a39237df9046b | 2,703 | https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-web/client/updater/tag.coffee | 14 | 24 | ||
jianliaoim/talk-os:talk-web/client/updater/tag.coffee:2:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
exports.create = (store, tagData) ->
_teamId = tagData.get('_teamId')
store.update 'tags', (cursor) ->
if cursor.get(_teamId)?
cursor.update _teamId, (tags) ->
tags.push tagData
else
cursor.set _teamId, Immutable.List([tagData])
... | exports.create = function(store, tagData) {
var _teamId;
_teamId = tagData.get('_teamId');
return store.update('tags', function(cursor) {
if (cursor.get(_teamId) != null) {
return cursor.update(_teamId, function(tags) {
return tags.push(tagData);
});
} else {
return cursor.set(_t... | CoffeeScript | JavaScript | jianliaoim/talk-os | talk-web/client/updater/tag.coffee | MIT | 2545c4497865779a55762e03963a39237df9046b | 2,703 | https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-web/client/updater/tag.coffee | 14 | 24 |
jianliaoim/talk-os:talk-web/client/updater/tag.coffee:2:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
exports.create = function(store, tagData) {
var _teamId;
_teamId = tagData.get('_teamId');
return store.update('tags', function(cursor) {
if (cursor.get(_teamId) != null) {
return cursor.update(_teamId, function(tags) {
return tags.push(tagD... | exports.create = (store, tagData) ->
_teamId = tagData.get('_teamId')
store.update 'tags', (cursor) ->
if cursor.get(_teamId)?
cursor.update _teamId, (tags) ->
tags.push tagData
else
cursor.set _teamId, Immutable.List([tagData])
# http://talk.ci/doc/event/tag.update.html | JavaScript | CoffeeScript | jianliaoim/talk-os | talk-web/client/updater/tag.coffee | MIT | 2545c4497865779a55762e03963a39237df9046b | 2,703 | https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-web/client/updater/tag.coffee | 14 | 24 |
jianliaoim/talk-os:talk-web/client/updater/tag.coffee:2:completion | completion | exports.create = (store, tagData) ->
_teamId = tagData.get('_teamId')
store.update 'tags', (cursor) ->
if cursor.get(_teamId)? | cursor.update _teamId, (tags) ->
tags.push tagData
else
cursor.set _teamId, Immutable.List([tagData])
# http://talk.ci/doc/event/tag.update.html | CoffeeScript | CoffeeScript | jianliaoim/talk-os | talk-web/client/updater/tag.coffee | MIT | 2545c4497865779a55762e03963a39237df9046b | 2,703 | https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-web/client/updater/tag.coffee | 14 | 24 |
jianliaoim/talk-os:talk-web/client/updater/tag.coffee:3:raw_corpus | raw_corpus | exports.update = (store, tagData) ->
_teamId = tagData.get('_teamId')
_tagId = tagData.get('_id')
inCollection = (tag) -> tag.get('_id') is _tagId
updateInMessages = (messages) ->
messages.map (message) ->
tags = message.get('tags')
if tags? and tags.some(inCollection)
message.update 't... | CoffeeScript | jianliaoim/talk-os | talk-web/client/updater/tag.coffee | MIT | 2545c4497865779a55762e03963a39237df9046b | 2,703 | https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-web/client/updater/tag.coffee | 25 | 54 | ||
jianliaoim/talk-os:talk-web/client/updater/tag.coffee:3:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
exports.update = (store, tagData) ->
_teamId = tagData.get('_teamId')
_tagId = tagData.get('_id')
inCollection = (tag) -> tag.get('_id') is _tagId
updateInMessages = (messages) ->
messages.map (message) ->
tags = message.get('tags')
if ta... | exports.update = function(store, tagData) {
var _tagId, _teamId, inCollection, updateInMessages;
_teamId = tagData.get('_teamId');
_tagId = tagData.get('_id');
inCollection = function(tag) {
return tag.get('_id') === _tagId;
};
updateInMessages = function(messages) {
return messages.map(function(mes... | CoffeeScript | JavaScript | jianliaoim/talk-os | talk-web/client/updater/tag.coffee | MIT | 2545c4497865779a55762e03963a39237df9046b | 2,703 | https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-web/client/updater/tag.coffee | 25 | 54 |
jianliaoim/talk-os:talk-web/client/updater/tag.coffee:3:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
exports.update = function(store, tagData) {
var _tagId, _teamId, inCollection, updateInMessages;
_teamId = tagData.get('_teamId');
_tagId = tagData.get('_id');
inCollection = function(tag) {
return tag.get('_id') === _tagId;
};
updateInMessages = fu... | exports.update = (store, tagData) ->
_teamId = tagData.get('_teamId')
_tagId = tagData.get('_id')
inCollection = (tag) -> tag.get('_id') is _tagId
updateInMessages = (messages) ->
messages.map (message) ->
tags = message.get('tags')
if tags? and tags.some(inCollection)
message.update 't... | JavaScript | CoffeeScript | jianliaoim/talk-os | talk-web/client/updater/tag.coffee | MIT | 2545c4497865779a55762e03963a39237df9046b | 2,703 | https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-web/client/updater/tag.coffee | 25 | 54 |
jianliaoim/talk-os:talk-web/client/updater/tag.coffee:3:completion | completion | exports.update = (store, tagData) ->
_teamId = tagData.get('_teamId')
_tagId = tagData.get('_id')
inCollection = (tag) -> tag.get('_id') is _tagId
updateInMessages = (messages) ->
messages.map (message) ->
tags = message.get('tags')
if tags? and tags.some(inCollection)
message.update 't... | store
.update 'tags', (cursor) ->
cursor.update _teamId, (tags) ->
tags.map (tag) ->
if tag.get('_id') is _tagId
tag.merge tagData
else tag
.update 'messages', (cursor) ->
if cursor.has(_teamId)
cursor.update _teamId, (rooms) ->
rooms.map updateInMessages
el... | CoffeeScript | CoffeeScript | jianliaoim/talk-os | talk-web/client/updater/tag.coffee | MIT | 2545c4497865779a55762e03963a39237df9046b | 2,703 | https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-web/client/updater/tag.coffee | 25 | 54 |
jianliaoim/talk-os:talk-web/client/updater/tag.coffee:4:raw_corpus | raw_corpus | exports.remove = (store, tagData) ->
_teamId = tagData.get('_teamId')
_tagId = tagData.get('_id')
inCollection = (tag) -> tag.get('_id') is _tagId
removeInMessages = (messages) ->
messages.map (message) ->
tags = message.get('tags')
if tags? and tags.some(inCollection)
message.update 't... | CoffeeScript | jianliaoim/talk-os | talk-web/client/updater/tag.coffee | MIT | 2545c4497865779a55762e03963a39237df9046b | 2,703 | https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-web/client/updater/tag.coffee | 56 | 83 | ||
jianliaoim/talk-os:talk-web/client/updater/tag.coffee:4:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
exports.remove = (store, tagData) ->
_teamId = tagData.get('_teamId')
_tagId = tagData.get('_id')
inCollection = (tag) -> tag.get('_id') is _tagId
removeInMessages = (messages) ->
messages.map (message) ->
tags = message.get('tags')
if ta... | exports.remove = function(store, tagData) {
var _tagId, _teamId, filterMessages, inCollection, removeInMessages;
_teamId = tagData.get('_teamId');
_tagId = tagData.get('_id');
inCollection = function(tag) {
return tag.get('_id') === _tagId;
};
removeInMessages = function(messages) {
return messages.... | CoffeeScript | JavaScript | jianliaoim/talk-os | talk-web/client/updater/tag.coffee | MIT | 2545c4497865779a55762e03963a39237df9046b | 2,703 | https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-web/client/updater/tag.coffee | 56 | 83 |
jianliaoim/talk-os:talk-web/client/updater/tag.coffee:4:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
exports.remove = function(store, tagData) {
var _tagId, _teamId, filterMessages, inCollection, removeInMessages;
_teamId = tagData.get('_teamId');
_tagId = tagData.get('_id');
inCollection = function(tag) {
return tag.get('_id') === _tagId;
};
remov... | exports.remove = (store, tagData) ->
_teamId = tagData.get('_teamId')
_tagId = tagData.get('_id')
inCollection = (tag) -> tag.get('_id') is _tagId
removeInMessages = (messages) ->
messages.map (message) ->
tags = message.get('tags')
if tags? and tags.some(inCollection)
message.update 't... | JavaScript | CoffeeScript | jianliaoim/talk-os | talk-web/client/updater/tag.coffee | MIT | 2545c4497865779a55762e03963a39237df9046b | 2,703 | https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-web/client/updater/tag.coffee | 56 | 83 |
jianliaoim/talk-os:talk-web/client/updater/tag.coffee:4:completion | completion | exports.remove = (store, tagData) ->
_teamId = tagData.get('_teamId')
_tagId = tagData.get('_id')
inCollection = (tag) -> tag.get('_id') is _tagId
removeInMessages = (messages) ->
messages.map (message) ->
tags = message.get('tags')
if tags? and tags.some(inCollection)
message.update 't... | removeInMessages(messages).filter (message) ->
message.get('tags').size > 0
store
.update 'tags', (cursor) ->
cursor.update _teamId, (tags) ->
tags.filterNot inCollection
.update 'messages', (cursor) ->
if cursor.has(_teamId)
cursor.update _teamId, (rooms) ->
rooms.map removeInM... | CoffeeScript | CoffeeScript | jianliaoim/talk-os | talk-web/client/updater/tag.coffee | MIT | 2545c4497865779a55762e03963a39237df9046b | 2,703 | https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-web/client/updater/tag.coffee | 56 | 83 |
jianliaoim/talk-os:talk-web/client/actions/activities.coffee:1:raw_corpus | raw_corpus | requestActivities = (config, _teamId, success, fail) ->
api.activities.read.get config
.then (resp) ->
recorder.dispatch 'activities/read',
_teamId: _teamId
activities: resp
success? resp
.catch (error) ->
fail? error | CoffeeScript | jianliaoim/talk-os | talk-web/client/actions/activities.coffee | MIT | 2545c4497865779a55762e03963a39237df9046b | 2,703 | https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-web/client/actions/activities.coffee | 7 | 15 | ||
jianliaoim/talk-os:talk-web/client/actions/activities.coffee:1:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
requestActivities = (config, _teamId, success, fail) ->
api.activities.read.get config
.then (resp) ->
recorder.dispatch 'activities/read',
_teamId: _teamId
activities: resp
success? resp
.catch (error) ->
fail? error
`... | var requestActivities;
requestActivities = function(config, _teamId, success, fail) {
return api.activities.read.get(config).then(function(resp) {
recorder.dispatch('activities/read', {
_teamId: _teamId,
activities: resp
});
return typeof success === "function" ? success(resp) : void 0;
}).... | CoffeeScript | JavaScript | jianliaoim/talk-os | talk-web/client/actions/activities.coffee | MIT | 2545c4497865779a55762e03963a39237df9046b | 2,703 | https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-web/client/actions/activities.coffee | 7 | 15 |
jianliaoim/talk-os:talk-web/client/actions/activities.coffee:1:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
var requestActivities;
requestActivities = function(config, _teamId, success, fail) {
return api.activities.read.get(config).then(function(resp) {
recorder.dispatch('activities/read', {
_teamId: _teamId,
activities: resp
});
return typeof... | requestActivities = (config, _teamId, success, fail) ->
api.activities.read.get config
.then (resp) ->
recorder.dispatch 'activities/read',
_teamId: _teamId
activities: resp
success? resp
.catch (error) ->
fail? error | JavaScript | CoffeeScript | jianliaoim/talk-os | talk-web/client/actions/activities.coffee | MIT | 2545c4497865779a55762e03963a39237df9046b | 2,703 | https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-web/client/actions/activities.coffee | 7 | 15 |
jianliaoim/talk-os:talk-web/client/actions/activities.coffee:1:completion | completion | requestActivities = (config, _teamId, success, fail) ->
api.activities.read.get config
.then (resp) ->
recorder.dispatch 'activities/read', | _teamId: _teamId
activities: resp
success? resp
.catch (error) ->
fail? error | CoffeeScript | CoffeeScript | jianliaoim/talk-os | talk-web/client/actions/activities.coffee | MIT | 2545c4497865779a55762e03963a39237df9046b | 2,703 | https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-web/client/actions/activities.coffee | 7 | 15 |
jianliaoim/talk-os:talk-web/client/actions/activities.coffee:2:raw_corpus | raw_corpus | exports.get = (_teamId, success, fail) ->
exports.loading _teamId, 'down'
config =
queryParams:
_teamId: _teamId
limit: exports.ACTIVITIES_READ_LIMIT
api.activities.read.get config
.then (res) ->
recorder.dispatch 'activities/initial',
_teamId: _teamId
direction: 'd... | CoffeeScript | jianliaoim/talk-os | talk-web/client/actions/activities.coffee | MIT | 2545c4497865779a55762e03963a39237df9046b | 2,703 | https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-web/client/actions/activities.coffee | 17 | 33 | ||
jianliaoim/talk-os:talk-web/client/actions/activities.coffee:2:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
exports.get = (_teamId, success, fail) ->
exports.loading _teamId, 'down'
config =
queryParams:
_teamId: _teamId
limit: exports.ACTIVITIES_READ_LIMIT
api.activities.read.get config
.then (res) ->
recorder.dispatch 'activities... | exports.get = function(_teamId, success, fail) {
var config;
exports.loading(_teamId, 'down');
config = {
queryParams: {
_teamId: _teamId,
limit: exports.ACTIVITIES_READ_LIMIT
}
};
return api.activities.read.get(config).then(function(res) {
recorder.dispatch('activities/initial', {
... | CoffeeScript | JavaScript | jianliaoim/talk-os | talk-web/client/actions/activities.coffee | MIT | 2545c4497865779a55762e03963a39237df9046b | 2,703 | https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-web/client/actions/activities.coffee | 17 | 33 |
jianliaoim/talk-os:talk-web/client/actions/activities.coffee:2:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
exports.get = function(_teamId, success, fail) {
var config;
exports.loading(_teamId, 'down');
config = {
queryParams: {
_teamId: _teamId,
limit: exports.ACTIVITIES_READ_LIMIT
}
};
return api.activities.read.get(config).then(function(r... | exports.get = (_teamId, success, fail) ->
exports.loading _teamId, 'down'
config =
queryParams:
_teamId: _teamId
limit: exports.ACTIVITIES_READ_LIMIT
api.activities.read.get config
.then (res) ->
recorder.dispatch 'activities/initial',
_teamId: _teamId
direction: 'd... | JavaScript | CoffeeScript | jianliaoim/talk-os | talk-web/client/actions/activities.coffee | MIT | 2545c4497865779a55762e03963a39237df9046b | 2,703 | https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-web/client/actions/activities.coffee | 17 | 33 |
jianliaoim/talk-os:talk-web/client/actions/activities.coffee:2:completion | completion | exports.get = (_teamId, success, fail) ->
exports.loading _teamId, 'down'
config =
queryParams:
_teamId: _teamId
limit: exports.ACTIVITIES_READ_LIMIT | api.activities.read.get config
.then (res) ->
recorder.dispatch 'activities/initial',
_teamId: _teamId
direction: 'down'
activities: res
success? res
.catch (error) ->
fail? error | CoffeeScript | CoffeeScript | jianliaoim/talk-os | talk-web/client/actions/activities.coffee | MIT | 2545c4497865779a55762e03963a39237df9046b | 2,703 | https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-web/client/actions/activities.coffee | 17 | 33 |
jianliaoim/talk-os:talk-web/client/actions/activities.coffee:3:raw_corpus | raw_corpus | exports.getByMinId = (_teamId, _minId, success, fail) ->
exports.loading _teamId, 'up'
config =
queryParams:
_minId: _minId
_teamId: _teamId
limit: exports.ACTIVITIES_READ_LIMIT
api.activities.read.get config
.then (res) ->
recorder.dispatch 'activities/read',
_teamId: _t... | CoffeeScript | jianliaoim/talk-os | talk-web/client/actions/activities.coffee | MIT | 2545c4497865779a55762e03963a39237df9046b | 2,703 | https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-web/client/actions/activities.coffee | 35 | 52 | ||
jianliaoim/talk-os:talk-web/client/actions/activities.coffee:3:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
exports.getByMinId = (_teamId, _minId, success, fail) ->
exports.loading _teamId, 'up'
config =
queryParams:
_minId: _minId
_teamId: _teamId
limit: exports.ACTIVITIES_READ_LIMIT
api.activities.read.get config
.then (res) ->
... | exports.getByMinId = function(_teamId, _minId, success, fail) {
var config;
exports.loading(_teamId, 'up');
config = {
queryParams: {
_minId: _minId,
_teamId: _teamId,
limit: exports.ACTIVITIES_READ_LIMIT
}
};
return api.activities.read.get(config).then(function(res) {
recorder.d... | CoffeeScript | JavaScript | jianliaoim/talk-os | talk-web/client/actions/activities.coffee | MIT | 2545c4497865779a55762e03963a39237df9046b | 2,703 | https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-web/client/actions/activities.coffee | 35 | 52 |
jianliaoim/talk-os:talk-web/client/actions/activities.coffee:3:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
exports.getByMinId = function(_teamId, _minId, success, fail) {
var config;
exports.loading(_teamId, 'up');
config = {
queryParams: {
_minId: _minId,
_teamId: _teamId,
limit: exports.ACTIVITIES_READ_LIMIT
}
};
return api.activiti... | exports.getByMinId = (_teamId, _minId, success, fail) ->
exports.loading _teamId, 'up'
config =
queryParams:
_minId: _minId
_teamId: _teamId
limit: exports.ACTIVITIES_READ_LIMIT
api.activities.read.get config
.then (res) ->
recorder.dispatch 'activities/read',
_teamId: _t... | JavaScript | CoffeeScript | jianliaoim/talk-os | talk-web/client/actions/activities.coffee | MIT | 2545c4497865779a55762e03963a39237df9046b | 2,703 | https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-web/client/actions/activities.coffee | 35 | 52 |
jianliaoim/talk-os:talk-web/client/actions/activities.coffee:3:completion | completion | exports.getByMinId = (_teamId, _minId, success, fail) ->
exports.loading _teamId, 'up'
config =
queryParams:
_minId: _minId
_teamId: _teamId
limit: exports.ACTIVITIES_READ_LIMIT | api.activities.read.get config
.then (res) ->
recorder.dispatch 'activities/read',
_teamId: _teamId
direction: 'up'
activities: res
success? res
.catch (error) ->
fail? error | CoffeeScript | CoffeeScript | jianliaoim/talk-os | talk-web/client/actions/activities.coffee | MIT | 2545c4497865779a55762e03963a39237df9046b | 2,703 | https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-web/client/actions/activities.coffee | 35 | 52 |
jianliaoim/talk-os:talk-web/client/actions/activities.coffee:4:raw_corpus | raw_corpus | exports.getByMaxId = (_teamId, _maxId, success, fail) ->
exports.loading _teamId, 'down'
config =
queryParams:
_maxId: _maxId
_teamId: _teamId
limit: exports.ACTIVITIES_READ_LIMIT
api.activities.read.get config
.then (res) ->
recorder.dispatch 'activities/read',
_teamId: ... | CoffeeScript | jianliaoim/talk-os | talk-web/client/actions/activities.coffee | MIT | 2545c4497865779a55762e03963a39237df9046b | 2,703 | https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-web/client/actions/activities.coffee | 54 | 71 | ||
jianliaoim/talk-os:talk-web/client/actions/activities.coffee:4:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
exports.getByMaxId = (_teamId, _maxId, success, fail) ->
exports.loading _teamId, 'down'
config =
queryParams:
_maxId: _maxId
_teamId: _teamId
limit: exports.ACTIVITIES_READ_LIMIT
api.activities.read.get config
.then (res) ->
... | exports.getByMaxId = function(_teamId, _maxId, success, fail) {
var config;
exports.loading(_teamId, 'down');
config = {
queryParams: {
_maxId: _maxId,
_teamId: _teamId,
limit: exports.ACTIVITIES_READ_LIMIT
}
};
return api.activities.read.get(config).then(function(res) {
recorder... | CoffeeScript | JavaScript | jianliaoim/talk-os | talk-web/client/actions/activities.coffee | MIT | 2545c4497865779a55762e03963a39237df9046b | 2,703 | https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-web/client/actions/activities.coffee | 54 | 71 |
jianliaoim/talk-os:talk-web/client/actions/activities.coffee:4:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
exports.getByMaxId = function(_teamId, _maxId, success, fail) {
var config;
exports.loading(_teamId, 'down');
config = {
queryParams: {
_maxId: _maxId,
_teamId: _teamId,
limit: exports.ACTIVITIES_READ_LIMIT
}
};
return api.activi... | exports.getByMaxId = (_teamId, _maxId, success, fail) ->
exports.loading _teamId, 'down'
config =
queryParams:
_maxId: _maxId
_teamId: _teamId
limit: exports.ACTIVITIES_READ_LIMIT
api.activities.read.get config
.then (res) ->
recorder.dispatch 'activities/read',
_teamId: ... | JavaScript | CoffeeScript | jianliaoim/talk-os | talk-web/client/actions/activities.coffee | MIT | 2545c4497865779a55762e03963a39237df9046b | 2,703 | https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-web/client/actions/activities.coffee | 54 | 71 |
jianliaoim/talk-os:talk-web/client/actions/activities.coffee:4:completion | completion | exports.getByMaxId = (_teamId, _maxId, success, fail) ->
exports.loading _teamId, 'down'
config =
queryParams:
_maxId: _maxId
_teamId: _teamId
limit: exports.ACTIVITIES_READ_LIMIT | api.activities.read.get config
.then (res) ->
recorder.dispatch 'activities/read',
_teamId: _teamId
direction: 'down'
activities: res
success? res
.catch (error) ->
fail? error | CoffeeScript | CoffeeScript | jianliaoim/talk-os | talk-web/client/actions/activities.coffee | MIT | 2545c4497865779a55762e03963a39237df9046b | 2,703 | https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-web/client/actions/activities.coffee | 54 | 71 |
jianliaoim/talk-os:talk-web/client/actions/activities.coffee:5:raw_corpus | raw_corpus | exports.getByMaxDate = (_teamId, maxDate, success, fail) ->
exports.loading _teamId, 'down'
config =
queryParams:
_teamId: _teamId
maxDate: maxDate
limit: exports.ACTIVITIES_READ_LIMIT
api.activities.read.get config
.then (resp) ->
recorder.dispatch 'activities/replace',
... | CoffeeScript | jianliaoim/talk-os | talk-web/client/actions/activities.coffee | MIT | 2545c4497865779a55762e03963a39237df9046b | 2,703 | https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-web/client/actions/activities.coffee | 73 | 89 | ||
jianliaoim/talk-os:talk-web/client/actions/activities.coffee:5:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
exports.getByMaxDate = (_teamId, maxDate, success, fail) ->
exports.loading _teamId, 'down'
config =
queryParams:
_teamId: _teamId
maxDate: maxDate
limit: exports.ACTIVITIES_READ_LIMIT
api.activities.read.get config
.then (resp) ... | exports.getByMaxDate = function(_teamId, maxDate, success, fail) {
var config;
exports.loading(_teamId, 'down');
config = {
queryParams: {
_teamId: _teamId,
maxDate: maxDate,
limit: exports.ACTIVITIES_READ_LIMIT
}
};
return api.activities.read.get(config).then(function(resp) {
re... | CoffeeScript | JavaScript | jianliaoim/talk-os | talk-web/client/actions/activities.coffee | MIT | 2545c4497865779a55762e03963a39237df9046b | 2,703 | https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-web/client/actions/activities.coffee | 73 | 89 |
jianliaoim/talk-os:talk-web/client/actions/activities.coffee:5:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
exports.getByMaxDate = function(_teamId, maxDate, success, fail) {
var config;
exports.loading(_teamId, 'down');
config = {
queryParams: {
_teamId: _teamId,
maxDate: maxDate,
limit: exports.ACTIVITIES_READ_LIMIT
}
};
return api.a... | exports.getByMaxDate = (_teamId, maxDate, success, fail) ->
exports.loading _teamId, 'down'
config =
queryParams:
_teamId: _teamId
maxDate: maxDate
limit: exports.ACTIVITIES_READ_LIMIT
api.activities.read.get config
.then (resp) ->
recorder.dispatch 'activities/replace',
... | JavaScript | CoffeeScript | jianliaoim/talk-os | talk-web/client/actions/activities.coffee | MIT | 2545c4497865779a55762e03963a39237df9046b | 2,703 | https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-web/client/actions/activities.coffee | 73 | 89 |
jianliaoim/talk-os:talk-web/client/actions/activities.coffee:5:completion | completion | exports.getByMaxDate = (_teamId, maxDate, success, fail) ->
exports.loading _teamId, 'down'
config =
queryParams:
_teamId: _teamId
maxDate: maxDate
limit: exports.ACTIVITIES_READ_LIMIT | api.activities.read.get config
.then (resp) ->
recorder.dispatch 'activities/replace',
_teamId: _teamId
activities: resp
success? resp
.catch (error) ->
fail? error | CoffeeScript | CoffeeScript | jianliaoim/talk-os | talk-web/client/actions/activities.coffee | MIT | 2545c4497865779a55762e03963a39237df9046b | 2,703 | https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-web/client/actions/activities.coffee | 73 | 89 |
jianliaoim/talk-os:talk-web/client/actions/activities.coffee:6:raw_corpus | raw_corpus | exports.remove = (_activityId, success, fail) ->
config =
pathParams:
id: _activityId
api.activities.remove.delete(config)
.then (resp) ->
recorder.dispatch 'activities/remove', resp
success? resp
.catch (error) ->
fail? error | CoffeeScript | jianliaoim/talk-os | talk-web/client/actions/activities.coffee | MIT | 2545c4497865779a55762e03963a39237df9046b | 2,703 | https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-web/client/actions/activities.coffee | 91 | 100 | ||
jianliaoim/talk-os:talk-web/client/actions/activities.coffee:6:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
exports.remove = (_activityId, success, fail) ->
config =
pathParams:
id: _activityId
api.activities.remove.delete(config)
.then (resp) ->
recorder.dispatch 'activities/remove', resp
success? resp
.catch (error) ->
fail? error
``` | exports.remove = function(_activityId, success, fail) {
var config;
config = {
pathParams: {
id: _activityId
}
};
return api.activities.remove.delete(config).then(function(resp) {
recorder.dispatch('activities/remove', resp);
return typeof success === "function" ? success(resp) : void 0;
... | CoffeeScript | JavaScript | jianliaoim/talk-os | talk-web/client/actions/activities.coffee | MIT | 2545c4497865779a55762e03963a39237df9046b | 2,703 | https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-web/client/actions/activities.coffee | 91 | 100 |
jianliaoim/talk-os:talk-web/client/actions/activities.coffee:6:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
exports.remove = function(_activityId, success, fail) {
var config;
config = {
pathParams: {
id: _activityId
}
};
return api.activities.remove.delete(config).then(function(resp) {
recorder.dispatch('activities/remove', resp);
return ty... | exports.remove = (_activityId, success, fail) ->
config =
pathParams:
id: _activityId
api.activities.remove.delete(config)
.then (resp) ->
recorder.dispatch 'activities/remove', resp
success? resp
.catch (error) ->
fail? error | JavaScript | CoffeeScript | jianliaoim/talk-os | talk-web/client/actions/activities.coffee | MIT | 2545c4497865779a55762e03963a39237df9046b | 2,703 | https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-web/client/actions/activities.coffee | 91 | 100 |
jianliaoim/talk-os:talk-web/client/actions/activities.coffee:6:completion | completion | exports.remove = (_activityId, success, fail) ->
config =
pathParams:
id: _activityId
api.activities.remove.delete(config) | .then (resp) ->
recorder.dispatch 'activities/remove', resp
success? resp
.catch (error) ->
fail? error | CoffeeScript | CoffeeScript | jianliaoim/talk-os | talk-web/client/actions/activities.coffee | MIT | 2545c4497865779a55762e03963a39237df9046b | 2,703 | https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-web/client/actions/activities.coffee | 91 | 100 |
jianliaoim/talk-os:talk-web/client/actions/activities.coffee:7:raw_corpus | raw_corpus | exports.loading = (_teamId, direction) ->
recorder.dispatch 'activities/loading',
_teamId: _teamId
direction: direction | CoffeeScript | jianliaoim/talk-os | talk-web/client/actions/activities.coffee | MIT | 2545c4497865779a55762e03963a39237df9046b | 2,703 | https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-web/client/actions/activities.coffee | 102 | 105 | ||
jianliaoim/talk-os:talk-web/client/actions/activities.coffee:7:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
exports.loading = (_teamId, direction) ->
recorder.dispatch 'activities/loading',
_teamId: _teamId
direction: direction
``` | exports.loading = function(_teamId, direction) {
return recorder.dispatch('activities/loading', {
_teamId: _teamId,
direction: direction
});
}; | CoffeeScript | JavaScript | jianliaoim/talk-os | talk-web/client/actions/activities.coffee | MIT | 2545c4497865779a55762e03963a39237df9046b | 2,703 | https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-web/client/actions/activities.coffee | 102 | 105 |
jianliaoim/talk-os:talk-web/client/actions/activities.coffee:7:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
exports.loading = function(_teamId, direction) {
return recorder.dispatch('activities/loading', {
_teamId: _teamId,
direction: direction
});
};
``` | exports.loading = (_teamId, direction) ->
recorder.dispatch 'activities/loading',
_teamId: _teamId
direction: direction | JavaScript | CoffeeScript | jianliaoim/talk-os | talk-web/client/actions/activities.coffee | MIT | 2545c4497865779a55762e03963a39237df9046b | 2,703 | https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-web/client/actions/activities.coffee | 102 | 105 |
js2coffee/js2coffee:test/helpers.coffee:1:raw_corpus | raw_corpus | require 'coffee-script/register'
require './setup'
describe 'Helpers', ->
{delimit, quote} = require('../lib/helpers')
it 'delimit', ->
result = delimit(['a', 'b'], '-')
expect(result).eql ['a', '-', 'b']
describe 'quote', ->
test = (left, result) ->
it left, ->
expect(quote(left)).e... | CoffeeScript | js2coffee/js2coffee | test/helpers.coffee | MIT | 47d3159aba94ffd4377138f7837717d8628eef9f | 2,082 | https://github.com/js2coffee/js2coffee/blob/47d3159aba94ffd4377138f7837717d8628eef9f/test/helpers.coffee | 1 | 19 | ||
js2coffee/js2coffee:test/helpers.coffee:1:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
require 'coffee-script/register'
require './setup'
describe 'Helpers', ->
{delimit, quote} = require('../lib/helpers')
it 'delimit', ->
result = delimit(['a', 'b'], '-')
expect(result).eql ['a', '-', 'b']
describe 'quote', ->
test = (left, r... | require('coffee-script/register');
require('./setup');
describe('Helpers', function() {
var delimit, quote;
({delimit, quote} = require('../lib/helpers'));
it('delimit', function() {
var result;
result = delimit(['a', 'b'], '-');
return expect(result).eql(['a', '-', 'b']);
});
return describe('q... | CoffeeScript | JavaScript | js2coffee/js2coffee | test/helpers.coffee | MIT | 47d3159aba94ffd4377138f7837717d8628eef9f | 2,082 | https://github.com/js2coffee/js2coffee/blob/47d3159aba94ffd4377138f7837717d8628eef9f/test/helpers.coffee | 1 | 19 |
js2coffee/js2coffee:test/helpers.coffee:1:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
require('coffee-script/register');
require('./setup');
describe('Helpers', function() {
var delimit, quote;
({delimit, quote} = require('../lib/helpers'));
it('delimit', function() {
var result;
result = delimit(['a', 'b'], '-');
return expect(r... | require 'coffee-script/register'
require './setup'
describe 'Helpers', ->
{delimit, quote} = require('../lib/helpers')
it 'delimit', ->
result = delimit(['a', 'b'], '-')
expect(result).eql ['a', '-', 'b']
describe 'quote', ->
test = (left, result) ->
it left, ->
expect(quote(left)).e... | JavaScript | CoffeeScript | js2coffee/js2coffee | test/helpers.coffee | MIT | 47d3159aba94ffd4377138f7837717d8628eef9f | 2,082 | https://github.com/js2coffee/js2coffee/blob/47d3159aba94ffd4377138f7837717d8628eef9f/test/helpers.coffee | 1 | 19 |
js2coffee/js2coffee:test/helpers.coffee:1:completion | completion | require 'coffee-script/register'
require './setup'
describe 'Helpers', ->
{delimit, quote} = require('../lib/helpers')
it 'delimit', ->
result = delimit(['a', 'b'], '-')
expect(result).eql ['a', '-', 'b'] | describe 'quote', ->
test = (left, result) ->
it left, ->
expect(quote(left)).eql(result)
test "hello", "'hello'"
test "hello 'world'", "'hello \\'world\\''"
test "\"hello\" 'world'", "'\"hello\" \\'world\\''" | CoffeeScript | CoffeeScript | js2coffee/js2coffee | test/helpers.coffee | MIT | 47d3159aba94ffd4377138f7837717d8628eef9f | 2,082 | https://github.com/js2coffee/js2coffee/blob/47d3159aba94ffd4377138f7837717d8628eef9f/test/helpers.coffee | 1 | 19 |
js2coffee/js2coffee:test/helpers.coffee:1:raw_corpus | raw_corpus | require 'coffee-script/register'
require './setup'
describe 'Helpers', ->
{delimit} = require('../lib/helpers')
it 'delimit', ->
result = delimit(['a', 'b'], '-')
expect(result).eql ['a', '-', 'b'] | CoffeeScript | js2coffee/js2coffee | test/helpers.coffee | MIT | bfc11f90ef657fdbfe40ad982a7361636fe887b4 | 2,082 | https://github.com/js2coffee/js2coffee/blob/bfc11f90ef657fdbfe40ad982a7361636fe887b4/test/helpers.coffee | 1 | 9 | ||
js2coffee/js2coffee:test/helpers.coffee:1:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
require 'coffee-script/register'
require './setup'
describe 'Helpers', ->
{delimit} = require('../lib/helpers')
it 'delimit', ->
result = delimit(['a', 'b'], '-')
expect(result).eql ['a', '-', 'b']
``` | require('coffee-script/register');
require('./setup');
describe('Helpers', function() {
var delimit;
({delimit} = require('../lib/helpers'));
return it('delimit', function() {
var result;
result = delimit(['a', 'b'], '-');
return expect(result).eql(['a', '-', 'b']);
});
}); | CoffeeScript | JavaScript | js2coffee/js2coffee | test/helpers.coffee | MIT | bfc11f90ef657fdbfe40ad982a7361636fe887b4 | 2,082 | https://github.com/js2coffee/js2coffee/blob/bfc11f90ef657fdbfe40ad982a7361636fe887b4/test/helpers.coffee | 1 | 9 |
js2coffee/js2coffee:test/helpers.coffee:1:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
require('coffee-script/register');
require('./setup');
describe('Helpers', function() {
var delimit;
({delimit} = require('../lib/helpers'));
return it('delimit', function() {
var result;
result = delimit(['a', 'b'], '-');
return expect(result).... | require 'coffee-script/register'
require './setup'
describe 'Helpers', ->
{delimit} = require('../lib/helpers')
it 'delimit', ->
result = delimit(['a', 'b'], '-')
expect(result).eql ['a', '-', 'b'] | JavaScript | CoffeeScript | js2coffee/js2coffee | test/helpers.coffee | MIT | bfc11f90ef657fdbfe40ad982a7361636fe887b4 | 2,082 | https://github.com/js2coffee/js2coffee/blob/bfc11f90ef657fdbfe40ad982a7361636fe887b4/test/helpers.coffee | 1 | 9 |
js2coffee/js2coffee:test/helpers.coffee:1:completion | completion | require 'coffee-script/register'
require './setup'
describe 'Helpers', -> | {delimit} = require('../lib/helpers')
it 'delimit', ->
result = delimit(['a', 'b'], '-')
expect(result).eql ['a', '-', 'b'] | CoffeeScript | CoffeeScript | js2coffee/js2coffee | test/helpers.coffee | MIT | bfc11f90ef657fdbfe40ad982a7361636fe887b4 | 2,082 | https://github.com/js2coffee/js2coffee/blob/bfc11f90ef657fdbfe40ad982a7361636fe887b4/test/helpers.coffee | 1 | 9 |
jnordberg/wintersmith:src/cli/version.coffee:1:raw_corpus | raw_corpus | # this file is overwritten by a hardcoded version when compiling the coffeescript
path = require 'path'
{readJSONSync} = require './../core/utils'
version = readJSONSync(path.join(__dirname, '../../package.json')).version
module.exports = version | CoffeeScript | jnordberg/wintersmith | src/cli/version.coffee | MIT | be757f5f7d72ddce462f67913c9cd7c578162018 | 3,484 | https://github.com/jnordberg/wintersmith/blob/be757f5f7d72ddce462f67913c9cd7c578162018/src/cli/version.coffee | 1 | 5 | ||
jnordberg/wintersmith:src/cli/version.coffee:1:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
# this file is overwritten by a hardcoded version when compiling the coffeescript
path = require 'path'
{readJSONSync} = require './../core/utils'
version = readJSONSync(path.join(__dirname, '../../package.json')).version
module.exports = version
``` | // this file is overwritten by a hardcoded version when compiling the coffeescript
var path, readJSONSync, version;
path = require('path');
({readJSONSync} = require('./../core/utils'));
version = readJSONSync(path.join(__dirname, '../../package.json')).version;
module.exports = version; | CoffeeScript | JavaScript | jnordberg/wintersmith | src/cli/version.coffee | MIT | be757f5f7d72ddce462f67913c9cd7c578162018 | 3,484 | https://github.com/jnordberg/wintersmith/blob/be757f5f7d72ddce462f67913c9cd7c578162018/src/cli/version.coffee | 1 | 5 |
jnordberg/wintersmith:src/cli/version.coffee:1:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
// this file is overwritten by a hardcoded version when compiling the coffeescript
var path, readJSONSync, version;
path = require('path');
({readJSONSync} = require('./../core/utils'));
version = readJSONSync(path.join(__dirname, '../../package.json')).version;... | # this file is overwritten by a hardcoded version when compiling the coffeescript
path = require 'path'
{readJSONSync} = require './../core/utils'
version = readJSONSync(path.join(__dirname, '../../package.json')).version
module.exports = version | JavaScript | CoffeeScript | jnordberg/wintersmith | src/cli/version.coffee | MIT | be757f5f7d72ddce462f67913c9cd7c578162018 | 3,484 | https://github.com/jnordberg/wintersmith/blob/be757f5f7d72ddce462f67913c9cd7c578162018/src/cli/version.coffee | 1 | 5 |
jnordberg/wintersmith:src/cli/version.coffee:1:completion | completion | # this file is overwritten by a hardcoded version when compiling the coffeescript
path = require 'path' | {readJSONSync} = require './../core/utils'
version = readJSONSync(path.join(__dirname, '../../package.json')).version
module.exports = version | CoffeeScript | CoffeeScript | jnordberg/wintersmith | src/cli/version.coffee | MIT | be757f5f7d72ddce462f67913c9cd7c578162018 | 3,484 | https://github.com/jnordberg/wintersmith/blob/be757f5f7d72ddce462f67913c9cd7c578162018/src/cli/version.coffee | 1 | 5 |
mauricemach/zappa:foo.coffee:1:raw_corpus | raw_corpus | require('./src/zappa') ->
@enable 'default layout'
@set databag: 'param'
@get '/': ->
@render 'index'
@on connection: ->
@emit welcome: {motd: 'data in the param!'}
@client '/index.js': ->
@connect()
@on welcome: (d) ->
console.log 'welcome:', d.motd
@view index: ->
@title = '... | CoffeeScript | mauricemach/zappa | foo.coffee | MIT | 97c7ba23356254d5006e2cb8cb2c0012b05553ac | 943 | https://github.com/mauricemach/zappa/blob/97c7ba23356254d5006e2cb8cb2c0012b05553ac/foo.coffee | 1 | 20 | ||
mauricemach/zappa:foo.coffee:1:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
require('./src/zappa') ->
@enable 'default layout'
@set databag: 'param'
@get '/': ->
@render 'index'
@on connection: ->
@emit welcome: {motd: 'data in the param!'}
@client '/index.js': ->
@connect()
@on welcome: (d) ->
console... | require('./src/zappa')(function() {
this.enable('default layout');
this.set({
databag: 'param'
});
this.get({
'/': function() {
return this.render('index');
}
});
this.on({
connection: function() {
return this.emit({
welcome: {
motd: 'data in the param!'
... | CoffeeScript | JavaScript | mauricemach/zappa | foo.coffee | MIT | 97c7ba23356254d5006e2cb8cb2c0012b05553ac | 943 | https://github.com/mauricemach/zappa/blob/97c7ba23356254d5006e2cb8cb2c0012b05553ac/foo.coffee | 1 | 20 |
mauricemach/zappa:foo.coffee:1:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
require('./src/zappa')(function() {
this.enable('default layout');
this.set({
databag: 'param'
});
this.get({
'/': function() {
return this.render('index');
}
});
this.on({
connection: function() {
return this.emit({
... | require('./src/zappa') ->
@enable 'default layout'
@set databag: 'param'
@get '/': ->
@render 'index'
@on connection: ->
@emit welcome: {motd: 'data in the param!'}
@client '/index.js': ->
@connect()
@on welcome: (d) ->
console.log 'welcome:', d.motd
@view index: ->
@title = '... | JavaScript | CoffeeScript | mauricemach/zappa | foo.coffee | MIT | 97c7ba23356254d5006e2cb8cb2c0012b05553ac | 943 | https://github.com/mauricemach/zappa/blob/97c7ba23356254d5006e2cb8cb2c0012b05553ac/foo.coffee | 1 | 20 |
mauricemach/zappa:foo.coffee:1:completion | completion | require('./src/zappa') ->
@enable 'default layout'
@set databag: 'param'
@get '/': ->
@render 'index'
@on connection: ->
@emit welcome: {motd: 'data in the param!'} | @client '/index.js': ->
@connect()
@on welcome: (d) ->
console.log 'welcome:', d.motd
@view index: ->
@title = 'Crazy zappa experiment'
@scripts = ['/socket.io/socket.io', '/zappa/zappa', '/index']
p @foo | CoffeeScript | CoffeeScript | mauricemach/zappa | foo.coffee | MIT | 97c7ba23356254d5006e2cb8cb2c0012b05553ac | 943 | https://github.com/mauricemach/zappa/blob/97c7ba23356254d5006e2cb8cb2c0012b05553ac/foo.coffee | 1 | 20 |
mauricemach/zappa:foo.coffee:1:raw_corpus | raw_corpus | require('./src/zappa') ->
@enable 'default layout'
@set views: __dirname + '/tests/views'
@get '/': ->
@render index: {foo: 'bong'}
@view index: ->
@title = 'shaboo'
p 'inline view'
p @foo | CoffeeScript | mauricemach/zappa | foo.coffee | MIT | 61d478cabf33dd23e5c6b52527dccc4887bb10cc | 943 | https://github.com/mauricemach/zappa/blob/61d478cabf33dd23e5c6b52527dccc4887bb10cc/foo.coffee | 1 | 12 | ||
mauricemach/zappa:foo.coffee:1:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
require('./src/zappa') ->
@enable 'default layout'
@set views: __dirname + '/tests/views'
@get '/': ->
@render index: {foo: 'bong'}
@view index: ->
@title = 'shaboo'
p 'inline view'
p @foo
``` | require('./src/zappa')(function() {
this.enable('default layout');
this.set({
views: __dirname + '/tests/views'
});
this.get({
'/': function() {
return this.render({
index: {
foo: 'bong'
}
});
}
});
return this.view({
index: function() {
this.title... | CoffeeScript | JavaScript | mauricemach/zappa | foo.coffee | MIT | 61d478cabf33dd23e5c6b52527dccc4887bb10cc | 943 | https://github.com/mauricemach/zappa/blob/61d478cabf33dd23e5c6b52527dccc4887bb10cc/foo.coffee | 1 | 12 |
mauricemach/zappa:foo.coffee:1:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
require('./src/zappa')(function() {
this.enable('default layout');
this.set({
views: __dirname + '/tests/views'
});
this.get({
'/': function() {
return this.render({
index: {
foo: 'bong'
}
});
}
});
retu... | require('./src/zappa') ->
@enable 'default layout'
@set views: __dirname + '/tests/views'
@get '/': ->
@render index: {foo: 'bong'}
@view index: ->
@title = 'shaboo'
p 'inline view'
p @foo | JavaScript | CoffeeScript | mauricemach/zappa | foo.coffee | MIT | 61d478cabf33dd23e5c6b52527dccc4887bb10cc | 943 | https://github.com/mauricemach/zappa/blob/61d478cabf33dd23e5c6b52527dccc4887bb10cc/foo.coffee | 1 | 12 |
mauricemach/zappa:foo.coffee:1:completion | completion | require('./src/zappa') ->
@enable 'default layout'
@set views: __dirname + '/tests/views'
@get '/': -> | @render index: {foo: 'bong'}
@view index: ->
@title = 'shaboo'
p 'inline view'
p @foo | CoffeeScript | CoffeeScript | mauricemach/zappa | foo.coffee | MIT | 61d478cabf33dd23e5c6b52527dccc4887bb10cc | 943 | https://github.com/mauricemach/zappa/blob/61d478cabf33dd23e5c6b52527dccc4887bb10cc/foo.coffee | 1 | 12 |
mauricemach/zappa:foo.coffee:1:raw_corpus | raw_corpus | require('./src/zappa') ->
@enable 'default layout'
@set views: __dirname + '/tests/views'
@get '/': ->
@render 'index'
@view index: ->
@title = 'shaboo'
p 'inline view'
@view layoute: ->
doctype 5
html ->
head ->
title 'inline layout'
body @body | CoffeeScript | mauricemach/zappa | foo.coffee | MIT | 21553f96796848037cf9023fd4d8666d7e149eb4 | 943 | https://github.com/mauricemach/zappa/blob/21553f96796848037cf9023fd4d8666d7e149eb4/foo.coffee | 1 | 18 | ||
mauricemach/zappa:foo.coffee:1:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
require('./src/zappa') ->
@enable 'default layout'
@set views: __dirname + '/tests/views'
@get '/': ->
@render 'index'
@view index: ->
@title = 'shaboo'
p 'inline view'
@view layoute: ->
doctype 5
html ->
head ->
ti... | require('./src/zappa')(function() {
this.enable('default layout');
this.set({
views: __dirname + '/tests/views'
});
this.get({
'/': function() {
return this.render('index');
}
});
this.view({
index: function() {
this.title = 'shaboo';
return p('inline view');
}
});
... | CoffeeScript | JavaScript | mauricemach/zappa | foo.coffee | MIT | 21553f96796848037cf9023fd4d8666d7e149eb4 | 943 | https://github.com/mauricemach/zappa/blob/21553f96796848037cf9023fd4d8666d7e149eb4/foo.coffee | 1 | 18 |
mauricemach/zappa:foo.coffee:1:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
require('./src/zappa')(function() {
this.enable('default layout');
this.set({
views: __dirname + '/tests/views'
});
this.get({
'/': function() {
return this.render('index');
}
});
this.view({
index: function() {
this.title = ... | require('./src/zappa') ->
@enable 'default layout'
@set views: __dirname + '/tests/views'
@get '/': ->
@render 'index'
@view index: ->
@title = 'shaboo'
p 'inline view'
@view layoute: ->
doctype 5
html ->
head ->
title 'inline layout'
body @body | JavaScript | CoffeeScript | mauricemach/zappa | foo.coffee | MIT | 21553f96796848037cf9023fd4d8666d7e149eb4 | 943 | https://github.com/mauricemach/zappa/blob/21553f96796848037cf9023fd4d8666d7e149eb4/foo.coffee | 1 | 18 |
mauricemach/zappa:foo.coffee:1:completion | completion | require('./src/zappa') ->
@enable 'default layout'
@set views: __dirname + '/tests/views'
@get '/': ->
@render 'index'
@view index: -> | @title = 'shaboo'
p 'inline view'
@view layoute: ->
doctype 5
html ->
head ->
title 'inline layout'
body @body | CoffeeScript | CoffeeScript | mauricemach/zappa | foo.coffee | MIT | 21553f96796848037cf9023fd4d8666d7e149eb4 | 943 | https://github.com/mauricemach/zappa/blob/21553f96796848037cf9023fd4d8666d7e149eb4/foo.coffee | 1 | 18 |
mauricemach/zappa:foo.coffee:1:raw_corpus | raw_corpus | require('./src/zappa') ->
@enable 'default layout', 'autoimport', 'autoexport'
sleep = (secs, cb) ->
setTimeout cb, secs * 1000
@get '/': -> @redirect '/bar'
@get '/:foo': ->
@foo += 'a'
sleep 3, =>
@foo += 'b'
@render 'index'
@view index: ->
@title = 'Async example'
h1 'A... | CoffeeScript | mauricemach/zappa | foo.coffee | MIT | 2f373ce1622801e11822adff5138103887427b62 | 943 | https://github.com/mauricemach/zappa/blob/2f373ce1622801e11822adff5138103887427b62/foo.coffee | 1 | 19 | ||
mauricemach/zappa:foo.coffee:1:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
require('./src/zappa') ->
@enable 'default layout', 'autoimport', 'autoexport'
sleep = (secs, cb) ->
setTimeout cb, secs * 1000
@get '/': -> @redirect '/bar'
@get '/:foo': ->
@foo += 'a'
sleep 3, =>
@foo += 'b'
@render 'index'
... | require('./src/zappa')(function() {
var sleep;
this.enable('default layout', 'autoimport', 'autoexport');
sleep = function(secs, cb) {
return setTimeout(cb, secs * 1000);
};
this.get({
'/': function() {
return this.redirect('/bar');
}
});
this.get({
'/:foo': function() {
this.f... | CoffeeScript | JavaScript | mauricemach/zappa | foo.coffee | MIT | 2f373ce1622801e11822adff5138103887427b62 | 943 | https://github.com/mauricemach/zappa/blob/2f373ce1622801e11822adff5138103887427b62/foo.coffee | 1 | 19 |
mauricemach/zappa:foo.coffee:1:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
require('./src/zappa')(function() {
var sleep;
this.enable('default layout', 'autoimport', 'autoexport');
sleep = function(secs, cb) {
return setTimeout(cb, secs * 1000);
};
this.get({
'/': function() {
return this.redirect('/bar');
}
... | require('./src/zappa') ->
@enable 'default layout', 'autoimport', 'autoexport'
sleep = (secs, cb) ->
setTimeout cb, secs * 1000
@get '/': -> @redirect '/bar'
@get '/:foo': ->
@foo += 'a'
sleep 3, =>
@foo += 'b'
@render 'index'
@view index: ->
@title = 'Async example'
h1 'A... | JavaScript | CoffeeScript | mauricemach/zappa | foo.coffee | MIT | 2f373ce1622801e11822adff5138103887427b62 | 943 | https://github.com/mauricemach/zappa/blob/2f373ce1622801e11822adff5138103887427b62/foo.coffee | 1 | 19 |
mauricemach/zappa:foo.coffee:1:completion | completion | require('./src/zappa') ->
@enable 'default layout', 'autoimport', 'autoexport'
sleep = (secs, cb) ->
setTimeout cb, secs * 1000
@get '/': -> @redirect '/bar'
@get '/:foo': -> | @foo += 'a'
sleep 3, =>
@foo += 'b'
@render 'index'
@view index: ->
@title = 'Async example'
h1 'Async'
p @foo | CoffeeScript | CoffeeScript | mauricemach/zappa | foo.coffee | MIT | 2f373ce1622801e11822adff5138103887427b62 | 943 | https://github.com/mauricemach/zappa/blob/2f373ce1622801e11822adff5138103887427b62/foo.coffee | 1 | 19 |
mauricemach/zappa:foo.coffee:1:raw_corpus | raw_corpus | require('./src/zappa') ->
@helper sum: (a, b) ->
(a + b + @ble).toString()
subtract = (a, b) ->
(a - b).toString()
@get '/': ->
@redirect '/ohai'
@get '/context_as_param': (c) ->
c.send 'context_as_param'
@get '/ohai': ->
#@ble = 5
#subtract 17, 5
@render 'index'
@on connect... | CoffeeScript | mauricemach/zappa | foo.coffee | MIT | 6a64221e9a7723ae73918388f39103e4a7460f98 | 943 | https://github.com/mauricemach/zappa/blob/6a64221e9a7723ae73918388f39103e4a7460f98/foo.coffee | 1 | 40 | ||
mauricemach/zappa:foo.coffee:1:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
require('./src/zappa') ->
@helper sum: (a, b) ->
(a + b + @ble).toString()
subtract = (a, b) ->
(a - b).toString()
@get '/': ->
@redirect '/ohai'
@get '/context_as_param': (c) ->
c.send 'context_as_param'
@get '/ohai': ->
#@ble =... | require('./src/zappa')(function() {
var subtract;
this.helper({
sum: function(a, b) {
return (a + b + this.ble).toString();
}
});
subtract = function(a, b) {
return (a - b).toString();
};
this.get({
'/': function() {
return this.redirect('/ohai');
}
});
this.get({
'/c... | CoffeeScript | JavaScript | mauricemach/zappa | foo.coffee | MIT | 6a64221e9a7723ae73918388f39103e4a7460f98 | 943 | https://github.com/mauricemach/zappa/blob/6a64221e9a7723ae73918388f39103e4a7460f98/foo.coffee | 1 | 40 |
mauricemach/zappa:foo.coffee:1:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
require('./src/zappa')(function() {
var subtract;
this.helper({
sum: function(a, b) {
return (a + b + this.ble).toString();
}
});
subtract = function(a, b) {
return (a - b).toString();
};
this.get({
'/': function() {
return t... | require('./src/zappa') ->
@helper sum: (a, b) ->
(a + b + @ble).toString()
subtract = (a, b) ->
(a - b).toString()
@get '/': ->
@redirect '/ohai'
@get '/context_as_param': (c) ->
c.send 'context_as_param'
@get '/ohai': ->
#@ble = 5
#subtract 17, 5
@render 'index'
@on connect... | JavaScript | CoffeeScript | mauricemach/zappa | foo.coffee | MIT | 6a64221e9a7723ae73918388f39103e4a7460f98 | 943 | https://github.com/mauricemach/zappa/blob/6a64221e9a7723ae73918388f39103e4a7460f98/foo.coffee | 1 | 40 |
mauricemach/zappa:foo.coffee:1:completion | completion | require('./src/zappa') ->
@helper sum: (a, b) ->
(a + b + @ble).toString()
subtract = (a, b) ->
(a - b).toString()
@get '/': ->
@redirect '/ohai'
@get '/context_as_param': (c) ->
c.send 'context_as_param'
@get '/ohai': ->
#@ble = 5
#subtract 17, 5
@render 'index'
@on connect... | @on shout: ->
@broadcast 'shouted'
@view index: ->
h1 'fooa'
@view layout: ->
doctype 5
html ->
head ->
title 'foo'
script src: '/socket.io/socket.io.js'
coffeescript ->
window.onload = ->
socket = io.connect 'http://localhost'
socket.on 'welc... | CoffeeScript | CoffeeScript | mauricemach/zappa | foo.coffee | MIT | 6a64221e9a7723ae73918388f39103e4a7460f98 | 943 | https://github.com/mauricemach/zappa/blob/6a64221e9a7723ae73918388f39103e4a7460f98/foo.coffee | 1 | 40 |
jianliaoim/talk-os:talk-account/server/mailers/reset-password.coffee:1:raw_corpus | raw_corpus | _ = require 'lodash'
debug = require('debug')('talk:verbose')
BaseMailer = require './base'
util = require '../util'
class ResetPasswordMailer extends BaseMailer
delay: 0
action: 'send'
template: 'reset-password'
send: (verifyData, emailAddress) ->
email =
id: "resetpassword_#{emailAddress}"
... | CoffeeScript | jianliaoim/talk-os | talk-account/server/mailers/reset-password.coffee | MIT | 2545c4497865779a55762e03963a39237df9046b | 2,703 | https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-account/server/mailers/reset-password.coffee | 1 | 34 | ||
jianliaoim/talk-os:talk-account/server/mailers/reset-password.coffee:1:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
_ = require 'lodash'
debug = require('debug')('talk:verbose')
BaseMailer = require './base'
util = require '../util'
class ResetPasswordMailer extends BaseMailer
delay: 0
action: 'send'
template: 'reset-password'
send: (verifyData, emailAddress) ->
... | var BaseMailer, ResetPasswordMailer, _, debug, util;
_ = require('lodash');
debug = require('debug')('talk:verbose');
BaseMailer = require('./base');
util = require('../util');
ResetPasswordMailer = (function() {
class ResetPasswordMailer extends BaseMailer {
send(verifyData, emailAddress) {
var email;... | CoffeeScript | JavaScript | jianliaoim/talk-os | talk-account/server/mailers/reset-password.coffee | MIT | 2545c4497865779a55762e03963a39237df9046b | 2,703 | https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-account/server/mailers/reset-password.coffee | 1 | 34 |
jianliaoim/talk-os:talk-account/server/mailers/reset-password.coffee:1:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
var BaseMailer, ResetPasswordMailer, _, debug, util;
_ = require('lodash');
debug = require('debug')('talk:verbose');
BaseMailer = require('./base');
util = require('../util');
ResetPasswordMailer = (function() {
class ResetPasswordMailer extends BaseMailer ... | _ = require 'lodash'
debug = require('debug')('talk:verbose')
BaseMailer = require './base'
util = require '../util'
class ResetPasswordMailer extends BaseMailer
delay: 0
action: 'send'
template: 'reset-password'
send: (verifyData, emailAddress) ->
email =
id: "resetpassword_#{emailAddress}"
... | JavaScript | CoffeeScript | jianliaoim/talk-os | talk-account/server/mailers/reset-password.coffee | MIT | 2545c4497865779a55762e03963a39237df9046b | 2,703 | https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-account/server/mailers/reset-password.coffee | 1 | 34 |
jianliaoim/talk-os:talk-account/server/mailers/reset-password.coffee:1:completion | completion | _ = require 'lodash'
debug = require('debug')('talk:verbose')
BaseMailer = require './base'
util = require '../util'
class ResetPasswordMailer extends BaseMailer
delay: 0
action: 'send'
template: 'reset-password'
send: (verifyData, emailAddress) ->
email =
id: "resetpassword_#{emailAddress}"
... | email = _.assign email, verifyData
email.resetUrl = util.buildResetPasswordUrl verifyData
debug email
@_sendByRender email
preview: (callback) ->
email =
subject: "[简聊] 密码重置"
emailAddress: 'user@mailer.com'
verifyCode: '1234'
resetUrl: 'https://jianliao.com/site'
super e... | CoffeeScript | CoffeeScript | jianliaoim/talk-os | talk-account/server/mailers/reset-password.coffee | MIT | 2545c4497865779a55762e03963a39237df9046b | 2,703 | https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-account/server/mailers/reset-password.coffee | 1 | 34 |
gterrono/houston:client/router.coffee:2:raw_corpus | raw_corpus | setup_collection = (collection_name, document_id) ->
subscription_name = Houston._houstonize collection_name
filter = if document_id
# Sometimes you can lookup with _id being a string, sometimes not
# When id can be wrapped in an ObjectID, it should
# It can't if it isn't 12 bytes (24 characters)
if... | CoffeeScript | gterrono/houston | client/router.coffee | MIT | 581357048f3577f0487ed598e26eaf063c813183 | 802 | https://github.com/gterrono/houston/blob/581357048f3577f0487ed598e26eaf063c813183/client/router.coffee | 9 | 22 | ||
gterrono/houston:client/router.coffee:2:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
setup_collection = (collection_name, document_id) ->
subscription_name = Houston._houstonize collection_name
filter = if document_id
# Sometimes you can lookup with _id being a string, sometimes not
# When id can be wrapped in an ObjectID, it should
... | var setup_collection;
setup_collection = function(collection_name, document_id) {
var filter, subscription_name;
subscription_name = Houston._houstonize(collection_name);
// Sometimes you can lookup with _id being a string, sometimes not
// When id can be wrapped in an ObjectID, it should
// It can't if it i... | CoffeeScript | JavaScript | gterrono/houston | client/router.coffee | MIT | 581357048f3577f0487ed598e26eaf063c813183 | 802 | https://github.com/gterrono/houston/blob/581357048f3577f0487ed598e26eaf063c813183/client/router.coffee | 9 | 22 |
gterrono/houston:client/router.coffee:2:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
var setup_collection;
setup_collection = function(collection_name, document_id) {
var filter, subscription_name;
subscription_name = Houston._houstonize(collection_name);
// Sometimes you can lookup with _id being a string, sometimes not
// When id can be ... | setup_collection = (collection_name, document_id) ->
subscription_name = Houston._houstonize collection_name
filter = if document_id
# Sometimes you can lookup with _id being a string, sometimes not
# When id can be wrapped in an ObjectID, it should
# It can't if it isn't 12 bytes (24 characters)
if... | JavaScript | CoffeeScript | gterrono/houston | client/router.coffee | MIT | 581357048f3577f0487ed598e26eaf063c813183 | 802 | https://github.com/gterrono/houston/blob/581357048f3577f0487ed598e26eaf063c813183/client/router.coffee | 9 | 22 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.