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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
mauricemach/zappa:src/client.coffee:3:completion | completion | @build = (version, settings) ->
String(skeleton) | .replace('version = null;', "version = '#{version}';")
.replace('settings = null;', "var settings = #{JSON.stringify settings};") | CoffeeScript | CoffeeScript | mauricemach/zappa | src/client.coffee | MIT | 725e0103755c9a92fe84de06cee82db00e51a1f8 | 943 | https://github.com/mauricemach/zappa/blob/725e0103755c9a92fe84de06cee82db00e51a1f8/src/client.coffee | 86 | 89 |
mauricemach/zappa:src/client.coffee:1:raw_corpus | raw_corpus | skeleton = ->
zappa = window.zappa = {}
zappa.version = null
coffeescript_helpers = null
settings = null
zappa.run = (func) ->
context = {}
# Storage for the functions provided by the user.
ws_handlers = {}
helpers = {}
app = context.app = Sammy() if Sammy?
context.get = ->
... | CoffeeScript | mauricemach/zappa | src/client.coffee | MIT | 6d43d671160728a90b2ad03925ff3256aed45c9e | 943 | https://github.com/mauricemach/zappa/blob/6d43d671160728a90b2ad03925ff3256aed45c9e/src/client.coffee | 2 | 51 | ||
mauricemach/zappa:src/client.coffee:1:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
skeleton = ->
zappa = window.zappa = {}
zappa.version = null
coffeescript_helpers = null
settings = null
zappa.run = (func) ->
context = {}
# Storage for the functions provided by the user.
ws_handlers = {}
helpers = {}
app = con... | var skeleton;
skeleton = function() {
var coffeescript_helpers, settings, zappa;
zappa = window.zappa = {};
zappa.version = null;
coffeescript_helpers = null;
settings = null;
return zappa.run = function(func) {
var app, context, helpers, route, ws_handlers;
context = {};
// Storage for the fun... | CoffeeScript | JavaScript | mauricemach/zappa | src/client.coffee | MIT | 6d43d671160728a90b2ad03925ff3256aed45c9e | 943 | https://github.com/mauricemach/zappa/blob/6d43d671160728a90b2ad03925ff3256aed45c9e/src/client.coffee | 2 | 51 |
mauricemach/zappa:src/client.coffee:1:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
var skeleton;
skeleton = function() {
var coffeescript_helpers, settings, zappa;
zappa = window.zappa = {};
zappa.version = null;
coffeescript_helpers = null;
settings = null;
return zappa.run = function(func) {
var app, context, helpers, route, ws... | skeleton = ->
zappa = window.zappa = {}
zappa.version = null
coffeescript_helpers = null
settings = null
zappa.run = (func) ->
context = {}
# Storage for the functions provided by the user.
ws_handlers = {}
helpers = {}
app = context.app = Sammy() if Sammy?
context.get = ->
... | JavaScript | CoffeeScript | mauricemach/zappa | src/client.coffee | MIT | 6d43d671160728a90b2ad03925ff3256aed45c9e | 943 | https://github.com/mauricemach/zappa/blob/6d43d671160728a90b2ad03925ff3256aed45c9e/src/client.coffee | 2 | 51 |
mauricemach/zappa:src/client.coffee:1:completion | completion | skeleton = ->
zappa = window.zappa = {}
zappa.version = null
coffeescript_helpers = null
settings = null
zappa.run = (func) ->
context = {}
# Storage for the functions provided by the user.
ws_handlers = {}
helpers = {}
app = context.app = Sammy() if Sammy?
context.get = ->
... | helpers[k] = v
context.on = (obj) ->
for k, v of obj
ws_handlers[k] = v
context.connect = ->
context.socket = io.connect.apply io, arguments
context.emit = ->
if typeof arguments[0] isnt 'object'
context.socket.emit.apply context.socket, arguments
else
for ... | CoffeeScript | CoffeeScript | mauricemach/zappa | src/client.coffee | MIT | 6d43d671160728a90b2ad03925ff3256aed45c9e | 943 | https://github.com/mauricemach/zappa/blob/6d43d671160728a90b2ad03925ff3256aed45c9e/src/client.coffee | 2 | 51 |
mauricemach/zappa:src/client.coffee:2:raw_corpus | raw_corpus | ctx.sammy_context = sammy_context
ctx.render = -> sammy_context.render.apply sammy_context, arguments
ctx.redirect = -> sammy_context.redirect.apply sammy_context, arguments
switch settings['databag']
when 'this' then r.handler.apply(sammy_context.params, [ctx])
when 'param' ... | CoffeeScript | mauricemach/zappa | src/client.coffee | MIT | 6d43d671160728a90b2ad03925ff3256aed45c9e | 943 | https://github.com/mauricemach/zappa/blob/6d43d671160728a90b2ad03925ff3256aed45c9e/src/client.coffee | 52 | 85 | ||
mauricemach/zappa:src/client.coffee:2:completion | completion | ctx.sammy_context = sammy_context
ctx.render = -> sammy_context.render.apply sammy_context, arguments
ctx.redirect = -> sammy_context.redirect.apply sammy_context, arguments
switch settings['databag']
when 'this' then r.handler.apply(sammy_context.params, [ctx])
when 'param' ... | app: app
socket: context.socket
id: context.socket.id
data: data
emit: context.emit
for name, helper of helpers
do (name, helper) ->
ctx[name] = ->
helper.apply(ctx, arguments)
switch settin... | CoffeeScript | CoffeeScript | mauricemach/zappa | src/client.coffee | MIT | 6d43d671160728a90b2ad03925ff3256aed45c9e | 943 | https://github.com/mauricemach/zappa/blob/6d43d671160728a90b2ad03925ff3256aed45c9e/src/client.coffee | 52 | 85 |
mauricemach/zappa:src/client.coffee:3:raw_corpus | raw_corpus | @build = (version, coffeescript_helpers, settings) ->
String(skeleton)
.replace('version = null;', "version = '#{version}';")
.replace('coffeescript_helpers = null;', "var coffeescript_helpers = '#{coffeescript_helpers}';")
.replace('settings = null;', "var settings = #{JSON.stringify settings};") | CoffeeScript | mauricemach/zappa | src/client.coffee | MIT | 6d43d671160728a90b2ad03925ff3256aed45c9e | 943 | https://github.com/mauricemach/zappa/blob/6d43d671160728a90b2ad03925ff3256aed45c9e/src/client.coffee | 87 | 91 | ||
mauricemach/zappa:src/client.coffee:3:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
@build = (version, coffeescript_helpers, settings) ->
String(skeleton)
.replace('version = null;', "version = '#{version}';")
.replace('coffeescript_helpers = null;', "var coffeescript_helpers = '#{coffeescript_helpers}';")
.replace('settings = null... | this.build = function(version, coffeescript_helpers, settings) {
return String(skeleton).replace('version = null;', `version = '${version}';`).replace('coffeescript_helpers = null;', `var coffeescript_helpers = '${coffeescript_helpers}';`).replace('settings = null;', `var settings = ${JSON.stringify(settings)};`);
}; | CoffeeScript | JavaScript | mauricemach/zappa | src/client.coffee | MIT | 6d43d671160728a90b2ad03925ff3256aed45c9e | 943 | https://github.com/mauricemach/zappa/blob/6d43d671160728a90b2ad03925ff3256aed45c9e/src/client.coffee | 87 | 91 |
mauricemach/zappa:src/client.coffee:3:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
this.build = function(version, coffeescript_helpers, settings) {
return String(skeleton).replace('version = null;', `version = '${version}';`).replace('coffeescript_helpers = null;', `var coffeescript_helpers = '${coffeescript_helpers}';`).replace('settings = nul... | @build = (version, coffeescript_helpers, settings) ->
String(skeleton)
.replace('version = null;', "version = '#{version}';")
.replace('coffeescript_helpers = null;', "var coffeescript_helpers = '#{coffeescript_helpers}';")
.replace('settings = null;', "var settings = #{JSON.stringify settings};") | JavaScript | CoffeeScript | mauricemach/zappa | src/client.coffee | MIT | 6d43d671160728a90b2ad03925ff3256aed45c9e | 943 | https://github.com/mauricemach/zappa/blob/6d43d671160728a90b2ad03925ff3256aed45c9e/src/client.coffee | 87 | 91 |
mauricemach/zappa:src/client.coffee:3:completion | completion | @build = (version, coffeescript_helpers, settings) ->
String(skeleton) | .replace('version = null;', "version = '#{version}';")
.replace('coffeescript_helpers = null;', "var coffeescript_helpers = '#{coffeescript_helpers}';")
.replace('settings = null;', "var settings = #{JSON.stringify settings};") | CoffeeScript | CoffeeScript | mauricemach/zappa | src/client.coffee | MIT | 6d43d671160728a90b2ad03925ff3256aed45c9e | 943 | https://github.com/mauricemach/zappa/blob/6d43d671160728a90b2ad03925ff3256aed45c9e/src/client.coffee | 87 | 91 |
mauricemach/zappa:src/client.coffee:2:raw_corpus | raw_corpus | ctx.sammy_context = sammy_context
ctx.render = -> sammy_context.render.apply sammy_context, arguments
ctx.redirect = -> sammy_context.redirect.apply sammy_context, arguments
switch settings['databag']
when 'context' then r.handler.apply(sammy_context.params, [ctx])
when 'para... | CoffeeScript | mauricemach/zappa | src/client.coffee | MIT | 97c7ba23356254d5006e2cb8cb2c0012b05553ac | 943 | https://github.com/mauricemach/zappa/blob/97c7ba23356254d5006e2cb8cb2c0012b05553ac/src/client.coffee | 52 | 85 | ||
mauricemach/zappa:src/client.coffee:2:completion | completion | ctx.sammy_context = sammy_context
ctx.render = -> sammy_context.render.apply sammy_context, arguments
ctx.redirect = -> sammy_context.redirect.apply sammy_context, arguments
switch settings['databag']
when 'context' then r.handler.apply(sammy_context.params, [ctx])
when 'para... | app: app
socket: context.socket
id: context.socket.id
data: data
emit: context.emit
for name, helper of helpers
do (name, helper) ->
ctx[name] = ->
helper.apply(ctx, arguments)
switch settin... | CoffeeScript | CoffeeScript | mauricemach/zappa | src/client.coffee | MIT | 97c7ba23356254d5006e2cb8cb2c0012b05553ac | 943 | https://github.com/mauricemach/zappa/blob/97c7ba23356254d5006e2cb8cb2c0012b05553ac/src/client.coffee | 52 | 85 |
mauricemach/zappa:src/client.coffee:1:raw_corpus | raw_corpus | skeleton = ->
zappa = window.zappa = {}
zappa.version = null
coffeescript_helpers = null
copy_data_to = null
settings = null
zappa.run = (func) ->
context = {}
# Storage for the functions provided by the user.
ws_handlers = {}
helpers = {}
app = context.app = Sammy() if Sammy?
c... | CoffeeScript | mauricemach/zappa | src/client.coffee | MIT | ac57545504fc335151a6c6c386e8831614bc8345 | 943 | https://github.com/mauricemach/zappa/blob/ac57545504fc335151a6c6c386e8831614bc8345/src/client.coffee | 2 | 51 | ||
mauricemach/zappa:src/client.coffee:1:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
skeleton = ->
zappa = window.zappa = {}
zappa.version = null
coffeescript_helpers = null
copy_data_to = null
settings = null
zappa.run = (func) ->
context = {}
# Storage for the functions provided by the user.
ws_handlers = {}
helpe... | var skeleton;
skeleton = function() {
var coffeescript_helpers, copy_data_to, settings, zappa;
zappa = window.zappa = {};
zappa.version = null;
coffeescript_helpers = null;
copy_data_to = null;
settings = null;
return zappa.run = function(func) {
var app, context, helpers, route, ws_handlers;
con... | CoffeeScript | JavaScript | mauricemach/zappa | src/client.coffee | MIT | ac57545504fc335151a6c6c386e8831614bc8345 | 943 | https://github.com/mauricemach/zappa/blob/ac57545504fc335151a6c6c386e8831614bc8345/src/client.coffee | 2 | 51 |
mauricemach/zappa:src/client.coffee:1:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
var skeleton;
skeleton = function() {
var coffeescript_helpers, copy_data_to, settings, zappa;
zappa = window.zappa = {};
zappa.version = null;
coffeescript_helpers = null;
copy_data_to = null;
settings = null;
return zappa.run = function(func) {
... | skeleton = ->
zappa = window.zappa = {}
zappa.version = null
coffeescript_helpers = null
copy_data_to = null
settings = null
zappa.run = (func) ->
context = {}
# Storage for the functions provided by the user.
ws_handlers = {}
helpers = {}
app = context.app = Sammy() if Sammy?
c... | JavaScript | CoffeeScript | mauricemach/zappa | src/client.coffee | MIT | ac57545504fc335151a6c6c386e8831614bc8345 | 943 | https://github.com/mauricemach/zappa/blob/ac57545504fc335151a6c6c386e8831614bc8345/src/client.coffee | 2 | 51 |
mauricemach/zappa:src/client.coffee:1:completion | completion | skeleton = ->
zappa = window.zappa = {}
zappa.version = null
coffeescript_helpers = null
copy_data_to = null
settings = null
zappa.run = (func) ->
context = {}
# Storage for the functions provided by the user.
ws_handlers = {}
helpers = {}
app = context.app = Sammy() if Sammy?
c... | for k, v of obj
helpers[k] = v
context.on = (obj) ->
for k, v of obj
ws_handlers[k] = v
context.connect = ->
context.socket = io.connect.apply io, arguments
context.emit = ->
if typeof arguments[0] isnt 'object'
context.socket.emit.apply context.socket, arguments... | CoffeeScript | CoffeeScript | mauricemach/zappa | src/client.coffee | MIT | ac57545504fc335151a6c6c386e8831614bc8345 | 943 | https://github.com/mauricemach/zappa/blob/ac57545504fc335151a6c6c386e8831614bc8345/src/client.coffee | 2 | 51 |
mauricemach/zappa:src/client.coffee:2:raw_corpus | raw_corpus | ctx.params = sammy_context.params
ctx.sammy_context = sammy_context
ctx.render = -> sammy_context.render.apply sammy_context, arguments
ctx.redirect = -> sammy_context.redirect.apply sammy_context, arguments
if settings['autoimport']
# Imports input vars to ctx. Does NOT overwr... | CoffeeScript | mauricemach/zappa | src/client.coffee | MIT | ac57545504fc335151a6c6c386e8831614bc8345 | 943 | https://github.com/mauricemach/zappa/blob/ac57545504fc335151a6c6c386e8831614bc8345/src/client.coffee | 52 | 86 | ||
mauricemach/zappa:src/client.coffee:2:completion | completion | ctx.params = sammy_context.params
ctx.sammy_context = sammy_context
ctx.render = -> sammy_context.render.apply sammy_context, arguments
ctx.redirect = -> sammy_context.redirect.apply sammy_context, arguments
if settings['autoimport']
# Imports input vars to ctx. Does NOT overwr... | ctx =
app: app
socket: context.socket
id: context.socket.id
data: data
emit: context.emit
if settings['autoimport']
copy_data_to ctx, [data]
for name, helper of helpers
do (name, helper) ->
... | CoffeeScript | CoffeeScript | mauricemach/zappa | src/client.coffee | MIT | ac57545504fc335151a6c6c386e8831614bc8345 | 943 | https://github.com/mauricemach/zappa/blob/ac57545504fc335151a6c6c386e8831614bc8345/src/client.coffee | 52 | 86 |
mauricemach/zappa:src/client.coffee:3:raw_corpus | raw_corpus | @build = (version, coffeescript_helpers, copy_data_to, settings) ->
String(skeleton)
.replace('version = null;', "version = '#{version}';")
.replace('coffeescript_helpers = null;', "var coffeescript_helpers = '#{coffeescript_helpers}';")
.replace('copy_data_to = null;', "var copy_data_to = #{copy_data_to}... | CoffeeScript | mauricemach/zappa | src/client.coffee | MIT | ac57545504fc335151a6c6c386e8831614bc8345 | 943 | https://github.com/mauricemach/zappa/blob/ac57545504fc335151a6c6c386e8831614bc8345/src/client.coffee | 88 | 93 | ||
mauricemach/zappa:src/client.coffee:3:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
@build = (version, coffeescript_helpers, copy_data_to, settings) ->
String(skeleton)
.replace('version = null;', "version = '#{version}';")
.replace('coffeescript_helpers = null;', "var coffeescript_helpers = '#{coffeescript_helpers}';")
.replace('c... | this.build = function(version, coffeescript_helpers, copy_data_to, settings) {
return String(skeleton).replace('version = null;', `version = '${version}';`).replace('coffeescript_helpers = null;', `var coffeescript_helpers = '${coffeescript_helpers}';`).replace('copy_data_to = null;', `var copy_data_to = ${copy_data_... | CoffeeScript | JavaScript | mauricemach/zappa | src/client.coffee | MIT | ac57545504fc335151a6c6c386e8831614bc8345 | 943 | https://github.com/mauricemach/zappa/blob/ac57545504fc335151a6c6c386e8831614bc8345/src/client.coffee | 88 | 93 |
mauricemach/zappa:src/client.coffee:3:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
this.build = function(version, coffeescript_helpers, copy_data_to, settings) {
return String(skeleton).replace('version = null;', `version = '${version}';`).replace('coffeescript_helpers = null;', `var coffeescript_helpers = '${coffeescript_helpers}';`).replace('... | @build = (version, coffeescript_helpers, copy_data_to, settings) ->
String(skeleton)
.replace('version = null;', "version = '#{version}';")
.replace('coffeescript_helpers = null;', "var coffeescript_helpers = '#{coffeescript_helpers}';")
.replace('copy_data_to = null;', "var copy_data_to = #{copy_data_to}... | JavaScript | CoffeeScript | mauricemach/zappa | src/client.coffee | MIT | ac57545504fc335151a6c6c386e8831614bc8345 | 943 | https://github.com/mauricemach/zappa/blob/ac57545504fc335151a6c6c386e8831614bc8345/src/client.coffee | 88 | 93 |
mauricemach/zappa:src/client.coffee:3:completion | completion | @build = (version, coffeescript_helpers, copy_data_to, settings) ->
String(skeleton)
.replace('version = null;', "version = '#{version}';") | .replace('coffeescript_helpers = null;', "var coffeescript_helpers = '#{coffeescript_helpers}';")
.replace('copy_data_to = null;', "var copy_data_to = #{copy_data_to};")
.replace('settings = null;', "var settings = #{JSON.stringify settings};") | CoffeeScript | CoffeeScript | mauricemach/zappa | src/client.coffee | MIT | ac57545504fc335151a6c6c386e8831614bc8345 | 943 | https://github.com/mauricemach/zappa/blob/ac57545504fc335151a6c6c386e8831614bc8345/src/client.coffee | 88 | 93 |
mauricemach/zappa:src/client.coffee:1:raw_corpus | raw_corpus | skeleton = ->
zappa = window.zappa = {}
zappa.version = null
coffeescript_helpers = null
copy_data_to = null
settings = null
zappa.run = (func) ->
context = {}
# Storage for the functions provided by the user.
ws_handlers = {}
helpers = {}
app = context.app = Sammy() if Sammy?
c... | CoffeeScript | mauricemach/zappa | src/client.coffee | MIT | 17f8fda98ec0287690257a833e655c1c597076ed | 943 | https://github.com/mauricemach/zappa/blob/17f8fda98ec0287690257a833e655c1c597076ed/src/client.coffee | 2 | 51 | ||
mauricemach/zappa:src/client.coffee:1:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
skeleton = ->
zappa = window.zappa = {}
zappa.version = null
coffeescript_helpers = null
copy_data_to = null
settings = null
zappa.run = (func) ->
context = {}
# Storage for the functions provided by the user.
ws_handlers = {}
helpe... | var skeleton;
skeleton = function() {
var coffeescript_helpers, copy_data_to, settings, zappa;
zappa = window.zappa = {};
zappa.version = null;
coffeescript_helpers = null;
copy_data_to = null;
settings = null;
return zappa.run = function(func) {
var app, context, helpers, route, ws_handlers;
con... | CoffeeScript | JavaScript | mauricemach/zappa | src/client.coffee | MIT | 17f8fda98ec0287690257a833e655c1c597076ed | 943 | https://github.com/mauricemach/zappa/blob/17f8fda98ec0287690257a833e655c1c597076ed/src/client.coffee | 2 | 51 |
mauricemach/zappa:src/client.coffee:1:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
var skeleton;
skeleton = function() {
var coffeescript_helpers, copy_data_to, settings, zappa;
zappa = window.zappa = {};
zappa.version = null;
coffeescript_helpers = null;
copy_data_to = null;
settings = null;
return zappa.run = function(func) {
... | skeleton = ->
zappa = window.zappa = {}
zappa.version = null
coffeescript_helpers = null
copy_data_to = null
settings = null
zappa.run = (func) ->
context = {}
# Storage for the functions provided by the user.
ws_handlers = {}
helpers = {}
app = context.app = Sammy() if Sammy?
c... | JavaScript | CoffeeScript | mauricemach/zappa | src/client.coffee | MIT | 17f8fda98ec0287690257a833e655c1c597076ed | 943 | https://github.com/mauricemach/zappa/blob/17f8fda98ec0287690257a833e655c1c597076ed/src/client.coffee | 2 | 51 |
mauricemach/zappa:src/client.coffee:1:completion | completion | skeleton = ->
zappa = window.zappa = {}
zappa.version = null
coffeescript_helpers = null
copy_data_to = null
settings = null
zappa.run = (func) ->
context = {}
# Storage for the functions provided by the user.
ws_handlers = {}
helpers = {}
app = context.app = Sammy() if Sammy?
c... | for k, v of obj
helpers[k] = v
context.on = (obj) ->
for k, v of obj
ws_handlers[k] = v
context.connect = ->
context.socket = io.connect.apply io, arguments
context.emit = ->
context.socket.emit.apply context.socket, arguments
route = (r) ->
ctx = {app}
... | CoffeeScript | CoffeeScript | mauricemach/zappa | src/client.coffee | MIT | 17f8fda98ec0287690257a833e655c1c597076ed | 943 | https://github.com/mauricemach/zappa/blob/17f8fda98ec0287690257a833e655c1c597076ed/src/client.coffee | 2 | 51 |
mauricemach/zappa:src/client.coffee:2:raw_corpus | raw_corpus | if settings['autoimport']
# Imports input vars to ctx. Does NOT overwrite existing variables.
copy_data_to ctx, [sammy_context.params]
r.handler.apply(ctx, [ctx])
# GO!!!
func.apply(context, [context])
# Implements the websockets client with socket.io.
if context.socket?
... | CoffeeScript | mauricemach/zappa | src/client.coffee | MIT | 17f8fda98ec0287690257a833e655c1c597076ed | 943 | https://github.com/mauricemach/zappa/blob/17f8fda98ec0287690257a833e655c1c597076ed/src/client.coffee | 52 | 82 | ||
mauricemach/zappa:src/client.coffee:2:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
if settings['autoimport']
# Imports input vars to ctx. Does NOT overwrite existing variables.
copy_data_to ctx, [sammy_context.params]
r.handler.apply(ctx, [ctx])
# GO!!!
func.apply(context, [context])
# Implements the we... | var h, name;
if (settings['autoimport']) {
// Imports input vars to ctx. Does NOT overwrite existing variables.
copy_data_to(ctx, [sammy_context.params]);
}
r.handler.apply(ctx, [ctx]);
// GO!!!
func.apply(context, [context]);
// Implements the websockets client with socket.io.
if (context.socket != null) {
f... | CoffeeScript | JavaScript | mauricemach/zappa | src/client.coffee | MIT | 17f8fda98ec0287690257a833e655c1c597076ed | 943 | https://github.com/mauricemach/zappa/blob/17f8fda98ec0287690257a833e655c1c597076ed/src/client.coffee | 52 | 82 |
mauricemach/zappa:src/client.coffee:2:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
var h, name;
if (settings['autoimport']) {
// Imports input vars to ctx. Does NOT overwrite existing variables.
copy_data_to(ctx, [sammy_context.params]);
}
r.handler.apply(ctx, [ctx]);
// GO!!!
func.apply(context, [context]);
// Implements the websockets c... | if settings['autoimport']
# Imports input vars to ctx. Does NOT overwrite existing variables.
copy_data_to ctx, [sammy_context.params]
r.handler.apply(ctx, [ctx])
# GO!!!
func.apply(context, [context])
# Implements the websockets client with socket.io.
if context.socket?
... | JavaScript | CoffeeScript | mauricemach/zappa | src/client.coffee | MIT | 17f8fda98ec0287690257a833e655c1c597076ed | 943 | https://github.com/mauricemach/zappa/blob/17f8fda98ec0287690257a833e655c1c597076ed/src/client.coffee | 52 | 82 |
mauricemach/zappa:src/client.coffee:2:completion | completion | if settings['autoimport']
# Imports input vars to ctx. Does NOT overwrite existing variables.
copy_data_to ctx, [sammy_context.params]
r.handler.apply(ctx, [ctx])
# GO!!!
func.apply(context, [context])
# Implements the websockets client with socket.io.
if context.socket?
... | socket: context.socket
id: context.socket.id
data: data
emit: -> context.socket.emit.apply context.socket, arguments
if settings['autoimport']
copy_data_to ctx, [data]
for name, helper of helpers
do (name, helper) ->
... | CoffeeScript | CoffeeScript | mauricemach/zappa | src/client.coffee | MIT | 17f8fda98ec0287690257a833e655c1c597076ed | 943 | https://github.com/mauricemach/zappa/blob/17f8fda98ec0287690257a833e655c1c597076ed/src/client.coffee | 52 | 82 |
mauricemach/zappa:src/client.coffee:1:raw_corpus | raw_corpus | skeleton = ->
zappa = window.zappa = {}
zappa.version = null
coffeescript_helpers = null
copy_data_to = null
zappa.run = (func) ->
context = {}
# Storage for the functions provided by the user.
ws_handlers = {}
helpers = {}
app = context.app = Sammy() if Sammy?
context.get = ->
... | CoffeeScript | mauricemach/zappa | src/client.coffee | MIT | 13361ea724375f6dd3e85118df6cd62145ef7ab0 | 943 | https://github.com/mauricemach/zappa/blob/13361ea724375f6dd3e85118df6cd62145ef7ab0/src/client.coffee | 2 | 51 | ||
mauricemach/zappa:src/client.coffee:1:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
skeleton = ->
zappa = window.zappa = {}
zappa.version = null
coffeescript_helpers = null
copy_data_to = null
zappa.run = (func) ->
context = {}
# Storage for the functions provided by the user.
ws_handlers = {}
helpers = {}
app =... | var skeleton;
skeleton = function() {
var coffeescript_helpers, copy_data_to, zappa;
zappa = window.zappa = {};
zappa.version = null;
coffeescript_helpers = null;
copy_data_to = null;
return zappa.run = function(func) {
var app, context, helpers, route, ws_handlers;
context = {};
// Storage for... | CoffeeScript | JavaScript | mauricemach/zappa | src/client.coffee | MIT | 13361ea724375f6dd3e85118df6cd62145ef7ab0 | 943 | https://github.com/mauricemach/zappa/blob/13361ea724375f6dd3e85118df6cd62145ef7ab0/src/client.coffee | 2 | 51 |
mauricemach/zappa:src/client.coffee:1:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
var skeleton;
skeleton = function() {
var coffeescript_helpers, copy_data_to, zappa;
zappa = window.zappa = {};
zappa.version = null;
coffeescript_helpers = null;
copy_data_to = null;
return zappa.run = function(func) {
var app, context, helpers, r... | skeleton = ->
zappa = window.zappa = {}
zappa.version = null
coffeescript_helpers = null
copy_data_to = null
zappa.run = (func) ->
context = {}
# Storage for the functions provided by the user.
ws_handlers = {}
helpers = {}
app = context.app = Sammy() if Sammy?
context.get = ->
... | JavaScript | CoffeeScript | mauricemach/zappa | src/client.coffee | MIT | 13361ea724375f6dd3e85118df6cd62145ef7ab0 | 943 | https://github.com/mauricemach/zappa/blob/13361ea724375f6dd3e85118df6cd62145ef7ab0/src/client.coffee | 2 | 51 |
mauricemach/zappa:src/client.coffee:1:completion | completion | skeleton = ->
zappa = window.zappa = {}
zappa.version = null
coffeescript_helpers = null
copy_data_to = null
zappa.run = (func) ->
context = {}
# Storage for the functions provided by the user.
ws_handlers = {}
helpers = {}
app = context.app = Sammy() if Sammy?
context.get = ->
... | helpers[k] = v
context.on = (obj) ->
for k, v of obj
ws_handlers[k] = v
context.connect = ->
context.socket = io.connect.apply io, arguments
context.emit = ->
context.socket.emit.apply context.socket, arguments
route = (r) ->
ctx = {app}
for name, helper of hel... | CoffeeScript | CoffeeScript | mauricemach/zappa | src/client.coffee | MIT | 13361ea724375f6dd3e85118df6cd62145ef7ab0 | 943 | https://github.com/mauricemach/zappa/blob/13361ea724375f6dd3e85118df6cd62145ef7ab0/src/client.coffee | 2 | 51 |
mauricemach/zappa:src/client.coffee:2:raw_corpus | raw_corpus | # GO!!!
func.apply(context, [context])
# Implements the websockets client with socket.io.
if context.socket?
for name, h of ws_handlers
do (name, h) ->
context.socket.on name, (data) ->
ctx =
app: app
socket: context.socket
id: c... | CoffeeScript | mauricemach/zappa | src/client.coffee | MIT | 13361ea724375f6dd3e85118df6cd62145ef7ab0 | 943 | https://github.com/mauricemach/zappa/blob/13361ea724375f6dd3e85118df6cd62145ef7ab0/src/client.coffee | 52 | 76 | ||
mauricemach/zappa:src/client.coffee:2:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
# GO!!!
func.apply(context, [context])
# Implements the websockets client with socket.io.
if context.socket?
for name, h of ws_handlers
do (name, h) ->
context.socket.on name, (data) ->
ctx =
app: app... | // GO!!!
var h, name;
func.apply(context, [context]);
// Implements the websockets client with socket.io.
if (context.socket != null) {
for (name in ws_handlers) {
h = ws_handlers[name];
(function(name, h) {
return context.socket.on(name, function(data) {
var ctx, helper;
ctx = {
... | CoffeeScript | JavaScript | mauricemach/zappa | src/client.coffee | MIT | 13361ea724375f6dd3e85118df6cd62145ef7ab0 | 943 | https://github.com/mauricemach/zappa/blob/13361ea724375f6dd3e85118df6cd62145ef7ab0/src/client.coffee | 52 | 76 |
mauricemach/zappa:src/client.coffee:2:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
// GO!!!
var h, name;
func.apply(context, [context]);
// Implements the websockets client with socket.io.
if (context.socket != null) {
for (name in ws_handlers) {
h = ws_handlers[name];
(function(name, h) {
return context.socket.on(name, function... | # GO!!!
func.apply(context, [context])
# Implements the websockets client with socket.io.
if context.socket?
for name, h of ws_handlers
do (name, h) ->
context.socket.on name, (data) ->
ctx =
app: app
socket: context.socket
id: c... | JavaScript | CoffeeScript | mauricemach/zappa | src/client.coffee | MIT | 13361ea724375f6dd3e85118df6cd62145ef7ab0 | 943 | https://github.com/mauricemach/zappa/blob/13361ea724375f6dd3e85118df6cd62145ef7ab0/src/client.coffee | 52 | 76 |
mauricemach/zappa:src/client.coffee:2:completion | completion | # GO!!!
func.apply(context, [context])
# Implements the websockets client with socket.io.
if context.socket?
for name, h of ws_handlers
do (name, h) ->
context.socket.on name, (data) ->
ctx =
app: app
socket: context.socket
id: c... | emit: -> context.socket.emit.apply context.socket, arguments
copy_data_to ctx, [data]
for name, helper of helpers
do (name, helper) ->
ctx[name] = ->
helper.apply(ctx, arguments)
h.apply(ctx, [ctx])
$(-> app.run '#/') if app? | CoffeeScript | CoffeeScript | mauricemach/zappa | src/client.coffee | MIT | 13361ea724375f6dd3e85118df6cd62145ef7ab0 | 943 | https://github.com/mauricemach/zappa/blob/13361ea724375f6dd3e85118df6cd62145ef7ab0/src/client.coffee | 52 | 76 |
mauricemach/zappa:src/client.coffee:3:raw_corpus | raw_corpus | @build = (version, coffeescript_helpers, copy_data_to) ->
String(skeleton)
.replace('version = null;', "version = '#{version}';")
.replace('coffeescript_helpers = null;', "var coffeescript_helpers = '#{coffeescript_helpers}';")
.replace('copy_data_to = null;', "var copy_data_to = #{copy_data_to};")
.r... | CoffeeScript | mauricemach/zappa | src/client.coffee | MIT | 13361ea724375f6dd3e85118df6cd62145ef7ab0 | 943 | https://github.com/mauricemach/zappa/blob/13361ea724375f6dd3e85118df6cd62145ef7ab0/src/client.coffee | 78 | 83 | ||
mauricemach/zappa:src/client.coffee:3:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
@build = (version, coffeescript_helpers, copy_data_to) ->
String(skeleton)
.replace('version = null;', "version = '#{version}';")
.replace('coffeescript_helpers = null;', "var coffeescript_helpers = '#{coffeescript_helpers}';")
.replace('copy_data_t... | this.build = function(version, coffeescript_helpers, copy_data_to) {
return String(skeleton).replace('version = null;', `version = '${version}';`).replace('coffeescript_helpers = null;', `var coffeescript_helpers = '${coffeescript_helpers}';`).replace('copy_data_to = null;', `var copy_data_to = ${copy_data_to};`).rep... | CoffeeScript | JavaScript | mauricemach/zappa | src/client.coffee | MIT | 13361ea724375f6dd3e85118df6cd62145ef7ab0 | 943 | https://github.com/mauricemach/zappa/blob/13361ea724375f6dd3e85118df6cd62145ef7ab0/src/client.coffee | 78 | 83 |
mauricemach/zappa:src/client.coffee:3:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
this.build = function(version, coffeescript_helpers, copy_data_to) {
return String(skeleton).replace('version = null;', `version = '${version}';`).replace('coffeescript_helpers = null;', `var coffeescript_helpers = '${coffeescript_helpers}';`).replace('copy_data_... | @build = (version, coffeescript_helpers, copy_data_to) ->
String(skeleton)
.replace('version = null;', "version = '#{version}';")
.replace('coffeescript_helpers = null;', "var coffeescript_helpers = '#{coffeescript_helpers}';")
.replace('copy_data_to = null;', "var copy_data_to = #{copy_data_to};")
.r... | JavaScript | CoffeeScript | mauricemach/zappa | src/client.coffee | MIT | 13361ea724375f6dd3e85118df6cd62145ef7ab0 | 943 | https://github.com/mauricemach/zappa/blob/13361ea724375f6dd3e85118df6cd62145ef7ab0/src/client.coffee | 78 | 83 |
mauricemach/zappa:src/client.coffee:3:completion | completion | @build = (version, coffeescript_helpers, copy_data_to) ->
String(skeleton)
.replace('version = null;', "version = '#{version}';") | .replace('coffeescript_helpers = null;', "var coffeescript_helpers = '#{coffeescript_helpers}';")
.replace('copy_data_to = null;', "var copy_data_to = #{copy_data_to};")
.replace /(\n)/g, '' | CoffeeScript | CoffeeScript | mauricemach/zappa | src/client.coffee | MIT | 13361ea724375f6dd3e85118df6cd62145ef7ab0 | 943 | https://github.com/mauricemach/zappa/blob/13361ea724375f6dd3e85118df6cd62145ef7ab0/src/client.coffee | 78 | 83 |
mauricemach/zappa:src/client.coffee:1:raw_corpus | raw_corpus | skeleton = ->
zappa = window.zappa = {}
zappa.version = null
coffeescript_helpers = null
import_data = null
zappa.run = (func) ->
context = {}
# Storage for the functions provided by the user.
ws_handlers = {}
helpers = {}
app = context.app = Sammy() if Sammy?
context.get = ->
... | CoffeeScript | mauricemach/zappa | src/client.coffee | MIT | 3c42733c9caafce5f2aa094001b5b82ccf4085cf | 943 | https://github.com/mauricemach/zappa/blob/3c42733c9caafce5f2aa094001b5b82ccf4085cf/src/client.coffee | 2 | 51 | ||
mauricemach/zappa:src/client.coffee:1:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
skeleton = ->
zappa = window.zappa = {}
zappa.version = null
coffeescript_helpers = null
import_data = null
zappa.run = (func) ->
context = {}
# Storage for the functions provided by the user.
ws_handlers = {}
helpers = {}
app = ... | var skeleton;
skeleton = function() {
var coffeescript_helpers, import_data, zappa;
zappa = window.zappa = {};
zappa.version = null;
coffeescript_helpers = null;
import_data = null;
return zappa.run = function(func) {
var app, context, helpers, route, ws_handlers;
context = {};
// Storage for t... | CoffeeScript | JavaScript | mauricemach/zappa | src/client.coffee | MIT | 3c42733c9caafce5f2aa094001b5b82ccf4085cf | 943 | https://github.com/mauricemach/zappa/blob/3c42733c9caafce5f2aa094001b5b82ccf4085cf/src/client.coffee | 2 | 51 |
mauricemach/zappa:src/client.coffee:1:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
var skeleton;
skeleton = function() {
var coffeescript_helpers, import_data, zappa;
zappa = window.zappa = {};
zappa.version = null;
coffeescript_helpers = null;
import_data = null;
return zappa.run = function(func) {
var app, context, helpers, rou... | skeleton = ->
zappa = window.zappa = {}
zappa.version = null
coffeescript_helpers = null
import_data = null
zappa.run = (func) ->
context = {}
# Storage for the functions provided by the user.
ws_handlers = {}
helpers = {}
app = context.app = Sammy() if Sammy?
context.get = ->
... | JavaScript | CoffeeScript | mauricemach/zappa | src/client.coffee | MIT | 3c42733c9caafce5f2aa094001b5b82ccf4085cf | 943 | https://github.com/mauricemach/zappa/blob/3c42733c9caafce5f2aa094001b5b82ccf4085cf/src/client.coffee | 2 | 51 |
mauricemach/zappa:src/client.coffee:1:completion | completion | skeleton = ->
zappa = window.zappa = {}
zappa.version = null
coffeescript_helpers = null
import_data = null
zappa.run = (func) ->
context = {}
# Storage for the functions provided by the user.
ws_handlers = {}
helpers = {}
app = context.app = Sammy() if Sammy?
context.get = ->
... | helpers[k] = v
context.on = (obj) ->
for k, v of obj
ws_handlers[k] = v
context.connect = ->
context.socket = io.connect.apply io, arguments
context.emit = ->
context.socket.emit.apply context.socket, arguments
route = (r) ->
ctx = {app}
for name, helper of hel... | CoffeeScript | CoffeeScript | mauricemach/zappa | src/client.coffee | MIT | 3c42733c9caafce5f2aa094001b5b82ccf4085cf | 943 | https://github.com/mauricemach/zappa/blob/3c42733c9caafce5f2aa094001b5b82ccf4085cf/src/client.coffee | 2 | 51 |
mauricemach/zappa:src/client.coffee:2:raw_corpus | raw_corpus | # GO!!!
func.apply(context, [context])
# Implements the websockets client with socket.io.
if context.socket?
for name, h of ws_handlers
do (name, h) ->
context.socket.on name, (data) ->
ctx =
app: app
socket: context.socket
id: c... | CoffeeScript | mauricemach/zappa | src/client.coffee | MIT | 3c42733c9caafce5f2aa094001b5b82ccf4085cf | 943 | https://github.com/mauricemach/zappa/blob/3c42733c9caafce5f2aa094001b5b82ccf4085cf/src/client.coffee | 52 | 76 | ||
mauricemach/zappa:src/client.coffee:2:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
# GO!!!
func.apply(context, [context])
# Implements the websockets client with socket.io.
if context.socket?
for name, h of ws_handlers
do (name, h) ->
context.socket.on name, (data) ->
ctx =
app: app... | // GO!!!
var h, name;
func.apply(context, [context]);
// Implements the websockets client with socket.io.
if (context.socket != null) {
for (name in ws_handlers) {
h = ws_handlers[name];
(function(name, h) {
return context.socket.on(name, function(data) {
var ctx, helper;
ctx = {
... | CoffeeScript | JavaScript | mauricemach/zappa | src/client.coffee | MIT | 3c42733c9caafce5f2aa094001b5b82ccf4085cf | 943 | https://github.com/mauricemach/zappa/blob/3c42733c9caafce5f2aa094001b5b82ccf4085cf/src/client.coffee | 52 | 76 |
mauricemach/zappa:src/client.coffee:2:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
// GO!!!
var h, name;
func.apply(context, [context]);
// Implements the websockets client with socket.io.
if (context.socket != null) {
for (name in ws_handlers) {
h = ws_handlers[name];
(function(name, h) {
return context.socket.on(name, function... | # GO!!!
func.apply(context, [context])
# Implements the websockets client with socket.io.
if context.socket?
for name, h of ws_handlers
do (name, h) ->
context.socket.on name, (data) ->
ctx =
app: app
socket: context.socket
id: c... | JavaScript | CoffeeScript | mauricemach/zappa | src/client.coffee | MIT | 3c42733c9caafce5f2aa094001b5b82ccf4085cf | 943 | https://github.com/mauricemach/zappa/blob/3c42733c9caafce5f2aa094001b5b82ccf4085cf/src/client.coffee | 52 | 76 |
mauricemach/zappa:src/client.coffee:2:completion | completion | # GO!!!
func.apply(context, [context])
# Implements the websockets client with socket.io.
if context.socket?
for name, h of ws_handlers
do (name, h) ->
context.socket.on name, (data) ->
ctx =
app: app
socket: context.socket
id: c... | emit: -> context.socket.emit.apply context.socket, arguments
import_data ctx, [data]
for name, helper of helpers
do (name, helper) ->
ctx[name] = ->
helper.apply(ctx, arguments)
h.apply(ctx, [ctx])
$(-> app.run '#/') if app? | CoffeeScript | CoffeeScript | mauricemach/zappa | src/client.coffee | MIT | 3c42733c9caafce5f2aa094001b5b82ccf4085cf | 943 | https://github.com/mauricemach/zappa/blob/3c42733c9caafce5f2aa094001b5b82ccf4085cf/src/client.coffee | 52 | 76 |
mauricemach/zappa:src/client.coffee:3:raw_corpus | raw_corpus | @build = (version, coffeescript_helpers, import_data) ->
String(skeleton)
.replace('version = null;', "version = '#{version}';")
.replace('coffeescript_helpers = null;', "var coffeescript_helpers = '#{coffeescript_helpers}';")
.replace('import_data = null;', "var import_data = #{import_data};")
.repla... | CoffeeScript | mauricemach/zappa | src/client.coffee | MIT | 3c42733c9caafce5f2aa094001b5b82ccf4085cf | 943 | https://github.com/mauricemach/zappa/blob/3c42733c9caafce5f2aa094001b5b82ccf4085cf/src/client.coffee | 78 | 83 | ||
mauricemach/zappa:src/client.coffee:3:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
@build = (version, coffeescript_helpers, import_data) ->
String(skeleton)
.replace('version = null;', "version = '#{version}';")
.replace('coffeescript_helpers = null;', "var coffeescript_helpers = '#{coffeescript_helpers}';")
.replace('import_data ... | this.build = function(version, coffeescript_helpers, import_data) {
return String(skeleton).replace('version = null;', `version = '${version}';`).replace('coffeescript_helpers = null;', `var coffeescript_helpers = '${coffeescript_helpers}';`).replace('import_data = null;', `var import_data = ${import_data};`).replace... | CoffeeScript | JavaScript | mauricemach/zappa | src/client.coffee | MIT | 3c42733c9caafce5f2aa094001b5b82ccf4085cf | 943 | https://github.com/mauricemach/zappa/blob/3c42733c9caafce5f2aa094001b5b82ccf4085cf/src/client.coffee | 78 | 83 |
mauricemach/zappa:src/client.coffee:3:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
this.build = function(version, coffeescript_helpers, import_data) {
return String(skeleton).replace('version = null;', `version = '${version}';`).replace('coffeescript_helpers = null;', `var coffeescript_helpers = '${coffeescript_helpers}';`).replace('import_data... | @build = (version, coffeescript_helpers, import_data) ->
String(skeleton)
.replace('version = null;', "version = '#{version}';")
.replace('coffeescript_helpers = null;', "var coffeescript_helpers = '#{coffeescript_helpers}';")
.replace('import_data = null;', "var import_data = #{import_data};")
.repla... | JavaScript | CoffeeScript | mauricemach/zappa | src/client.coffee | MIT | 3c42733c9caafce5f2aa094001b5b82ccf4085cf | 943 | https://github.com/mauricemach/zappa/blob/3c42733c9caafce5f2aa094001b5b82ccf4085cf/src/client.coffee | 78 | 83 |
mauricemach/zappa:src/client.coffee:3:completion | completion | @build = (version, coffeescript_helpers, import_data) ->
String(skeleton)
.replace('version = null;', "version = '#{version}';") | .replace('coffeescript_helpers = null;', "var coffeescript_helpers = '#{coffeescript_helpers}';")
.replace('import_data = null;', "var import_data = #{import_data};")
.replace /(\n)/g, '' | CoffeeScript | CoffeeScript | mauricemach/zappa | src/client.coffee | MIT | 3c42733c9caafce5f2aa094001b5b82ccf4085cf | 943 | https://github.com/mauricemach/zappa/blob/3c42733c9caafce5f2aa094001b5b82ccf4085cf/src/client.coffee | 78 | 83 |
mauricemach/zappa:src/client.coffee:1:raw_corpus | raw_corpus | skeleton = ->
zappa = window.zappa = {}
zappa.version = null
coffeescript_helpers = null
zappa.run = (func) ->
context = {}
# Storage for the functions provided by the user.
ws_handlers = {}
helpers = {}
app = context.app = Sammy() if Sammy?
context.get = ->
if typeof argument... | CoffeeScript | mauricemach/zappa | src/client.coffee | MIT | e4ee8ce9d1f4f1e75ba2c130bf4f801a3bdfbb91 | 943 | https://github.com/mauricemach/zappa/blob/e4ee8ce9d1f4f1e75ba2c130bf4f801a3bdfbb91/src/client.coffee | 2 | 51 | ||
mauricemach/zappa:src/client.coffee:1:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
skeleton = ->
zappa = window.zappa = {}
zappa.version = null
coffeescript_helpers = null
zappa.run = (func) ->
context = {}
# Storage for the functions provided by the user.
ws_handlers = {}
helpers = {}
app = context.app = Sammy()... | var skeleton;
skeleton = function() {
var coffeescript_helpers, zappa;
zappa = window.zappa = {};
zappa.version = null;
coffeescript_helpers = null;
return zappa.run = function(func) {
var app, context, helpers, route, ws_handlers;
context = {};
// Storage for the functions provided by the user.
... | CoffeeScript | JavaScript | mauricemach/zappa | src/client.coffee | MIT | e4ee8ce9d1f4f1e75ba2c130bf4f801a3bdfbb91 | 943 | https://github.com/mauricemach/zappa/blob/e4ee8ce9d1f4f1e75ba2c130bf4f801a3bdfbb91/src/client.coffee | 2 | 51 |
mauricemach/zappa:src/client.coffee:1:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
var skeleton;
skeleton = function() {
var coffeescript_helpers, zappa;
zappa = window.zappa = {};
zappa.version = null;
coffeescript_helpers = null;
return zappa.run = function(func) {
var app, context, helpers, route, ws_handlers;
context = {};
... | skeleton = ->
zappa = window.zappa = {}
zappa.version = null
coffeescript_helpers = null
zappa.run = (func) ->
context = {}
# Storage for the functions provided by the user.
ws_handlers = {}
helpers = {}
app = context.app = Sammy() if Sammy?
context.get = ->
if typeof argument... | JavaScript | CoffeeScript | mauricemach/zappa | src/client.coffee | MIT | e4ee8ce9d1f4f1e75ba2c130bf4f801a3bdfbb91 | 943 | https://github.com/mauricemach/zappa/blob/e4ee8ce9d1f4f1e75ba2c130bf4f801a3bdfbb91/src/client.coffee | 2 | 51 |
mauricemach/zappa:src/client.coffee:1:completion | completion | skeleton = ->
zappa = window.zappa = {}
zappa.version = null
coffeescript_helpers = null
zappa.run = (func) ->
context = {}
# Storage for the functions provided by the user.
ws_handlers = {}
helpers = {}
app = context.app = Sammy() if Sammy?
context.get = ->
if typeof argument... | context.on = (obj) ->
for k, v of obj
ws_handlers[k] = v
context.connect = ->
context.socket = io.connect.apply io, arguments
context.emit = ->
context.socket.emit.apply context.socket, arguments
route = (r) ->
ctx = {app}
for name, helper of helpers
ctx[nam... | CoffeeScript | CoffeeScript | mauricemach/zappa | src/client.coffee | MIT | e4ee8ce9d1f4f1e75ba2c130bf4f801a3bdfbb91 | 943 | https://github.com/mauricemach/zappa/blob/e4ee8ce9d1f4f1e75ba2c130bf4f801a3bdfbb91/src/client.coffee | 2 | 51 |
mauricemach/zappa:src/client.coffee:2:raw_corpus | raw_corpus | # GO!!!
func.apply(context, [context])
# Implements the websockets client with socket.io.
if context.socket?
for name, h of ws_handlers
do (name, h) ->
context.socket.on name, (data) ->
ctx =
app: app
socket: context.socket
id: c... | CoffeeScript | mauricemach/zappa | src/client.coffee | MIT | e4ee8ce9d1f4f1e75ba2c130bf4f801a3bdfbb91 | 943 | https://github.com/mauricemach/zappa/blob/e4ee8ce9d1f4f1e75ba2c130bf4f801a3bdfbb91/src/client.coffee | 52 | 75 | ||
mauricemach/zappa:src/client.coffee:2:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
# GO!!!
func.apply(context, [context])
# Implements the websockets client with socket.io.
if context.socket?
for name, h of ws_handlers
do (name, h) ->
context.socket.on name, (data) ->
ctx =
app: app... | // GO!!!
var h, name;
func.apply(context, [context]);
// Implements the websockets client with socket.io.
if (context.socket != null) {
for (name in ws_handlers) {
h = ws_handlers[name];
(function(name, h) {
return context.socket.on(name, function(data) {
var ctx, helper;
ctx = {
... | CoffeeScript | JavaScript | mauricemach/zappa | src/client.coffee | MIT | e4ee8ce9d1f4f1e75ba2c130bf4f801a3bdfbb91 | 943 | https://github.com/mauricemach/zappa/blob/e4ee8ce9d1f4f1e75ba2c130bf4f801a3bdfbb91/src/client.coffee | 52 | 75 |
mauricemach/zappa:src/client.coffee:2:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
// GO!!!
var h, name;
func.apply(context, [context]);
// Implements the websockets client with socket.io.
if (context.socket != null) {
for (name in ws_handlers) {
h = ws_handlers[name];
(function(name, h) {
return context.socket.on(name, function... | # GO!!!
func.apply(context, [context])
# Implements the websockets client with socket.io.
if context.socket?
for name, h of ws_handlers
do (name, h) ->
context.socket.on name, (data) ->
ctx =
app: app
socket: context.socket
id: c... | JavaScript | CoffeeScript | mauricemach/zappa | src/client.coffee | MIT | e4ee8ce9d1f4f1e75ba2c130bf4f801a3bdfbb91 | 943 | https://github.com/mauricemach/zappa/blob/e4ee8ce9d1f4f1e75ba2c130bf4f801a3bdfbb91/src/client.coffee | 52 | 75 |
mauricemach/zappa:src/client.coffee:2:completion | completion | # GO!!!
func.apply(context, [context])
# Implements the websockets client with socket.io.
if context.socket?
for name, h of ws_handlers
do (name, h) ->
context.socket.on name, (data) ->
ctx =
app: app
socket: context.socket | id: context.socket.id
emit: -> context.socket.emit.apply context.socket, arguments
data: data
for name, helper of helpers
do (name, helper) ->
ctx[name] = ->
helper.apply(ctx, arguments)
h.apply(ctx, [ctx])
$(-> a... | CoffeeScript | CoffeeScript | mauricemach/zappa | src/client.coffee | MIT | e4ee8ce9d1f4f1e75ba2c130bf4f801a3bdfbb91 | 943 | https://github.com/mauricemach/zappa/blob/e4ee8ce9d1f4f1e75ba2c130bf4f801a3bdfbb91/src/client.coffee | 52 | 75 |
mauricemach/zappa:src/client.coffee:3:raw_corpus | raw_corpus | @build = (version, coffeescript_helpers) ->
String(skeleton)
.replace('version = null;', "version = '#{version}';")
.replace('coffeescript_helpers = null;', "var coffeescript_helpers = '#{coffeescript_helpers}';")
.replace /(\n)/g, '' | CoffeeScript | mauricemach/zappa | src/client.coffee | MIT | e4ee8ce9d1f4f1e75ba2c130bf4f801a3bdfbb91 | 943 | https://github.com/mauricemach/zappa/blob/e4ee8ce9d1f4f1e75ba2c130bf4f801a3bdfbb91/src/client.coffee | 77 | 81 | ||
mauricemach/zappa:src/client.coffee:3:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
@build = (version, coffeescript_helpers) ->
String(skeleton)
.replace('version = null;', "version = '#{version}';")
.replace('coffeescript_helpers = null;', "var coffeescript_helpers = '#{coffeescript_helpers}';")
.replace /(\n)/g, ''
``` | this.build = function(version, coffeescript_helpers) {
return String(skeleton).replace('version = null;', `version = '${version}';`).replace('coffeescript_helpers = null;', `var coffeescript_helpers = '${coffeescript_helpers}';`).replace(/(\n)/g, '');
}; | CoffeeScript | JavaScript | mauricemach/zappa | src/client.coffee | MIT | e4ee8ce9d1f4f1e75ba2c130bf4f801a3bdfbb91 | 943 | https://github.com/mauricemach/zappa/blob/e4ee8ce9d1f4f1e75ba2c130bf4f801a3bdfbb91/src/client.coffee | 77 | 81 |
mauricemach/zappa:src/client.coffee:3:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
this.build = function(version, coffeescript_helpers) {
return String(skeleton).replace('version = null;', `version = '${version}';`).replace('coffeescript_helpers = null;', `var coffeescript_helpers = '${coffeescript_helpers}';`).replace(/(\n)/g, '');
};
``` | @build = (version, coffeescript_helpers) ->
String(skeleton)
.replace('version = null;', "version = '#{version}';")
.replace('coffeescript_helpers = null;', "var coffeescript_helpers = '#{coffeescript_helpers}';")
.replace /(\n)/g, '' | JavaScript | CoffeeScript | mauricemach/zappa | src/client.coffee | MIT | e4ee8ce9d1f4f1e75ba2c130bf4f801a3bdfbb91 | 943 | https://github.com/mauricemach/zappa/blob/e4ee8ce9d1f4f1e75ba2c130bf4f801a3bdfbb91/src/client.coffee | 77 | 81 |
mauricemach/zappa:src/client.coffee:3:completion | completion | @build = (version, coffeescript_helpers) ->
String(skeleton) | .replace('version = null;', "version = '#{version}';")
.replace('coffeescript_helpers = null;', "var coffeescript_helpers = '#{coffeescript_helpers}';")
.replace /(\n)/g, '' | CoffeeScript | CoffeeScript | mauricemach/zappa | src/client.coffee | MIT | e4ee8ce9d1f4f1e75ba2c130bf4f801a3bdfbb91 | 943 | https://github.com/mauricemach/zappa/blob/e4ee8ce9d1f4f1e75ba2c130bf4f801a3bdfbb91/src/client.coffee | 77 | 81 |
mauricemach/zappa:src/client.coffee:1:raw_corpus | raw_corpus | skeleton = ->
zappa = window.zappa = {}
zappa.version = null
coffeescript_helpers = null
zappa.run = (func) ->
context = {}
# Storage for the functions provided by the user.
ws_handlers = {}
helpers = {}
app = context.app = Sammy() if Sammy?
context.get = ->
if typeof argument... | CoffeeScript | mauricemach/zappa | src/client.coffee | MIT | dc7ec7e98268a36271f13ece5064e2f0f4508b9c | 943 | https://github.com/mauricemach/zappa/blob/dc7ec7e98268a36271f13ece5064e2f0f4508b9c/src/client.coffee | 2 | 51 | ||
mauricemach/zappa:src/client.coffee:1:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
skeleton = ->
zappa = window.zappa = {}
zappa.version = null
coffeescript_helpers = null
zappa.run = (func) ->
context = {}
# Storage for the functions provided by the user.
ws_handlers = {}
helpers = {}
app = context.app = Sammy()... | var skeleton;
skeleton = function() {
var coffeescript_helpers, zappa;
zappa = window.zappa = {};
zappa.version = null;
coffeescript_helpers = null;
return zappa.run = function(func) {
var app, context, helpers, route, ws_handlers;
context = {};
// Storage for the functions provided by the user.
... | CoffeeScript | JavaScript | mauricemach/zappa | src/client.coffee | MIT | dc7ec7e98268a36271f13ece5064e2f0f4508b9c | 943 | https://github.com/mauricemach/zappa/blob/dc7ec7e98268a36271f13ece5064e2f0f4508b9c/src/client.coffee | 2 | 51 |
mauricemach/zappa:src/client.coffee:1:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
var skeleton;
skeleton = function() {
var coffeescript_helpers, zappa;
zappa = window.zappa = {};
zappa.version = null;
coffeescript_helpers = null;
return zappa.run = function(func) {
var app, context, helpers, route, ws_handlers;
context = {};
... | skeleton = ->
zappa = window.zappa = {}
zappa.version = null
coffeescript_helpers = null
zappa.run = (func) ->
context = {}
# Storage for the functions provided by the user.
ws_handlers = {}
helpers = {}
app = context.app = Sammy() if Sammy?
context.get = ->
if typeof argument... | JavaScript | CoffeeScript | mauricemach/zappa | src/client.coffee | MIT | dc7ec7e98268a36271f13ece5064e2f0f4508b9c | 943 | https://github.com/mauricemach/zappa/blob/dc7ec7e98268a36271f13ece5064e2f0f4508b9c/src/client.coffee | 2 | 51 |
mauricemach/zappa:src/client.coffee:1:completion | completion | skeleton = ->
zappa = window.zappa = {}
zappa.version = null
coffeescript_helpers = null
zappa.run = (func) ->
context = {}
# Storage for the functions provided by the user.
ws_handlers = {}
helpers = {}
app = context.app = Sammy() if Sammy?
context.get = ->
if typeof argument... | context.on = (obj) ->
for k, v of obj
ws_handlers[k] = v
context.connect = ->
context.socket = io.connect.apply io, arguments
context.emit = ->
context.socket.emit.apply context.socket, arguments
# GO!!!
func.apply(context, [context])
# Implements the application accord... | CoffeeScript | CoffeeScript | mauricemach/zappa | src/client.coffee | MIT | dc7ec7e98268a36271f13ece5064e2f0f4508b9c | 943 | https://github.com/mauricemach/zappa/blob/dc7ec7e98268a36271f13ece5064e2f0f4508b9c/src/client.coffee | 2 | 51 |
mauricemach/zappa:src/client.coffee:2:raw_corpus | raw_corpus | ctx.data[k] = v for k, v of sammy_context.params
ctx.sammy_context = sammy_context
ctx.render = -> sammy_context.render.apply sammy_context, arguments
ctx.redirect = -> sammy_context.redirect.apply sammy_context, arguments
r.handler.apply(ctx, [ctx])
# Implements the websockets clie... | CoffeeScript | mauricemach/zappa | src/client.coffee | MIT | dc7ec7e98268a36271f13ece5064e2f0f4508b9c | 943 | https://github.com/mauricemach/zappa/blob/dc7ec7e98268a36271f13ece5064e2f0f4508b9c/src/client.coffee | 52 | 77 | ||
mauricemach/zappa:src/client.coffee:2:completion | completion | ctx.data[k] = v for k, v of sammy_context.params
ctx.sammy_context = sammy_context
ctx.render = -> sammy_context.render.apply sammy_context, arguments
ctx.redirect = -> sammy_context.redirect.apply sammy_context, arguments
r.handler.apply(ctx, [ctx])
# Implements the websockets clie... | socket: context.socket
id: context.socket.id
emit: -> context.socket.emit.apply context.socket, arguments
data: data
for name, helper of helpers
do (name, helper) ->
ctx[name] = ->
helper.apply(ctx, arguments)
... | CoffeeScript | CoffeeScript | mauricemach/zappa | src/client.coffee | MIT | dc7ec7e98268a36271f13ece5064e2f0f4508b9c | 943 | https://github.com/mauricemach/zappa/blob/dc7ec7e98268a36271f13ece5064e2f0f4508b9c/src/client.coffee | 52 | 77 |
mauricemach/zappa:src/client.coffee:3:raw_corpus | raw_corpus | @build = (version, coffeescript_helpers, rewrite_function) ->
String(skeleton)
.replace('version = null;', "version = '#{version}';")
.replace('coffeescript_helpers = null;', "var coffeescript_helpers = '#{coffeescript_helpers}';")
.replace /(\n)/g, '' | CoffeeScript | mauricemach/zappa | src/client.coffee | MIT | afd8604948ab1c1a9e6ecd632ba9702cf8314a58 | 943 | https://github.com/mauricemach/zappa/blob/afd8604948ab1c1a9e6ecd632ba9702cf8314a58/src/client.coffee | 79 | 83 | ||
mauricemach/zappa:src/client.coffee:3:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
@build = (version, coffeescript_helpers, rewrite_function) ->
String(skeleton)
.replace('version = null;', "version = '#{version}';")
.replace('coffeescript_helpers = null;', "var coffeescript_helpers = '#{coffeescript_helpers}';")
.replace /(\n)/g,... | this.build = function(version, coffeescript_helpers, rewrite_function) {
return String(skeleton).replace('version = null;', `version = '${version}';`).replace('coffeescript_helpers = null;', `var coffeescript_helpers = '${coffeescript_helpers}';`).replace(/(\n)/g, '');
}; | CoffeeScript | JavaScript | mauricemach/zappa | src/client.coffee | MIT | afd8604948ab1c1a9e6ecd632ba9702cf8314a58 | 943 | https://github.com/mauricemach/zappa/blob/afd8604948ab1c1a9e6ecd632ba9702cf8314a58/src/client.coffee | 79 | 83 |
mauricemach/zappa:src/client.coffee:3:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
this.build = function(version, coffeescript_helpers, rewrite_function) {
return String(skeleton).replace('version = null;', `version = '${version}';`).replace('coffeescript_helpers = null;', `var coffeescript_helpers = '${coffeescript_helpers}';`).replace(/(\n)/g... | @build = (version, coffeescript_helpers, rewrite_function) ->
String(skeleton)
.replace('version = null;', "version = '#{version}';")
.replace('coffeescript_helpers = null;', "var coffeescript_helpers = '#{coffeescript_helpers}';")
.replace /(\n)/g, '' | JavaScript | CoffeeScript | mauricemach/zappa | src/client.coffee | MIT | afd8604948ab1c1a9e6ecd632ba9702cf8314a58 | 943 | https://github.com/mauricemach/zappa/blob/afd8604948ab1c1a9e6ecd632ba9702cf8314a58/src/client.coffee | 79 | 83 |
mauricemach/zappa:src/client.coffee:3:completion | completion | @build = (version, coffeescript_helpers, rewrite_function) ->
String(skeleton) | .replace('version = null;', "version = '#{version}';")
.replace('coffeescript_helpers = null;', "var coffeescript_helpers = '#{coffeescript_helpers}';")
.replace /(\n)/g, '' | CoffeeScript | CoffeeScript | mauricemach/zappa | src/client.coffee | MIT | afd8604948ab1c1a9e6ecd632ba9702cf8314a58 | 943 | https://github.com/mauricemach/zappa/blob/afd8604948ab1c1a9e6ecd632ba9702cf8314a58/src/client.coffee | 79 | 83 |
mauricemach/zappa:src/client.coffee:1:raw_corpus | raw_corpus | skeleton = ->
zappa = window.zappa = {}
zappa.version = null
coffeescript_helpers = null
rewrite_function = null
zappa.run = (root_function) ->
root_locals_names = ['app', 'socket', 'def', 'helper', 'get', 'connect', 'at', 'emit']
sammy_locals_names = ['app', 'context', 'params', 'render', 'redirect... | CoffeeScript | mauricemach/zappa | src/client.coffee | MIT | a62a122802b516d4195b60a741cef044d2ef59bb | 943 | https://github.com/mauricemach/zappa/blob/a62a122802b516d4195b60a741cef044d2ef59bb/src/client.coffee | 2 | 51 | ||
mauricemach/zappa:src/client.coffee:1:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
skeleton = ->
zappa = window.zappa = {}
zappa.version = null
coffeescript_helpers = null
rewrite_function = null
zappa.run = (root_function) ->
root_locals_names = ['app', 'socket', 'def', 'helper', 'get', 'connect', 'at', 'emit']
sammy_locals... | var skeleton;
skeleton = function() {
var coffeescript_helpers, rewrite_function, zappa;
zappa = window.zappa = {};
zappa.version = null;
coffeescript_helpers = null;
rewrite_function = null;
return zappa.run = function(root_function) {
var app, defs, defs_names, helpers, helpers_names, root_context, r... | CoffeeScript | JavaScript | mauricemach/zappa | src/client.coffee | MIT | a62a122802b516d4195b60a741cef044d2ef59bb | 943 | https://github.com/mauricemach/zappa/blob/a62a122802b516d4195b60a741cef044d2ef59bb/src/client.coffee | 2 | 51 |
mauricemach/zappa:src/client.coffee:1:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
var skeleton;
skeleton = function() {
var coffeescript_helpers, rewrite_function, zappa;
zappa = window.zappa = {};
zappa.version = null;
coffeescript_helpers = null;
rewrite_function = null;
return zappa.run = function(root_function) {
var app, de... | skeleton = ->
zappa = window.zappa = {}
zappa.version = null
coffeescript_helpers = null
rewrite_function = null
zappa.run = (root_function) ->
root_locals_names = ['app', 'socket', 'def', 'helper', 'get', 'connect', 'at', 'emit']
sammy_locals_names = ['app', 'context', 'params', 'render', 'redirect... | JavaScript | CoffeeScript | mauricemach/zappa | src/client.coffee | MIT | a62a122802b516d4195b60a741cef044d2ef59bb | 943 | https://github.com/mauricemach/zappa/blob/a62a122802b516d4195b60a741cef044d2ef59bb/src/client.coffee | 2 | 51 |
mauricemach/zappa:src/client.coffee:1:completion | completion | skeleton = ->
zappa = window.zappa = {}
zappa.version = null
coffeescript_helpers = null
rewrite_function = null
zappa.run = (root_function) ->
root_locals_names = ['app', 'socket', 'def', 'helper', 'get', 'connect', 'at', 'emit']
sammy_locals_names = ['app', 'context', 'params', 'render', 'redirect... | root_locals = {app, socket}
root_locals.get = ->
if typeof arguments[0] isnt 'object'
routes.push({path: arguments[0], handler: arguments[1]})
else
for k, v of arguments[0]
routes.push({path: k, handler: v})
root_locals.helper = (obj) ->
for k, v of obj
help... | CoffeeScript | CoffeeScript | mauricemach/zappa | src/client.coffee | MIT | a62a122802b516d4195b60a741cef044d2ef59bb | 943 | https://github.com/mauricemach/zappa/blob/a62a122802b516d4195b60a741cef044d2ef59bb/src/client.coffee | 2 | 51 |
mauricemach/zappa:src/client.coffee:2:raw_corpus | raw_corpus | root_locals.emit = ->
socket.emit.apply socket, arguments
# Executes the (rewriten) end-user function and learns how the app should be structured.
rewritten_root = rewrite_function(root_function, root_locals_names)
rewritten_root(root_context, root_locals)
# Implements the application according ... | CoffeeScript | mauricemach/zappa | src/client.coffee | MIT | a62a122802b516d4195b60a741cef044d2ef59bb | 943 | https://github.com/mauricemach/zappa/blob/a62a122802b516d4195b60a741cef044d2ef59bb/src/client.coffee | 52 | 101 | ||
mauricemach/zappa:src/client.coffee:2:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
root_locals.emit = ->
socket.emit.apply socket, arguments
# Executes the (rewriten) end-user function and learns how the app should be structured.
rewritten_root = rewrite_function(root_function, root_locals_names)
rewritten_root(root_context, ... | var context, def, i, k, len, locals, name, r, rewritten_root, v;
root_locals.emit = function() {
return socket.emit.apply(socket, arguments);
};
// Executes the (rewriten) end-user function and learns how the app should be structured.
rewritten_root = rewrite_function(root_function, root_locals_names);
rewritten_r... | CoffeeScript | JavaScript | mauricemach/zappa | src/client.coffee | MIT | a62a122802b516d4195b60a741cef044d2ef59bb | 943 | https://github.com/mauricemach/zappa/blob/a62a122802b516d4195b60a741cef044d2ef59bb/src/client.coffee | 52 | 101 |
mauricemach/zappa:src/client.coffee:2:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
var context, def, i, k, len, locals, name, r, rewritten_root, v;
root_locals.emit = function() {
return socket.emit.apply(socket, arguments);
};
// Executes the (rewriten) end-user function and learns how the app should be structured.
rewritten_root = rewrite_f... | root_locals.emit = ->
socket.emit.apply socket, arguments
# Executes the (rewriten) end-user function and learns how the app should be structured.
rewritten_root = rewrite_function(root_function, root_locals_names)
rewritten_root(root_context, root_locals)
# Implements the application according ... | JavaScript | CoffeeScript | mauricemach/zappa | src/client.coffee | MIT | a62a122802b516d4195b60a741cef044d2ef59bb | 943 | https://github.com/mauricemach/zappa/blob/a62a122802b516d4195b60a741cef044d2ef59bb/src/client.coffee | 52 | 101 |
mauricemach/zappa:src/client.coffee:2:completion | completion | root_locals.emit = ->
socket.emit.apply socket, arguments
# Executes the (rewriten) end-user function and learns how the app should be structured.
rewritten_root = rewrite_function(root_function, root_locals_names)
rewritten_root(root_context, root_locals)
# Implements the application according ... | for name, helper of helpers
locals[name] = ->
helper(context, locals, arguments)
app.get r.path, (sammy_context) ->
context = {}
context[k] = v for k, v of sammy_context.params
locals.params = context
locals.context = sammy_context
locals.... | CoffeeScript | CoffeeScript | mauricemach/zappa | src/client.coffee | MIT | a62a122802b516d4195b60a741cef044d2ef59bb | 943 | https://github.com/mauricemach/zappa/blob/a62a122802b516d4195b60a741cef044d2ef59bb/src/client.coffee | 52 | 101 |
mauricemach/zappa:src/client.coffee:3:raw_corpus | raw_corpus | for name, helper of helpers
do (name, helper) ->
locals[name] = ->
helper(context, locals, arguments)
for name, h of ws_handlers
do (name, h) ->
socket.on name, (data) ->
context = {}
context[k] = v for k, v of data
locals.params... | CoffeeScript | mauricemach/zappa | src/client.coffee | MIT | a62a122802b516d4195b60a741cef044d2ef59bb | 943 | https://github.com/mauricemach/zappa/blob/a62a122802b516d4195b60a741cef044d2ef59bb/src/client.coffee | 102 | 116 | ||
mauricemach/zappa:src/client.coffee:3:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
for name, helper of helpers
do (name, helper) ->
locals[name] = ->
helper(context, locals, arguments)
for name, h of ws_handlers
do (name, h) ->
socket.on name, (data) ->
context = {}
... | var h, helper, name;
for (name in helpers) {
helper = helpers[name];
(function(name, helper) {
return locals[name] = function() {
return helper(context, locals, arguments);
};
})(name, helper);
}
for (name in ws_handlers) {
h = ws_handlers[name];
(function(name, h) {
return socket.on(name,... | CoffeeScript | JavaScript | mauricemach/zappa | src/client.coffee | MIT | a62a122802b516d4195b60a741cef044d2ef59bb | 943 | https://github.com/mauricemach/zappa/blob/a62a122802b516d4195b60a741cef044d2ef59bb/src/client.coffee | 102 | 116 |
mauricemach/zappa:src/client.coffee:3:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
var h, helper, name;
for (name in helpers) {
helper = helpers[name];
(function(name, helper) {
return locals[name] = function() {
return helper(context, locals, arguments);
};
})(name, helper);
}
for (name in ws_handlers) {
h = ws_handlers[n... | for name, helper of helpers
do (name, helper) ->
locals[name] = ->
helper(context, locals, arguments)
for name, h of ws_handlers
do (name, h) ->
socket.on name, (data) ->
context = {}
context[k] = v for k, v of data
locals.params... | JavaScript | CoffeeScript | mauricemach/zappa | src/client.coffee | MIT | a62a122802b516d4195b60a741cef044d2ef59bb | 943 | https://github.com/mauricemach/zappa/blob/a62a122802b516d4195b60a741cef044d2ef59bb/src/client.coffee | 102 | 116 |
mauricemach/zappa:src/client.coffee:3:completion | completion | for name, helper of helpers
do (name, helper) ->
locals[name] = ->
helper(context, locals, arguments)
for name, h of ws_handlers
do (name, h) -> | socket.on name, (data) ->
context = {}
context[k] = v for k, v of data
locals.params = context
h(context, locals)
$(-> app.run '#/') if app? | CoffeeScript | CoffeeScript | mauricemach/zappa | src/client.coffee | MIT | a62a122802b516d4195b60a741cef044d2ef59bb | 943 | https://github.com/mauricemach/zappa/blob/a62a122802b516d4195b60a741cef044d2ef59bb/src/client.coffee | 102 | 116 |
mauricemach/zappa:src/client.coffee:4:raw_corpus | raw_corpus | @build = (version, coffeescript_helpers, rewrite_function) ->
String(skeleton)
.replace('version = null;', "version = '#{version}';")
.replace('coffeescript_helpers = null;', "var coffeescript_helpers = '#{coffeescript_helpers}';")
.replace('rewrite_function = null;', "var rewrite_function = #{rewrite_fun... | CoffeeScript | mauricemach/zappa | src/client.coffee | MIT | 119552daa059635e97de9b2967c1e1fcdcfb64dd | 943 | https://github.com/mauricemach/zappa/blob/119552daa059635e97de9b2967c1e1fcdcfb64dd/src/client.coffee | 118 | 123 | ||
mauricemach/zappa:src/client.coffee:4:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
@build = (version, coffeescript_helpers, rewrite_function) ->
String(skeleton)
.replace('version = null;', "version = '#{version}';")
.replace('coffeescript_helpers = null;', "var coffeescript_helpers = '#{coffeescript_helpers}';")
.replace('rewrite... | this.build = function(version, coffeescript_helpers, rewrite_function) {
return String(skeleton).replace('version = null;', `version = '${version}';`).replace('coffeescript_helpers = null;', `var coffeescript_helpers = '${coffeescript_helpers}';`).replace('rewrite_function = null;', `var rewrite_function = ${rewrite_... | CoffeeScript | JavaScript | mauricemach/zappa | src/client.coffee | MIT | 119552daa059635e97de9b2967c1e1fcdcfb64dd | 943 | https://github.com/mauricemach/zappa/blob/119552daa059635e97de9b2967c1e1fcdcfb64dd/src/client.coffee | 118 | 123 |
mauricemach/zappa:src/client.coffee:4:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
this.build = function(version, coffeescript_helpers, rewrite_function) {
return String(skeleton).replace('version = null;', `version = '${version}';`).replace('coffeescript_helpers = null;', `var coffeescript_helpers = '${coffeescript_helpers}';`).replace('rewrit... | @build = (version, coffeescript_helpers, rewrite_function) ->
String(skeleton)
.replace('version = null;', "version = '#{version}';")
.replace('coffeescript_helpers = null;', "var coffeescript_helpers = '#{coffeescript_helpers}';")
.replace('rewrite_function = null;', "var rewrite_function = #{rewrite_fun... | JavaScript | CoffeeScript | mauricemach/zappa | src/client.coffee | MIT | 119552daa059635e97de9b2967c1e1fcdcfb64dd | 943 | https://github.com/mauricemach/zappa/blob/119552daa059635e97de9b2967c1e1fcdcfb64dd/src/client.coffee | 118 | 123 |
mauricemach/zappa:src/client.coffee:4:completion | completion | @build = (version, coffeescript_helpers, rewrite_function) ->
String(skeleton)
.replace('version = null;', "version = '#{version}';") | .replace('coffeescript_helpers = null;', "var coffeescript_helpers = '#{coffeescript_helpers}';")
.replace('rewrite_function = null;', "var rewrite_function = #{rewrite_function};")
.replace /(\n)/g, '' | CoffeeScript | CoffeeScript | mauricemach/zappa | src/client.coffee | MIT | 119552daa059635e97de9b2967c1e1fcdcfb64dd | 943 | https://github.com/mauricemach/zappa/blob/119552daa059635e97de9b2967c1e1fcdcfb64dd/src/client.coffee | 118 | 123 |
mauricemach/zappa:src/client.coffee:3:raw_corpus | raw_corpus | for name, helper of helpers
locals[name] = ->
helper(context, locals, arguments)
for name, h of ws_handlers
socket.on name, (data) ->
context = {}
context[k] = v for k, v of data
locals.params = context
h(context, locals)
$(-> app.run '#/') i... | CoffeeScript | mauricemach/zappa | src/client.coffee | MIT | 974f5b26e61fedc740a305bc5d21606a77af840e | 943 | https://github.com/mauricemach/zappa/blob/974f5b26e61fedc740a305bc5d21606a77af840e/src/client.coffee | 102 | 114 | ||
mauricemach/zappa:src/client.coffee:3:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
for name, helper of helpers
locals[name] = ->
helper(context, locals, arguments)
for name, h of ws_handlers
socket.on name, (data) ->
context = {}
context[k] = v for k, v of data
locals.params = conte... | var h, helper, name;
for (name in helpers) {
helper = helpers[name];
locals[name] = function() {
return helper(context, locals, arguments);
};
}
for (name in ws_handlers) {
h = ws_handlers[name];
socket.on(name, function(data) {
var context, k, v;
context = {};
for (k in data) {
v = da... | CoffeeScript | JavaScript | mauricemach/zappa | src/client.coffee | MIT | 974f5b26e61fedc740a305bc5d21606a77af840e | 943 | https://github.com/mauricemach/zappa/blob/974f5b26e61fedc740a305bc5d21606a77af840e/src/client.coffee | 102 | 114 |
mauricemach/zappa:src/client.coffee:3:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
var h, helper, name;
for (name in helpers) {
helper = helpers[name];
locals[name] = function() {
return helper(context, locals, arguments);
};
}
for (name in ws_handlers) {
h = ws_handlers[name];
socket.on(name, function(data) {
var context, k, ... | for name, helper of helpers
locals[name] = ->
helper(context, locals, arguments)
for name, h of ws_handlers
socket.on name, (data) ->
context = {}
context[k] = v for k, v of data
locals.params = context
h(context, locals)
$(-> app.run '#/') i... | JavaScript | CoffeeScript | mauricemach/zappa | src/client.coffee | MIT | 974f5b26e61fedc740a305bc5d21606a77af840e | 943 | https://github.com/mauricemach/zappa/blob/974f5b26e61fedc740a305bc5d21606a77af840e/src/client.coffee | 102 | 114 |
mauricemach/zappa:src/client.coffee:3:completion | completion | for name, helper of helpers
locals[name] = ->
helper(context, locals, arguments)
for name, h of ws_handlers
socket.on name, (data) -> | context = {}
context[k] = v for k, v of data
locals.params = context
h(context, locals)
$(-> app.run '#/') if app? | CoffeeScript | CoffeeScript | mauricemach/zappa | src/client.coffee | MIT | 974f5b26e61fedc740a305bc5d21606a77af840e | 943 | https://github.com/mauricemach/zappa/blob/974f5b26e61fedc740a305bc5d21606a77af840e/src/client.coffee | 102 | 114 |
mauricemach/zappa:src/client.coffee:2:raw_corpus | raw_corpus | root_locals.emit = ->
socket.emit.apply socket, arguments
# Executes the (rewriten) end-user function and learns how the app should be structured.
rewritten_root = rewrite_function(root_function, root_locals_names)
rewritten_root(root_context, root_locals)
# Implements the application according ... | CoffeeScript | mauricemach/zappa | src/client.coffee | MIT | e7ed8357094e742ffa0cc9e86b393ee71e27814b | 943 | https://github.com/mauricemach/zappa/blob/e7ed8357094e742ffa0cc9e86b393ee71e27814b/src/client.coffee | 52 | 101 | ||
mauricemach/zappa:src/client.coffee:2:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
root_locals.emit = ->
socket.emit.apply socket, arguments
# Executes the (rewriten) end-user function and learns how the app should be structured.
rewritten_root = rewrite_function(root_function, root_locals_names)
rewritten_root(root_context, ... | var context, def, i, k, len, locals, name, r, rewritten_root, v;
root_locals.emit = function() {
return socket.emit.apply(socket, arguments);
};
// Executes the (rewriten) end-user function and learns how the app should be structured.
rewritten_root = rewrite_function(root_function, root_locals_names);
rewritten_r... | CoffeeScript | JavaScript | mauricemach/zappa | src/client.coffee | MIT | e7ed8357094e742ffa0cc9e86b393ee71e27814b | 943 | https://github.com/mauricemach/zappa/blob/e7ed8357094e742ffa0cc9e86b393ee71e27814b/src/client.coffee | 52 | 101 |
mauricemach/zappa:src/client.coffee:2:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
var context, def, i, k, len, locals, name, r, rewritten_root, v;
root_locals.emit = function() {
return socket.emit.apply(socket, arguments);
};
// Executes the (rewriten) end-user function and learns how the app should be structured.
rewritten_root = rewrite_f... | root_locals.emit = ->
socket.emit.apply socket, arguments
# Executes the (rewriten) end-user function and learns how the app should be structured.
rewritten_root = rewrite_function(root_function, root_locals_names)
rewritten_root(root_context, root_locals)
# Implements the application according ... | JavaScript | CoffeeScript | mauricemach/zappa | src/client.coffee | MIT | e7ed8357094e742ffa0cc9e86b393ee71e27814b | 943 | https://github.com/mauricemach/zappa/blob/e7ed8357094e742ffa0cc9e86b393ee71e27814b/src/client.coffee | 52 | 101 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.