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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
twilson63/express-coffee:lib/coffee/lib/coffee-script/test/test_classes.coffee:1:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
class Base
func: (string) ->
"zero/$string"
@static: (string) ->
"static/$string"
``` | var Base;
Base = class Base {
func(string) {
return "zero/$string";
}
static static(string) {
return "static/$string";
}
}; | CoffeeScript | JavaScript | twilson63/express-coffee | lib/coffee/lib/coffee-script/test/test_classes.coffee | MIT | 971837f7d7a5e96cf5a5fdb52e52748060ed2c68 | 622 | https://github.com/twilson63/express-coffee/blob/971837f7d7a5e96cf5a5fdb52e52748060ed2c68/lib/coffee/lib/coffee-script/test/test_classes.coffee | 2 | 7 |
twilson63/express-coffee:lib/coffee/lib/coffee-script/test/test_classes.coffee:1:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
var Base;
Base = class Base {
func(string) {
return "zero/$string";
}
static static(string) {
return "static/$string";
}
};
``` | class Base
func: (string) ->
"zero/$string"
@static: (string) ->
"static/$string" | JavaScript | CoffeeScript | twilson63/express-coffee | lib/coffee/lib/coffee-script/test/test_classes.coffee | MIT | 971837f7d7a5e96cf5a5fdb52e52748060ed2c68 | 622 | https://github.com/twilson63/express-coffee/blob/971837f7d7a5e96cf5a5fdb52e52748060ed2c68/lib/coffee/lib/coffee-script/test/test_classes.coffee | 2 | 7 |
twilson63/express-coffee:lib/coffee/lib/coffee-script/test/test_classes.coffee:1:completion | completion | class Base
func: (string) ->
"zero/$string" | @static: (string) ->
"static/$string" | CoffeeScript | CoffeeScript | twilson63/express-coffee | lib/coffee/lib/coffee-script/test/test_classes.coffee | MIT | 971837f7d7a5e96cf5a5fdb52e52748060ed2c68 | 622 | https://github.com/twilson63/express-coffee/blob/971837f7d7a5e96cf5a5fdb52e52748060ed2c68/lib/coffee/lib/coffee-script/test/test_classes.coffee | 2 | 7 |
twilson63/express-coffee:lib/coffee/lib/coffee-script/test/test_classes.coffee:2:raw_corpus | raw_corpus | class FirstChild extends Base
func: (string) ->
super('one/') + string | CoffeeScript | twilson63/express-coffee | lib/coffee/lib/coffee-script/test/test_classes.coffee | MIT | 971837f7d7a5e96cf5a5fdb52e52748060ed2c68 | 622 | https://github.com/twilson63/express-coffee/blob/971837f7d7a5e96cf5a5fdb52e52748060ed2c68/lib/coffee/lib/coffee-script/test/test_classes.coffee | 9 | 11 | ||
twilson63/express-coffee:lib/coffee/lib/coffee-script/test/test_classes.coffee:2:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
class FirstChild extends Base
func: (string) ->
super('one/') + string
``` | var FirstChild;
FirstChild = class FirstChild extends Base {
func(string) {
return super.func('one/') + string;
}
}; | CoffeeScript | JavaScript | twilson63/express-coffee | lib/coffee/lib/coffee-script/test/test_classes.coffee | MIT | 971837f7d7a5e96cf5a5fdb52e52748060ed2c68 | 622 | https://github.com/twilson63/express-coffee/blob/971837f7d7a5e96cf5a5fdb52e52748060ed2c68/lib/coffee/lib/coffee-script/test/test_classes.coffee | 9 | 11 |
twilson63/express-coffee:lib/coffee/lib/coffee-script/test/test_classes.coffee:2:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
var FirstChild;
FirstChild = class FirstChild extends Base {
func(string) {
return super.func('one/') + string;
}
};
``` | class FirstChild extends Base
func: (string) ->
super('one/') + string | JavaScript | CoffeeScript | twilson63/express-coffee | lib/coffee/lib/coffee-script/test/test_classes.coffee | MIT | 971837f7d7a5e96cf5a5fdb52e52748060ed2c68 | 622 | https://github.com/twilson63/express-coffee/blob/971837f7d7a5e96cf5a5fdb52e52748060ed2c68/lib/coffee/lib/coffee-script/test/test_classes.coffee | 9 | 11 |
twilson63/express-coffee:lib/coffee/lib/coffee-script/test/test_classes.coffee:3:raw_corpus | raw_corpus | class SecondChild extends FirstChild
func: (string) ->
super('two/') + string | CoffeeScript | twilson63/express-coffee | lib/coffee/lib/coffee-script/test/test_classes.coffee | MIT | 971837f7d7a5e96cf5a5fdb52e52748060ed2c68 | 622 | https://github.com/twilson63/express-coffee/blob/971837f7d7a5e96cf5a5fdb52e52748060ed2c68/lib/coffee/lib/coffee-script/test/test_classes.coffee | 13 | 15 | ||
twilson63/express-coffee:lib/coffee/lib/coffee-script/test/test_classes.coffee:3:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
class SecondChild extends FirstChild
func: (string) ->
super('two/') + string
``` | var SecondChild;
SecondChild = class SecondChild extends FirstChild {
func(string) {
return super.func('two/') + string;
}
}; | CoffeeScript | JavaScript | twilson63/express-coffee | lib/coffee/lib/coffee-script/test/test_classes.coffee | MIT | 971837f7d7a5e96cf5a5fdb52e52748060ed2c68 | 622 | https://github.com/twilson63/express-coffee/blob/971837f7d7a5e96cf5a5fdb52e52748060ed2c68/lib/coffee/lib/coffee-script/test/test_classes.coffee | 13 | 15 |
twilson63/express-coffee:lib/coffee/lib/coffee-script/test/test_classes.coffee:3:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
var SecondChild;
SecondChild = class SecondChild extends FirstChild {
func(string) {
return super.func('two/') + string;
}
};
``` | class SecondChild extends FirstChild
func: (string) ->
super('two/') + string | JavaScript | CoffeeScript | twilson63/express-coffee | lib/coffee/lib/coffee-script/test/test_classes.coffee | MIT | 971837f7d7a5e96cf5a5fdb52e52748060ed2c68 | 622 | https://github.com/twilson63/express-coffee/blob/971837f7d7a5e96cf5a5fdb52e52748060ed2c68/lib/coffee/lib/coffee-script/test/test_classes.coffee | 13 | 15 |
twilson63/express-coffee:lib/coffee/lib/coffee-script/test/test_classes.coffee:4:raw_corpus | raw_corpus | class ThirdChild extends SecondChild
constructor: ->
@array: [1, 2, 3]
# Gratuitous comment for testing.
func: (string) ->
super('three/') + string
result: (new ThirdChild()).func 'four'
ok result is 'zero/one/two/three/four'
ok Base.static('word') is 'static/word' | CoffeeScript | twilson63/express-coffee | lib/coffee/lib/coffee-script/test/test_classes.coffee | MIT | 971837f7d7a5e96cf5a5fdb52e52748060ed2c68 | 622 | https://github.com/twilson63/express-coffee/blob/971837f7d7a5e96cf5a5fdb52e52748060ed2c68/lib/coffee/lib/coffee-script/test/test_classes.coffee | 17 | 28 | ||
twilson63/express-coffee:lib/coffee/lib/coffee-script/test/test_classes.coffee:4:completion | completion | class ThirdChild extends SecondChild
constructor: ->
@array: [1, 2, 3]
# Gratuitous comment for testing.
func: (string) -> | super('three/') + string
result: (new ThirdChild()).func 'four'
ok result is 'zero/one/two/three/four'
ok Base.static('word') is 'static/word' | CoffeeScript | CoffeeScript | twilson63/express-coffee | lib/coffee/lib/coffee-script/test/test_classes.coffee | MIT | 971837f7d7a5e96cf5a5fdb52e52748060ed2c68 | 622 | https://github.com/twilson63/express-coffee/blob/971837f7d7a5e96cf5a5fdb52e52748060ed2c68/lib/coffee/lib/coffee-script/test/test_classes.coffee | 17 | 28 |
twilson63/express-coffee:lib/coffee/lib/coffee-script/test/test_classes.coffee:5:raw_corpus | raw_corpus | class TopClass
constructor: (arg) ->
@prop: 'top-' + arg | CoffeeScript | twilson63/express-coffee | lib/coffee/lib/coffee-script/test/test_classes.coffee | MIT | 971837f7d7a5e96cf5a5fdb52e52748060ed2c68 | 622 | https://github.com/twilson63/express-coffee/blob/971837f7d7a5e96cf5a5fdb52e52748060ed2c68/lib/coffee/lib/coffee-script/test/test_classes.coffee | 31 | 33 | ||
twilson63/express-coffee:lib/coffee/lib/coffee-script/test/test_classes.coffee:6:raw_corpus | raw_corpus | class SuperClass extends TopClass
constructor: (arg) ->
super 'super-' + arg | CoffeeScript | twilson63/express-coffee | lib/coffee/lib/coffee-script/test/test_classes.coffee | MIT | 971837f7d7a5e96cf5a5fdb52e52748060ed2c68 | 622 | https://github.com/twilson63/express-coffee/blob/971837f7d7a5e96cf5a5fdb52e52748060ed2c68/lib/coffee/lib/coffee-script/test/test_classes.coffee | 35 | 37 | ||
twilson63/express-coffee:lib/coffee/lib/coffee-script/test/test_classes.coffee:6:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
class SuperClass extends TopClass
constructor: (arg) ->
super 'super-' + arg
``` | var SuperClass;
SuperClass = class SuperClass extends TopClass {
constructor(arg) {
super('super-' + arg);
}
}; | CoffeeScript | JavaScript | twilson63/express-coffee | lib/coffee/lib/coffee-script/test/test_classes.coffee | MIT | 971837f7d7a5e96cf5a5fdb52e52748060ed2c68 | 622 | https://github.com/twilson63/express-coffee/blob/971837f7d7a5e96cf5a5fdb52e52748060ed2c68/lib/coffee/lib/coffee-script/test/test_classes.coffee | 35 | 37 |
twilson63/express-coffee:lib/coffee/lib/coffee-script/test/test_classes.coffee:6:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
var SuperClass;
SuperClass = class SuperClass extends TopClass {
constructor(arg) {
super('super-' + arg);
}
};
``` | class SuperClass extends TopClass
constructor: (arg) ->
super 'super-' + arg | JavaScript | CoffeeScript | twilson63/express-coffee | lib/coffee/lib/coffee-script/test/test_classes.coffee | MIT | 971837f7d7a5e96cf5a5fdb52e52748060ed2c68 | 622 | https://github.com/twilson63/express-coffee/blob/971837f7d7a5e96cf5a5fdb52e52748060ed2c68/lib/coffee/lib/coffee-script/test/test_classes.coffee | 35 | 37 |
twilson63/express-coffee:lib/coffee/lib/coffee-script/test/test_classes.coffee:7:raw_corpus | raw_corpus | class SubClass extends SuperClass
constructor: ->
super 'sub'
ok (new SubClass()).prop is 'top-super-sub' | CoffeeScript | twilson63/express-coffee | lib/coffee/lib/coffee-script/test/test_classes.coffee | MIT | 971837f7d7a5e96cf5a5fdb52e52748060ed2c68 | 622 | https://github.com/twilson63/express-coffee/blob/971837f7d7a5e96cf5a5fdb52e52748060ed2c68/lib/coffee/lib/coffee-script/test/test_classes.coffee | 39 | 43 | ||
twilson63/express-coffee:lib/coffee/lib/coffee-script/test/test_classes.coffee:7:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
class SubClass extends SuperClass
constructor: ->
super 'sub'
ok (new SubClass()).prop is 'top-super-sub'
``` | var SubClass;
SubClass = class SubClass extends SuperClass {
constructor() {
super('sub');
}
};
ok((new SubClass()).prop === 'top-super-sub'); | CoffeeScript | JavaScript | twilson63/express-coffee | lib/coffee/lib/coffee-script/test/test_classes.coffee | MIT | 971837f7d7a5e96cf5a5fdb52e52748060ed2c68 | 622 | https://github.com/twilson63/express-coffee/blob/971837f7d7a5e96cf5a5fdb52e52748060ed2c68/lib/coffee/lib/coffee-script/test/test_classes.coffee | 39 | 43 |
twilson63/express-coffee:lib/coffee/lib/coffee-script/test/test_classes.coffee:7:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
var SubClass;
SubClass = class SubClass extends SuperClass {
constructor() {
super('sub');
}
};
ok((new SubClass()).prop === 'top-super-sub');
``` | class SubClass extends SuperClass
constructor: ->
super 'sub'
ok (new SubClass()).prop is 'top-super-sub' | JavaScript | CoffeeScript | twilson63/express-coffee | lib/coffee/lib/coffee-script/test/test_classes.coffee | MIT | 971837f7d7a5e96cf5a5fdb52e52748060ed2c68 | 622 | https://github.com/twilson63/express-coffee/blob/971837f7d7a5e96cf5a5fdb52e52748060ed2c68/lib/coffee/lib/coffee-script/test/test_classes.coffee | 39 | 43 |
twilson63/express-coffee:lib/coffee/lib/coffee-script/test/test_classes.coffee:7:completion | completion | class SubClass extends SuperClass
constructor: -> | super 'sub'
ok (new SubClass()).prop is 'top-super-sub' | CoffeeScript | CoffeeScript | twilson63/express-coffee | lib/coffee/lib/coffee-script/test/test_classes.coffee | MIT | 971837f7d7a5e96cf5a5fdb52e52748060ed2c68 | 622 | https://github.com/twilson63/express-coffee/blob/971837f7d7a5e96cf5a5fdb52e52748060ed2c68/lib/coffee/lib/coffee-script/test/test_classes.coffee | 39 | 43 |
twilson63/express-coffee:lib/coffee/lib/coffee-script/test/test_classes.coffee:9:raw_corpus | raw_corpus | class TwoClass extends OneClass
ok (new TwoClass('three')).name is 'three'
# And now the same tests, but written in the manual style: | CoffeeScript | twilson63/express-coffee | lib/coffee/lib/coffee-script/test/test_classes.coffee | MIT | 971837f7d7a5e96cf5a5fdb52e52748060ed2c68 | 622 | https://github.com/twilson63/express-coffee/blob/971837f7d7a5e96cf5a5fdb52e52748060ed2c68/lib/coffee/lib/coffee-script/test/test_classes.coffee | 49 | 54 | ||
twilson63/express-coffee:lib/coffee/lib/coffee-script/test/test_classes.coffee:9:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
class TwoClass extends OneClass
ok (new TwoClass('three')).name is 'three'
# And now the same tests, but written in the manual style:
``` | var TwoClass;
TwoClass = class TwoClass extends OneClass {};
ok((new TwoClass('three')).name === 'three');
// And now the same tests, but written in the manual style: | CoffeeScript | JavaScript | twilson63/express-coffee | lib/coffee/lib/coffee-script/test/test_classes.coffee | MIT | 971837f7d7a5e96cf5a5fdb52e52748060ed2c68 | 622 | https://github.com/twilson63/express-coffee/blob/971837f7d7a5e96cf5a5fdb52e52748060ed2c68/lib/coffee/lib/coffee-script/test/test_classes.coffee | 49 | 54 |
twilson63/express-coffee:lib/coffee/lib/coffee-script/test/test_classes.coffee:9:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
var TwoClass;
TwoClass = class TwoClass extends OneClass {};
ok((new TwoClass('three')).name === 'three');
// And now the same tests, but written in the manual style:
``` | class TwoClass extends OneClass
ok (new TwoClass('three')).name is 'three'
# And now the same tests, but written in the manual style: | JavaScript | CoffeeScript | twilson63/express-coffee | lib/coffee/lib/coffee-script/test/test_classes.coffee | MIT | 971837f7d7a5e96cf5a5fdb52e52748060ed2c68 | 622 | https://github.com/twilson63/express-coffee/blob/971837f7d7a5e96cf5a5fdb52e52748060ed2c68/lib/coffee/lib/coffee-script/test/test_classes.coffee | 49 | 54 |
twilson63/express-coffee:lib/coffee/lib/coffee-script/test/test_classes.coffee:16:raw_corpus | raw_corpus | ThirdChild: ->
@array: [1, 2, 3]
this
ThirdChild extends SecondChild | CoffeeScript | twilson63/express-coffee | lib/coffee/lib/coffee-script/test/test_classes.coffee | MIT | 971837f7d7a5e96cf5a5fdb52e52748060ed2c68 | 622 | https://github.com/twilson63/express-coffee/blob/971837f7d7a5e96cf5a5fdb52e52748060ed2c68/lib/coffee/lib/coffee-script/test/test_classes.coffee | 69 | 72 | ||
twilson63/express-coffee:lib/coffee/lib/coffee-script/test/test_classes.coffee:17:raw_corpus | raw_corpus | ThirdChild::func: (string) ->
super('three/') + string
result: (new ThirdChild()).func 'four'
ok result is 'zero/one/two/three/four' | CoffeeScript | twilson63/express-coffee | lib/coffee/lib/coffee-script/test/test_classes.coffee | MIT | 971837f7d7a5e96cf5a5fdb52e52748060ed2c68 | 622 | https://github.com/twilson63/express-coffee/blob/971837f7d7a5e96cf5a5fdb52e52748060ed2c68/lib/coffee/lib/coffee-script/test/test_classes.coffee | 73 | 78 | ||
twilson63/express-coffee:lib/coffee/lib/coffee-script/test/test_classes.coffee:17:completion | completion | ThirdChild::func: (string) ->
super('three/') + string | result: (new ThirdChild()).func 'four'
ok result is 'zero/one/two/three/four' | CoffeeScript | CoffeeScript | twilson63/express-coffee | lib/coffee/lib/coffee-script/test/test_classes.coffee | MIT | 971837f7d7a5e96cf5a5fdb52e52748060ed2c68 | 622 | https://github.com/twilson63/express-coffee/blob/971837f7d7a5e96cf5a5fdb52e52748060ed2c68/lib/coffee/lib/coffee-script/test/test_classes.coffee | 73 | 78 |
twilson63/express-coffee:lib/coffee/lib/coffee-script/test/test_classes.coffee:18:raw_corpus | raw_corpus | TopClass: (arg) ->
@prop: 'top-' + arg
this | CoffeeScript | twilson63/express-coffee | lib/coffee/lib/coffee-script/test/test_classes.coffee | MIT | 971837f7d7a5e96cf5a5fdb52e52748060ed2c68 | 622 | https://github.com/twilson63/express-coffee/blob/971837f7d7a5e96cf5a5fdb52e52748060ed2c68/lib/coffee/lib/coffee-script/test/test_classes.coffee | 81 | 83 | ||
twilson63/express-coffee:lib/coffee/lib/coffee-script/test/test_classes.coffee:19:raw_corpus | raw_corpus | SuperClass: (arg) ->
super 'super-' + arg
this | CoffeeScript | twilson63/express-coffee | lib/coffee/lib/coffee-script/test/test_classes.coffee | MIT | 971837f7d7a5e96cf5a5fdb52e52748060ed2c68 | 622 | https://github.com/twilson63/express-coffee/blob/971837f7d7a5e96cf5a5fdb52e52748060ed2c68/lib/coffee/lib/coffee-script/test/test_classes.coffee | 85 | 87 | ||
twilson63/express-coffee:lib/coffee/lib/coffee-script/test/test_classes.coffee:20:raw_corpus | raw_corpus | SubClass: ->
super 'sub'
this
SuperClass extends TopClass
SubClass extends SuperClass
ok (new SubClass()).prop is 'top-super-sub' | CoffeeScript | twilson63/express-coffee | lib/coffee/lib/coffee-script/test/test_classes.coffee | MIT | 971837f7d7a5e96cf5a5fdb52e52748060ed2c68 | 622 | https://github.com/twilson63/express-coffee/blob/971837f7d7a5e96cf5a5fdb52e52748060ed2c68/lib/coffee/lib/coffee-script/test/test_classes.coffee | 89 | 96 | ||
twilson63/express-coffee:lib/coffee/lib/coffee-script/test/test_classes.coffee:20:completion | completion | SubClass: ->
super 'sub'
this | SuperClass extends TopClass
SubClass extends SuperClass
ok (new SubClass()).prop is 'top-super-sub' | CoffeeScript | CoffeeScript | twilson63/express-coffee | lib/coffee/lib/coffee-script/test/test_classes.coffee | MIT | 971837f7d7a5e96cf5a5fdb52e52748060ed2c68 | 622 | https://github.com/twilson63/express-coffee/blob/971837f7d7a5e96cf5a5fdb52e52748060ed2c68/lib/coffee/lib/coffee-script/test/test_classes.coffee | 89 | 96 |
CaryLandholt/AngularFun:tasks/prune.coffee:1:raw_corpus | raw_corpus | ###global module, require###
module.exports = (grunt) ->
fs = require 'fs'
growl = require 'growl'
path = require 'path'
grunt.registerMultiTask 'prune', 'Deletes files', ->
src = @file.src
files = grunt.file.expandFiles src
files.forEach (file) ->
fs.unlinkSync file | CoffeeScript | CaryLandholt/AngularFun | tasks/prune.coffee | MIT | 8c0667872476daa5f537284f934b9a4c82751114 | 672 | https://github.com/CaryLandholt/AngularFun/blob/8c0667872476daa5f537284f934b9a4c82751114/tasks/prune.coffee | 1 | 13 | ||
CaryLandholt/AngularFun:tasks/prune.coffee:1:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
###global module, require###
module.exports = (grunt) ->
fs = require 'fs'
growl = require 'growl'
path = require 'path'
grunt.registerMultiTask 'prune', 'Deletes files', ->
src = @file.src
files = grunt.file.expandFiles src
files.forEach (file) ->
... | /*global module, require*/
module.exports = function(grunt) {
var fs, growl, path;
fs = require('fs');
growl = require('growl');
path = require('path');
return grunt.registerMultiTask('prune', 'Deletes files', function() {
var files, src;
src = this.file.src;
files = grunt.file.expandFiles(src);
... | CoffeeScript | JavaScript | CaryLandholt/AngularFun | tasks/prune.coffee | MIT | 8c0667872476daa5f537284f934b9a4c82751114 | 672 | https://github.com/CaryLandholt/AngularFun/blob/8c0667872476daa5f537284f934b9a4c82751114/tasks/prune.coffee | 1 | 13 |
CaryLandholt/AngularFun:tasks/prune.coffee:1:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
/*global module, require*/
module.exports = function(grunt) {
var fs, growl, path;
fs = require('fs');
growl = require('growl');
path = require('path');
return grunt.registerMultiTask('prune', 'Deletes files', function() {
var files, src;
src = th... | ###global module, require###
module.exports = (grunt) ->
fs = require 'fs'
growl = require 'growl'
path = require 'path'
grunt.registerMultiTask 'prune', 'Deletes files', ->
src = @file.src
files = grunt.file.expandFiles src
files.forEach (file) ->
fs.unlinkSync file | JavaScript | CoffeeScript | CaryLandholt/AngularFun | tasks/prune.coffee | MIT | 8c0667872476daa5f537284f934b9a4c82751114 | 672 | https://github.com/CaryLandholt/AngularFun/blob/8c0667872476daa5f537284f934b9a4c82751114/tasks/prune.coffee | 1 | 13 |
CaryLandholt/AngularFun:tasks/prune.coffee:1:completion | completion | ###global module, require###
module.exports = (grunt) ->
fs = require 'fs'
growl = require 'growl'
path = require 'path' | grunt.registerMultiTask 'prune', 'Deletes files', ->
src = @file.src
files = grunt.file.expandFiles src
files.forEach (file) ->
fs.unlinkSync file | CoffeeScript | CoffeeScript | CaryLandholt/AngularFun | tasks/prune.coffee | MIT | 8c0667872476daa5f537284f934b9a4c82751114 | 672 | https://github.com/CaryLandholt/AngularFun/blob/8c0667872476daa5f537284f934b9a4c82751114/tasks/prune.coffee | 1 | 13 |
soyjavi/QuoJS:source/quo.gestures.basic.coffee:1:raw_corpus | raw_corpus | ###
Quo Basic Gestures: touch, hold, doubleTap
@namespace Quo.Gestures
@class Basic
@author Ignacio Olalde Ramos <ina@tapquo.com> || @piniphone
###
"use strict"
Quo.Gestures.add
name : "basic"
events : ["touch", "hold", "doubleTap"]
handler : do (base = Quo.Gestures) ->
GAP = 15
DELAY =
TAP... | CoffeeScript | soyjavi/QuoJS | source/quo.gestures.basic.coffee | MIT | 7296aa6bc321370c1b92de005c9b55b9e1365596 | 2,055 | https://github.com/soyjavi/QuoJS/blob/7296aa6bc321370c1b92de005c9b55b9e1365596/source/quo.gestures.basic.coffee | 1 | 50 | ||
soyjavi/QuoJS:source/quo.gestures.basic.coffee:1:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
###
Quo Basic Gestures: touch, hold, doubleTap
@namespace Quo.Gestures
@class Basic
@author Ignacio Olalde Ramos <ina@tapquo.com> || @piniphone
###
"use strict"
Quo.Gestures.add
name : "basic"
events : ["touch", "hold", "doubleTap"]
handler : do (b... | /*
Quo Basic Gestures: touch, hold, doubleTap
@namespace Quo.Gestures
@class Basic
@author Ignacio Olalde Ramos <ina@tapquo.com> || @piniphone
*/
"use strict";
Quo.Gestures.add({
name: "basic",
events: ["touch", "hold", "doubleTap"],
handler: (function(base) {
var DELAY, GAP, _hold_timeout, _last_tap, _star... | CoffeeScript | JavaScript | soyjavi/QuoJS | source/quo.gestures.basic.coffee | MIT | 7296aa6bc321370c1b92de005c9b55b9e1365596 | 2,055 | https://github.com/soyjavi/QuoJS/blob/7296aa6bc321370c1b92de005c9b55b9e1365596/source/quo.gestures.basic.coffee | 1 | 50 |
soyjavi/QuoJS:source/quo.gestures.basic.coffee:1:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
/*
Quo Basic Gestures: touch, hold, doubleTap
@namespace Quo.Gestures
@class Basic
@author Ignacio Olalde Ramos <ina@tapquo.com> || @piniphone
*/
"use strict";
Quo.Gestures.add({
name: "basic",
events: ["touch", "hold", "doubleTap"],
handler: (function(base... | ###
Quo Basic Gestures: touch, hold, doubleTap
@namespace Quo.Gestures
@class Basic
@author Ignacio Olalde Ramos <ina@tapquo.com> || @piniphone
###
"use strict"
Quo.Gestures.add
name : "basic"
events : ["touch", "hold", "doubleTap"]
handler : do (base = Quo.Gestures) ->
GAP = 15
DELAY =
TAP... | JavaScript | CoffeeScript | soyjavi/QuoJS | source/quo.gestures.basic.coffee | MIT | 7296aa6bc321370c1b92de005c9b55b9e1365596 | 2,055 | https://github.com/soyjavi/QuoJS/blob/7296aa6bc321370c1b92de005c9b55b9e1365596/source/quo.gestures.basic.coffee | 1 | 50 |
soyjavi/QuoJS:source/quo.gestures.basic.coffee:1:completion | completion | ###
Quo Basic Gestures: touch, hold, doubleTap
@namespace Quo.Gestures
@class Basic
@author Ignacio Olalde Ramos <ina@tapquo.com> || @piniphone
###
"use strict"
Quo.Gestures.add
name : "basic"
events : ["touch", "hold", "doubleTap"]
handler : do (base = Quo.Gestures) ->
GAP = 15
DELAY =
TAP... | _start = null
_last_tap = null
start = (target, data) ->
if data.length is 1
_start = time: new Date(), x: data[0].x, y: data[0].y
_target = target
_hold_timeout = setTimeout ->
base.trigger(target, "hold", data[0])
, DELAY.HOLD
else do cancel
move = (... | CoffeeScript | CoffeeScript | soyjavi/QuoJS | source/quo.gestures.basic.coffee | MIT | 7296aa6bc321370c1b92de005c9b55b9e1365596 | 2,055 | https://github.com/soyjavi/QuoJS/blob/7296aa6bc321370c1b92de005c9b55b9e1365596/source/quo.gestures.basic.coffee | 1 | 50 |
soyjavi/QuoJS:source/quo.gestures.basic.coffee:2:raw_corpus | raw_corpus | now = new Date()
if (now - _start.time) < DELAY.TAP
if (now - _last_tap) < DELAY.DOUBLE_TAP
base.trigger target, "doubleTap", data[0]
_last_tap = null
else
_last_tap = now
# base.trigger target, "tap", data[0]
base.trigger target, "touch", data[0]
... | CoffeeScript | soyjavi/QuoJS | source/quo.gestures.basic.coffee | MIT | 7296aa6bc321370c1b92de005c9b55b9e1365596 | 2,055 | https://github.com/soyjavi/QuoJS/blob/7296aa6bc321370c1b92de005c9b55b9e1365596/source/quo.gestures.basic.coffee | 51 | 74 | ||
soyjavi/QuoJS:source/quo.gestures.basic.coffee:2:completion | completion | now = new Date()
if (now - _start.time) < DELAY.TAP
if (now - _last_tap) < DELAY.DOUBLE_TAP
base.trigger target, "doubleTap", data[0]
_last_tap = null
else
_last_tap = now
# base.trigger target, "tap", data[0]
base.trigger target, "touch", data[0]
... | _valid = false
clearTimeout _hold_timeout
_calculateDiff = (start, end) ->
diff =
x: end.x - start.x
y: end.y - start.y
start : start
move : move
end : end
cancel : cancel | CoffeeScript | CoffeeScript | soyjavi/QuoJS | source/quo.gestures.basic.coffee | MIT | 7296aa6bc321370c1b92de005c9b55b9e1365596 | 2,055 | https://github.com/soyjavi/QuoJS/blob/7296aa6bc321370c1b92de005c9b55b9e1365596/source/quo.gestures.basic.coffee | 51 | 74 |
soyjavi/QuoJS:source/quo.gestures.basic.coffee:1:raw_corpus | raw_corpus | ###
Quo Basic Gestures: tap, hold, singleTap, doubleTap
@namespace Quo.Gestures
@class Basic
@author Ignacio Olalde Ramos <ina@tapquo.com> || @piniphone
###
"use strict"
Quo.Gestures.add
name : "basic"
events : ["tap", "hold", "singleTap", "doubleTap", "touch"]
handler : do (base = Quo.Gestures) ->
G... | CoffeeScript | soyjavi/QuoJS | source/quo.gestures.basic.coffee | MIT | 1ae37dec9559e15872daa8be159849e329456005 | 2,055 | https://github.com/soyjavi/QuoJS/blob/1ae37dec9559e15872daa8be159849e329456005/source/quo.gestures.basic.coffee | 1 | 50 | ||
soyjavi/QuoJS:source/quo.gestures.basic.coffee:1:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
###
Quo Basic Gestures: tap, hold, singleTap, doubleTap
@namespace Quo.Gestures
@class Basic
@author Ignacio Olalde Ramos <ina@tapquo.com> || @piniphone
###
"use strict"
Quo.Gestures.add
name : "basic"
events : ["tap", "hold", "singleTap", "doubleTap"... | /*
Quo Basic Gestures: tap, hold, singleTap, doubleTap
@namespace Quo.Gestures
@class Basic
@author Ignacio Olalde Ramos <ina@tapquo.com> || @piniphone
*/
"use strict";
Quo.Gestures.add({
name: "basic",
events: ["tap", "hold", "singleTap", "doubleTap", "touch"],
handler: (function(base) {
var DELAY, GAP, _h... | CoffeeScript | JavaScript | soyjavi/QuoJS | source/quo.gestures.basic.coffee | MIT | 1ae37dec9559e15872daa8be159849e329456005 | 2,055 | https://github.com/soyjavi/QuoJS/blob/1ae37dec9559e15872daa8be159849e329456005/source/quo.gestures.basic.coffee | 1 | 50 |
soyjavi/QuoJS:source/quo.gestures.basic.coffee:1:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
/*
Quo Basic Gestures: tap, hold, singleTap, doubleTap
@namespace Quo.Gestures
@class Basic
@author Ignacio Olalde Ramos <ina@tapquo.com> || @piniphone
*/
"use strict";
Quo.Gestures.add({
name: "basic",
events: ["tap", "hold", "singleTap", "doubleTap", "touch... | ###
Quo Basic Gestures: tap, hold, singleTap, doubleTap
@namespace Quo.Gestures
@class Basic
@author Ignacio Olalde Ramos <ina@tapquo.com> || @piniphone
###
"use strict"
Quo.Gestures.add
name : "basic"
events : ["tap", "hold", "singleTap", "doubleTap", "touch"]
handler : do (base = Quo.Gestures) ->
G... | JavaScript | CoffeeScript | soyjavi/QuoJS | source/quo.gestures.basic.coffee | MIT | 1ae37dec9559e15872daa8be159849e329456005 | 2,055 | https://github.com/soyjavi/QuoJS/blob/1ae37dec9559e15872daa8be159849e329456005/source/quo.gestures.basic.coffee | 1 | 50 |
soyjavi/QuoJS:source/quo.gestures.basic.coffee:1:completion | completion | ###
Quo Basic Gestures: tap, hold, singleTap, doubleTap
@namespace Quo.Gestures
@class Basic
@author Ignacio Olalde Ramos <ina@tapquo.com> || @piniphone
###
"use strict"
Quo.Gestures.add
name : "basic"
events : ["tap", "hold", "singleTap", "doubleTap", "touch"]
handler : do (base = Quo.Gestures) ->
G... | _target = null
_start = null
_last_tap = null
start = (target, data) ->
if data.length is 1
_start = time: new Date(), x: data[0].x, y: data[0].y
_target = target
_hold_timeout = setTimeout ->
base.trigger(target, "hold", data[0])
, DELAY.HOLD
else do c... | CoffeeScript | CoffeeScript | soyjavi/QuoJS | source/quo.gestures.basic.coffee | MIT | 1ae37dec9559e15872daa8be159849e329456005 | 2,055 | https://github.com/soyjavi/QuoJS/blob/1ae37dec9559e15872daa8be159849e329456005/source/quo.gestures.basic.coffee | 1 | 50 |
soyjavi/QuoJS:source/quo.gestures.basic.coffee:2:raw_corpus | raw_corpus | if (now - _start.time) < DELAY.TAP
if (now - _last_tap) < DELAY.DOUBLE_TAP
clearTimeout _simpletap_timeout
base.trigger(target, "doubleTap", data[0])
_last_tap = null
else
_last_tap = now
base.trigger(target, "tap", data[0])
_simpletap_timeout ... | CoffeeScript | soyjavi/QuoJS | source/quo.gestures.basic.coffee | MIT | 1ae37dec9559e15872daa8be159849e329456005 | 2,055 | https://github.com/soyjavi/QuoJS/blob/1ae37dec9559e15872daa8be159849e329456005/source/quo.gestures.basic.coffee | 51 | 72 | ||
soyjavi/QuoJS:source/quo.gestures.basic.coffee:2:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
if (now - _start.time) < DELAY.TAP
if (now - _last_tap) < DELAY.DOUBLE_TAP
clearTimeout _simpletap_timeout
base.trigger(target, "doubleTap", data[0])
_last_tap = null
else
_last_tap = now
base.trig... | var _last_tap, _simpletap_timeout, cancel;
if ((now - _start.time) < DELAY.TAP) {
if ((now - _last_tap) < DELAY.DOUBLE_TAP) {
clearTimeout(_simpletap_timeout);
base.trigger(target, "doubleTap", data[0]);
_last_tap = null;
} else {
_last_tap = now;
base.trigger(target, "tap", data[0]);
_simp... | CoffeeScript | JavaScript | soyjavi/QuoJS | source/quo.gestures.basic.coffee | MIT | 1ae37dec9559e15872daa8be159849e329456005 | 2,055 | https://github.com/soyjavi/QuoJS/blob/1ae37dec9559e15872daa8be159849e329456005/source/quo.gestures.basic.coffee | 51 | 72 |
soyjavi/QuoJS:source/quo.gestures.basic.coffee:2:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
var _last_tap, _simpletap_timeout, cancel;
if ((now - _start.time) < DELAY.TAP) {
if ((now - _last_tap) < DELAY.DOUBLE_TAP) {
clearTimeout(_simpletap_timeout);
base.trigger(target, "doubleTap", data[0]);
_last_tap = null;
} else {
_last_tap = n... | if (now - _start.time) < DELAY.TAP
if (now - _last_tap) < DELAY.DOUBLE_TAP
clearTimeout _simpletap_timeout
base.trigger(target, "doubleTap", data[0])
_last_tap = null
else
_last_tap = now
base.trigger(target, "tap", data[0])
_simpletap_timeout ... | JavaScript | CoffeeScript | soyjavi/QuoJS | source/quo.gestures.basic.coffee | MIT | 1ae37dec9559e15872daa8be159849e329456005 | 2,055 | https://github.com/soyjavi/QuoJS/blob/1ae37dec9559e15872daa8be159849e329456005/source/quo.gestures.basic.coffee | 51 | 72 |
soyjavi/QuoJS:source/quo.gestures.basic.coffee:2:completion | completion | if (now - _start.time) < DELAY.TAP
if (now - _last_tap) < DELAY.DOUBLE_TAP
clearTimeout _simpletap_timeout
base.trigger(target, "doubleTap", data[0])
_last_tap = null
else
_last_tap = now
base.trigger(target, "tap", data[0])
_simpletap_timeout ... | cancel = () ->
_start = null
_valid = false
clearTimeout _hold_timeout
clearTimeout _simpletap_timeout
start : start
move : move
end : end
cancel : cancel | CoffeeScript | CoffeeScript | soyjavi/QuoJS | source/quo.gestures.basic.coffee | MIT | 1ae37dec9559e15872daa8be159849e329456005 | 2,055 | https://github.com/soyjavi/QuoJS/blob/1ae37dec9559e15872daa8be159849e329456005/source/quo.gestures.basic.coffee | 51 | 72 |
soyjavi/QuoJS:source/quo.gestures.basic.coffee:1:raw_corpus | raw_corpus | ###
Quo Basic Gestures: tap, hold, singleTap, doubleTap
@author Ignacio Olalde Ramos <ina@tapquo.com> || @piniphone
###
"use strict"
Quo.Gestures.add
name : "basic"
events : "tap,hold,singleTap,doubleTap,touch".split(",")
handler : do (gm = Quo.Gestures) ->
ALLOWED_MOVE_PIXELS = 15
TAP ... | CoffeeScript | soyjavi/QuoJS | source/quo.gestures.basic.coffee | MIT | 3e94097849c8265b1e1f85eded77562ec42e7672 | 2,055 | https://github.com/soyjavi/QuoJS/blob/3e94097849c8265b1e1f85eded77562ec42e7672/source/quo.gestures.basic.coffee | 1 | 50 | ||
soyjavi/QuoJS:source/quo.gestures.basic.coffee:1:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
###
Quo Basic Gestures: tap, hold, singleTap, doubleTap
@author Ignacio Olalde Ramos <ina@tapquo.com> || @piniphone
###
"use strict"
Quo.Gestures.add
name : "basic"
events : "tap,hold,singleTap,doubleTap,touch".split(",")
handler : do (gm = Quo.Gestu... | /*
Quo Basic Gestures: tap, hold, singleTap, doubleTap
@author Ignacio Olalde Ramos <ina@tapquo.com> || @piniphone
*/
"use strict";
Quo.Gestures.add({
name: "basic",
events: "tap,hold,singleTap,doubleTap,touch".split(","),
handler: (function(gm) {
var ALLOWED_MOVE_PIXELS, DOUBLE_TAP, HOLD, TAP, _hold_timeout... | CoffeeScript | JavaScript | soyjavi/QuoJS | source/quo.gestures.basic.coffee | MIT | 3e94097849c8265b1e1f85eded77562ec42e7672 | 2,055 | https://github.com/soyjavi/QuoJS/blob/3e94097849c8265b1e1f85eded77562ec42e7672/source/quo.gestures.basic.coffee | 1 | 50 |
soyjavi/QuoJS:source/quo.gestures.basic.coffee:1:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
/*
Quo Basic Gestures: tap, hold, singleTap, doubleTap
@author Ignacio Olalde Ramos <ina@tapquo.com> || @piniphone
*/
"use strict";
Quo.Gestures.add({
name: "basic",
events: "tap,hold,singleTap,doubleTap,touch".split(","),
handler: (function(gm) {
var AL... | ###
Quo Basic Gestures: tap, hold, singleTap, doubleTap
@author Ignacio Olalde Ramos <ina@tapquo.com> || @piniphone
###
"use strict"
Quo.Gestures.add
name : "basic"
events : "tap,hold,singleTap,doubleTap,touch".split(",")
handler : do (gm = Quo.Gestures) ->
ALLOWED_MOVE_PIXELS = 15
TAP ... | JavaScript | CoffeeScript | soyjavi/QuoJS | source/quo.gestures.basic.coffee | MIT | 3e94097849c8265b1e1f85eded77562ec42e7672 | 2,055 | https://github.com/soyjavi/QuoJS/blob/3e94097849c8265b1e1f85eded77562ec42e7672/source/quo.gestures.basic.coffee | 1 | 50 |
soyjavi/QuoJS:source/quo.gestures.basic.coffee:1:completion | completion | ###
Quo Basic Gestures: tap, hold, singleTap, doubleTap
@author Ignacio Olalde Ramos <ina@tapquo.com> || @piniphone
###
"use strict"
Quo.Gestures.add
name : "basic"
events : "tap,hold,singleTap,doubleTap,touch".split(",")
handler : do (gm = Quo.Gestures) ->
ALLOWED_MOVE_PIXELS = 15
TAP ... | start = (target, data) ->
if data.length is 1
_start = time: new Date(), x: data[0].x, y: data[0].y
_target = target
_hold_timeout = setTimeout ->
gm.trigger(target, "hold", data[0])
, HOLD
else do cancel
move = (target, data) ->
if _start isnt null
... | CoffeeScript | CoffeeScript | soyjavi/QuoJS | source/quo.gestures.basic.coffee | MIT | 3e94097849c8265b1e1f85eded77562ec42e7672 | 2,055 | https://github.com/soyjavi/QuoJS/blob/3e94097849c8265b1e1f85eded77562ec42e7672/source/quo.gestures.basic.coffee | 1 | 50 |
soyjavi/QuoJS:source/quo.gestures.basic.coffee:2:raw_corpus | raw_corpus | _last_tap = null
else
_last_tap = now
gm.trigger(target, "tap", data[0])
_simpletap_timeout = setTimeout ->
gm.trigger(target, "singleTap", data[0])
, DOUBLE_TAP + 5
cancel = () ->
_start = null
_valid = false
clearTimeout _hold_timeout
... | CoffeeScript | soyjavi/QuoJS | source/quo.gestures.basic.coffee | MIT | 3e94097849c8265b1e1f85eded77562ec42e7672 | 2,055 | https://github.com/soyjavi/QuoJS/blob/3e94097849c8265b1e1f85eded77562ec42e7672/source/quo.gestures.basic.coffee | 51 | 69 | ||
soyjavi/QuoJS:source/quo.gestures.basic.coffee:2:completion | completion | _last_tap = null
else
_last_tap = now
gm.trigger(target, "tap", data[0])
_simpletap_timeout = setTimeout ->
gm.trigger(target, "singleTap", data[0])
, DOUBLE_TAP + 5
cancel = () -> | _start = null
_valid = false
clearTimeout _hold_timeout
clearTimeout _simpletap_timeout
start : start
move : move
end : end
cancel : cancel | CoffeeScript | CoffeeScript | soyjavi/QuoJS | source/quo.gestures.basic.coffee | MIT | 3e94097849c8265b1e1f85eded77562ec42e7672 | 2,055 | https://github.com/soyjavi/QuoJS/blob/3e94097849c8265b1e1f85eded77562ec42e7672/source/quo.gestures.basic.coffee | 51 | 69 |
soyjavi/QuoJS:source/quo.gestures.basic.coffee:1:raw_corpus | raw_corpus | ###
Quo Basic Gestures: tap, hold, singleTap, doubleTap
@author Ignacio Olalde Ramos <ina@tapquo.com> || @piniphone
###
"use strict"
Quo.gesture.add
name : "basic"
events : "tap,hold,singleTap,doubleTap,touch".split(",")
handler : do (gm = Quo.gesture) ->
ALLOWED_MOVE_PIXELS = 15
TAP ... | CoffeeScript | soyjavi/QuoJS | source/quo.gestures.basic.coffee | MIT | ff24a23aa557eabf4db8c0adbe9712f8a960293d | 2,055 | https://github.com/soyjavi/QuoJS/blob/ff24a23aa557eabf4db8c0adbe9712f8a960293d/source/quo.gestures.basic.coffee | 1 | 50 | ||
soyjavi/QuoJS:source/quo.gestures.basic.coffee:1:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
###
Quo Basic Gestures: tap, hold, singleTap, doubleTap
@author Ignacio Olalde Ramos <ina@tapquo.com> || @piniphone
###
"use strict"
Quo.gesture.add
name : "basic"
events : "tap,hold,singleTap,doubleTap,touch".split(",")
handler : do (gm = Quo.gestur... | /*
Quo Basic Gestures: tap, hold, singleTap, doubleTap
@author Ignacio Olalde Ramos <ina@tapquo.com> || @piniphone
*/
"use strict";
Quo.gesture.add({
name: "basic",
events: "tap,hold,singleTap,doubleTap,touch".split(","),
handler: (function(gm) {
var ALLOWED_MOVE_PIXELS, DOUBLE_TAP, HOLD, TAP, _hold_timeout,... | CoffeeScript | JavaScript | soyjavi/QuoJS | source/quo.gestures.basic.coffee | MIT | ff24a23aa557eabf4db8c0adbe9712f8a960293d | 2,055 | https://github.com/soyjavi/QuoJS/blob/ff24a23aa557eabf4db8c0adbe9712f8a960293d/source/quo.gestures.basic.coffee | 1 | 50 |
soyjavi/QuoJS:source/quo.gestures.basic.coffee:1:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
/*
Quo Basic Gestures: tap, hold, singleTap, doubleTap
@author Ignacio Olalde Ramos <ina@tapquo.com> || @piniphone
*/
"use strict";
Quo.gesture.add({
name: "basic",
events: "tap,hold,singleTap,doubleTap,touch".split(","),
handler: (function(gm) {
var ALL... | ###
Quo Basic Gestures: tap, hold, singleTap, doubleTap
@author Ignacio Olalde Ramos <ina@tapquo.com> || @piniphone
###
"use strict"
Quo.gesture.add
name : "basic"
events : "tap,hold,singleTap,doubleTap,touch".split(",")
handler : do (gm = Quo.gesture) ->
ALLOWED_MOVE_PIXELS = 15
TAP ... | JavaScript | CoffeeScript | soyjavi/QuoJS | source/quo.gestures.basic.coffee | MIT | ff24a23aa557eabf4db8c0adbe9712f8a960293d | 2,055 | https://github.com/soyjavi/QuoJS/blob/ff24a23aa557eabf4db8c0adbe9712f8a960293d/source/quo.gestures.basic.coffee | 1 | 50 |
soyjavi/QuoJS:source/quo.gestures.basic.coffee:1:completion | completion | ###
Quo Basic Gestures: tap, hold, singleTap, doubleTap
@author Ignacio Olalde Ramos <ina@tapquo.com> || @piniphone
###
"use strict"
Quo.gesture.add
name : "basic"
events : "tap,hold,singleTap,doubleTap,touch".split(",")
handler : do (gm = Quo.gesture) ->
ALLOWED_MOVE_PIXELS = 15
TAP ... | start = (target, data) ->
if data.length is 1
_start = time: new Date(), x: data[0].x, y: data[0].y
_target = target
_hold_timeout = setTimeout ->
gm.trigger(target, "hold", data[0])
, HOLD
else do cancel
move = (target, data) ->
if _start isnt null
... | CoffeeScript | CoffeeScript | soyjavi/QuoJS | source/quo.gestures.basic.coffee | MIT | ff24a23aa557eabf4db8c0adbe9712f8a960293d | 2,055 | https://github.com/soyjavi/QuoJS/blob/ff24a23aa557eabf4db8c0adbe9712f8a960293d/source/quo.gestures.basic.coffee | 1 | 50 |
soyjavi/QuoJS:source/quo.gestures.basic.coffee:1:raw_corpus | raw_corpus | ###
Quo Basic Gestures: tap, hold, singleTap, doubleTap
@author Ignacio Olalde Ramos <ina@tapquo.com> || @piniphone
###
"use strict"
Quo.gesture.add
name : "basic"
events : ["tap", "hold", "singleTap", "doubleTap"]
handler : do (gm = Quo.gesture) ->
ALLOWED_MOVE_PIXELS = 15
TAP = 2... | CoffeeScript | soyjavi/QuoJS | source/quo.gestures.basic.coffee | MIT | c5b858856bd2fb3f2b9d54d724df6127ae364049 | 2,055 | https://github.com/soyjavi/QuoJS/blob/c5b858856bd2fb3f2b9d54d724df6127ae364049/source/quo.gestures.basic.coffee | 1 | 50 | ||
soyjavi/QuoJS:source/quo.gestures.basic.coffee:1:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
###
Quo Basic Gestures: tap, hold, singleTap, doubleTap
@author Ignacio Olalde Ramos <ina@tapquo.com> || @piniphone
###
"use strict"
Quo.gesture.add
name : "basic"
events : ["tap", "hold", "singleTap", "doubleTap"]
handler : do (gm = Quo.gesture) ->
... | /*
Quo Basic Gestures: tap, hold, singleTap, doubleTap
@author Ignacio Olalde Ramos <ina@tapquo.com> || @piniphone
*/
"use strict";
Quo.gesture.add({
name: "basic",
events: ["tap", "hold", "singleTap", "doubleTap"],
handler: (function(gm) {
var ALLOWED_MOVE_PIXELS, DOUBLE_TAP, HOLD, TAP, _hold_timeout, _last... | CoffeeScript | JavaScript | soyjavi/QuoJS | source/quo.gestures.basic.coffee | MIT | c5b858856bd2fb3f2b9d54d724df6127ae364049 | 2,055 | https://github.com/soyjavi/QuoJS/blob/c5b858856bd2fb3f2b9d54d724df6127ae364049/source/quo.gestures.basic.coffee | 1 | 50 |
soyjavi/QuoJS:source/quo.gestures.basic.coffee:1:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
/*
Quo Basic Gestures: tap, hold, singleTap, doubleTap
@author Ignacio Olalde Ramos <ina@tapquo.com> || @piniphone
*/
"use strict";
Quo.gesture.add({
name: "basic",
events: ["tap", "hold", "singleTap", "doubleTap"],
handler: (function(gm) {
var ALLOWED_M... | ###
Quo Basic Gestures: tap, hold, singleTap, doubleTap
@author Ignacio Olalde Ramos <ina@tapquo.com> || @piniphone
###
"use strict"
Quo.gesture.add
name : "basic"
events : ["tap", "hold", "singleTap", "doubleTap"]
handler : do (gm = Quo.gesture) ->
ALLOWED_MOVE_PIXELS = 15
TAP = 2... | JavaScript | CoffeeScript | soyjavi/QuoJS | source/quo.gestures.basic.coffee | MIT | c5b858856bd2fb3f2b9d54d724df6127ae364049 | 2,055 | https://github.com/soyjavi/QuoJS/blob/c5b858856bd2fb3f2b9d54d724df6127ae364049/source/quo.gestures.basic.coffee | 1 | 50 |
soyjavi/QuoJS:source/quo.gestures.basic.coffee:1:completion | completion | ###
Quo Basic Gestures: tap, hold, singleTap, doubleTap
@author Ignacio Olalde Ramos <ina@tapquo.com> || @piniphone
###
"use strict"
Quo.gesture.add
name : "basic"
events : ["tap", "hold", "singleTap", "doubleTap"]
handler : do (gm = Quo.gesture) ->
ALLOWED_MOVE_PIXELS = 15
TAP = 2... | start = (target, data) ->
if data.length is 1
_start = time: new Date(), x: data[0].x, y: data[0].y
_target = target
_hold_timeout = setTimeout ->
gm.trigger(target, "hold", data[0])
, HOLD
else do cancel
move = (target, data) ->
if _start isnt null
... | CoffeeScript | CoffeeScript | soyjavi/QuoJS | source/quo.gestures.basic.coffee | MIT | c5b858856bd2fb3f2b9d54d724df6127ae364049 | 2,055 | https://github.com/soyjavi/QuoJS/blob/c5b858856bd2fb3f2b9d54d724df6127ae364049/source/quo.gestures.basic.coffee | 1 | 50 |
soyjavi/QuoJS:source/quo.gestures.basic.coffee:2:raw_corpus | raw_corpus | else
_last_tap = now
gm.trigger(target, "tap", data[0])
_simpletap_timeout = setTimeout ->
gm.trigger(target, "singleTap", data[0])
, DOUBLE_TAP + 5
cancel = () ->
_start = null
_valid = false
clearTimeout _hold_timeout
clearTimeout _simpl... | CoffeeScript | soyjavi/QuoJS | source/quo.gestures.basic.coffee | MIT | c5b858856bd2fb3f2b9d54d724df6127ae364049 | 2,055 | https://github.com/soyjavi/QuoJS/blob/c5b858856bd2fb3f2b9d54d724df6127ae364049/source/quo.gestures.basic.coffee | 51 | 68 | ||
soyjavi/QuoJS:source/quo.gestures.basic.coffee:2:completion | completion | else
_last_tap = now
gm.trigger(target, "tap", data[0])
_simpletap_timeout = setTimeout ->
gm.trigger(target, "singleTap", data[0])
, DOUBLE_TAP + 5
cancel = () ->
_start = null | _valid = false
clearTimeout _hold_timeout
clearTimeout _simpletap_timeout
start : start
move : move
end : end
cancel : cancel | CoffeeScript | CoffeeScript | soyjavi/QuoJS | source/quo.gestures.basic.coffee | MIT | c5b858856bd2fb3f2b9d54d724df6127ae364049 | 2,055 | https://github.com/soyjavi/QuoJS/blob/c5b858856bd2fb3f2b9d54d724df6127ae364049/source/quo.gestures.basic.coffee | 51 | 68 |
jianliaoim/talk-os:talk-web/client/app/activity-section.coffee:1:raw_corpus | raw_corpus | React = require 'react'
moment = require 'moment'
{div, time} = React.DOM
module.exports = React.createClass
propTypes:
children: React.PropTypes.element.isRequired
display: React.PropTypes.string.isRequired
render: ->
div className: 'activity-section',
time className: 'timestamp', @props.disp... | CoffeeScript | jianliaoim/talk-os | talk-web/client/app/activity-section.coffee | MIT | 2545c4497865779a55762e03963a39237df9046b | 2,703 | https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-web/client/app/activity-section.coffee | 1 | 15 | ||
jianliaoim/talk-os:talk-web/client/app/activity-section.coffee:1:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
React = require 'react'
moment = require 'moment'
{div, time} = React.DOM
module.exports = React.createClass
propTypes:
children: React.PropTypes.element.isRequired
display: React.PropTypes.string.isRequired
render: ->
div className: 'activity... | var React, div, moment, time;
React = require('react');
moment = require('moment');
({div, time} = React.DOM);
module.exports = React.createClass({
propTypes: {
children: React.PropTypes.element.isRequired,
display: React.PropTypes.string.isRequired
},
render: function() {
return div({
class... | CoffeeScript | JavaScript | jianliaoim/talk-os | talk-web/client/app/activity-section.coffee | MIT | 2545c4497865779a55762e03963a39237df9046b | 2,703 | https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-web/client/app/activity-section.coffee | 1 | 15 |
jianliaoim/talk-os:talk-web/client/app/activity-section.coffee:1:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
var React, div, moment, time;
React = require('react');
moment = require('moment');
({div, time} = React.DOM);
module.exports = React.createClass({
propTypes: {
children: React.PropTypes.element.isRequired,
display: React.PropTypes.string.isRequired
... | React = require 'react'
moment = require 'moment'
{div, time} = React.DOM
module.exports = React.createClass
propTypes:
children: React.PropTypes.element.isRequired
display: React.PropTypes.string.isRequired
render: ->
div className: 'activity-section',
time className: 'timestamp', @props.disp... | JavaScript | CoffeeScript | jianliaoim/talk-os | talk-web/client/app/activity-section.coffee | MIT | 2545c4497865779a55762e03963a39237df9046b | 2,703 | https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-web/client/app/activity-section.coffee | 1 | 15 |
jianliaoim/talk-os:talk-web/client/app/activity-section.coffee:1:completion | completion | React = require 'react'
moment = require 'moment'
{div, time} = React.DOM
module.exports = React.createClass | propTypes:
children: React.PropTypes.element.isRequired
display: React.PropTypes.string.isRequired
render: ->
div className: 'activity-section',
time className: 'timestamp', @props.display
@props.children | CoffeeScript | CoffeeScript | jianliaoim/talk-os | talk-web/client/app/activity-section.coffee | MIT | 2545c4497865779a55762e03963a39237df9046b | 2,703 | https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-web/client/app/activity-section.coffee | 1 | 15 |
mauricemach/zappa:tests/sockets.coffee:1:raw_corpus | raw_corpus | zappa = require '../src/zappa'
port = 15700
# socket.io-client currently (2011-11-22) not working in node 0.6.x
# https://github.com/LearnBoost/socket.io-client/issues/336
@tests =
connects: (t) ->
t.expect 1
t.wait 3000
zapp = zappa port++, ->
@on connection: ->
t.reached 1
c = t.cl... | CoffeeScript | mauricemach/zappa | tests/sockets.coffee | MIT | 725e0103755c9a92fe84de06cee82db00e51a1f8 | 943 | https://github.com/mauricemach/zappa/blob/725e0103755c9a92fe84de06cee82db00e51a1f8/tests/sockets.coffee | 1 | 50 | ||
mauricemach/zappa:tests/sockets.coffee:1:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
zappa = require '../src/zappa'
port = 15700
# socket.io-client currently (2011-11-22) not working in node 0.6.x
# https://github.com/LearnBoost/socket.io-client/issues/336
@tests =
connects: (t) ->
t.expect 1
t.wait 3000
zapp = zappa port++, ->
... | var port, zappa;
zappa = require('../src/zappa');
port = 15700;
// socket.io-client currently (2011-11-22) not working in node 0.6.x
// https://github.com/LearnBoost/socket.io-client/issues/336
this.tests = {
connects: function(t) {
var c, zapp;
t.expect(1);
t.wait(3000);
zapp = zappa(port++, funct... | CoffeeScript | JavaScript | mauricemach/zappa | tests/sockets.coffee | MIT | 725e0103755c9a92fe84de06cee82db00e51a1f8 | 943 | https://github.com/mauricemach/zappa/blob/725e0103755c9a92fe84de06cee82db00e51a1f8/tests/sockets.coffee | 1 | 50 |
mauricemach/zappa:tests/sockets.coffee:1:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
var port, zappa;
zappa = require('../src/zappa');
port = 15700;
// socket.io-client currently (2011-11-22) not working in node 0.6.x
// https://github.com/LearnBoost/socket.io-client/issues/336
this.tests = {
connects: function(t) {
var c, zapp;
t.expe... | zappa = require '../src/zappa'
port = 15700
# socket.io-client currently (2011-11-22) not working in node 0.6.x
# https://github.com/LearnBoost/socket.io-client/issues/336
@tests =
connects: (t) ->
t.expect 1
t.wait 3000
zapp = zappa port++, ->
@on connection: ->
t.reached 1
c = t.cl... | JavaScript | CoffeeScript | mauricemach/zappa | tests/sockets.coffee | MIT | 725e0103755c9a92fe84de06cee82db00e51a1f8 | 943 | https://github.com/mauricemach/zappa/blob/725e0103755c9a92fe84de06cee82db00e51a1f8/tests/sockets.coffee | 1 | 50 |
mauricemach/zappa:tests/sockets.coffee:1:completion | completion | zappa = require '../src/zappa'
port = 15700
# socket.io-client currently (2011-11-22) not working in node 0.6.x
# https://github.com/LearnBoost/socket.io-client/issues/336
@tests =
connects: (t) ->
t.expect 1
t.wait 3000
zapp = zappa port++, ->
@on connection: ->
t.reached 1
c = t.cl... | c = t.client(zapp.app)
c.connect()
c.on 'welcome', ->
t.reached 1
'server broadcasts': (t) ->
t.expect 'reached1', 'reached2', 'data1', 'data2'
t.wait 3000
zapp = zappa port++, {t}, ->
@on shout: ->
@io.sockets.emit 'shout', @data
c = t.client(zapp.app)
c.connect()
... | CoffeeScript | CoffeeScript | mauricemach/zappa | tests/sockets.coffee | MIT | 725e0103755c9a92fe84de06cee82db00e51a1f8 | 943 | https://github.com/mauricemach/zappa/blob/725e0103755c9a92fe84de06cee82db00e51a1f8/tests/sockets.coffee | 1 | 50 |
mauricemach/zappa:tests/sockets.coffee:2:raw_corpus | raw_corpus | c2.on 'shout', (data) ->
t.reached 'reached2'
t.equal 'data2', data.foo, 'bar'
c.emit 'shout', foo: 'bar' | CoffeeScript | mauricemach/zappa | tests/sockets.coffee | MIT | 725e0103755c9a92fe84de06cee82db00e51a1f8 | 943 | https://github.com/mauricemach/zappa/blob/725e0103755c9a92fe84de06cee82db00e51a1f8/tests/sockets.coffee | 51 | 56 | ||
mauricemach/zappa:tests/sockets.coffee:2:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
c2.on 'shout', (data) ->
t.reached 'reached2'
t.equal 'data2', data.foo, 'bar'
c.emit 'shout', foo: 'bar'
``` | c2.on('shout', function(data) {
t.reached('reached2');
return t.equal('data2', data.foo, 'bar');
});
c.emit('shout', {
foo: 'bar'
}); | CoffeeScript | JavaScript | mauricemach/zappa | tests/sockets.coffee | MIT | 725e0103755c9a92fe84de06cee82db00e51a1f8 | 943 | https://github.com/mauricemach/zappa/blob/725e0103755c9a92fe84de06cee82db00e51a1f8/tests/sockets.coffee | 51 | 56 |
mauricemach/zappa:tests/sockets.coffee:2:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
c2.on('shout', function(data) {
t.reached('reached2');
return t.equal('data2', data.foo, 'bar');
});
c.emit('shout', {
foo: 'bar'
});
``` | c2.on 'shout', (data) ->
t.reached 'reached2'
t.equal 'data2', data.foo, 'bar'
c.emit 'shout', foo: 'bar' | JavaScript | CoffeeScript | mauricemach/zappa | tests/sockets.coffee | MIT | 725e0103755c9a92fe84de06cee82db00e51a1f8 | 943 | https://github.com/mauricemach/zappa/blob/725e0103755c9a92fe84de06cee82db00e51a1f8/tests/sockets.coffee | 51 | 56 |
mauricemach/zappa:tests/sockets.coffee:2:completion | completion | c2.on 'shout', (data) ->
t.reached 'reached2' | t.equal 'data2', data.foo, 'bar'
c.emit 'shout', foo: 'bar' | CoffeeScript | CoffeeScript | mauricemach/zappa | tests/sockets.coffee | MIT | 725e0103755c9a92fe84de06cee82db00e51a1f8 | 943 | https://github.com/mauricemach/zappa/blob/725e0103755c9a92fe84de06cee82db00e51a1f8/tests/sockets.coffee | 51 | 56 |
mauricemach/zappa:tests/sockets.coffee:1:raw_corpus | raw_corpus | zappa = require '../src/zappa'
port = 15700
@tests =
connects: (t) ->
t.expect 1
t.wait 3000
zapp = zappa port++, ->
@on connection: ->
t.reached 1
c = t.client(zapp.app)
c.connect()
'server emits': (t) ->
t.expect 1
t.wait 3000
zapp = zappa port++, ->
@on co... | CoffeeScript | mauricemach/zappa | tests/sockets.coffee | MIT | 2f373ce1622801e11822adff5138103887427b62 | 943 | https://github.com/mauricemach/zappa/blob/2f373ce1622801e11822adff5138103887427b62/tests/sockets.coffee | 1 | 50 | ||
mauricemach/zappa:tests/sockets.coffee:1:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
zappa = require '../src/zappa'
port = 15700
@tests =
connects: (t) ->
t.expect 1
t.wait 3000
zapp = zappa port++, ->
@on connection: ->
t.reached 1
c = t.client(zapp.app)
c.connect()
'server emits': (t) ->
t.expect 1
... | var port, zappa;
zappa = require('../src/zappa');
port = 15700;
this.tests = {
connects: function(t) {
var c, zapp;
t.expect(1);
t.wait(3000);
zapp = zappa(port++, function() {
return this.on({
connection: function() {
return t.reached(1);
}
});
});
c =... | CoffeeScript | JavaScript | mauricemach/zappa | tests/sockets.coffee | MIT | 2f373ce1622801e11822adff5138103887427b62 | 943 | https://github.com/mauricemach/zappa/blob/2f373ce1622801e11822adff5138103887427b62/tests/sockets.coffee | 1 | 50 |
mauricemach/zappa:tests/sockets.coffee:1:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
var port, zappa;
zappa = require('../src/zappa');
port = 15700;
this.tests = {
connects: function(t) {
var c, zapp;
t.expect(1);
t.wait(3000);
zapp = zappa(port++, function() {
return this.on({
connection: function() {
r... | zappa = require '../src/zappa'
port = 15700
@tests =
connects: (t) ->
t.expect 1
t.wait 3000
zapp = zappa port++, ->
@on connection: ->
t.reached 1
c = t.client(zapp.app)
c.connect()
'server emits': (t) ->
t.expect 1
t.wait 3000
zapp = zappa port++, ->
@on co... | JavaScript | CoffeeScript | mauricemach/zappa | tests/sockets.coffee | MIT | 2f373ce1622801e11822adff5138103887427b62 | 943 | https://github.com/mauricemach/zappa/blob/2f373ce1622801e11822adff5138103887427b62/tests/sockets.coffee | 1 | 50 |
mauricemach/zappa:tests/sockets.coffee:1:completion | completion | zappa = require '../src/zappa'
port = 15700
@tests =
connects: (t) ->
t.expect 1
t.wait 3000
zapp = zappa port++, ->
@on connection: ->
t.reached 1
c = t.client(zapp.app)
c.connect()
'server emits': (t) ->
t.expect 1
t.wait 3000
zapp = zappa port++, ->
@on co... | c.on 'welcome', ->
t.reached 1
'server broadcasts': (t) ->
t.expect 'reached1', 'reached2', 'data1', 'data2'
t.wait 3000
zapp = zappa port++, {t}, ->
@on shout: ->
@io.sockets.emit 'shout', @data
c = t.client(zapp.app)
c.connect()
c2 = t.client(zapp.app)
c2.connect()... | CoffeeScript | CoffeeScript | mauricemach/zappa | tests/sockets.coffee | MIT | 2f373ce1622801e11822adff5138103887427b62 | 943 | https://github.com/mauricemach/zappa/blob/2f373ce1622801e11822adff5138103887427b62/tests/sockets.coffee | 1 | 50 |
mauricemach/zappa:tests/sockets.coffee:1:raw_corpus | raw_corpus | zappa = require '../src/zappa'
port = 15700
@tests =
connects: (t) ->
t.expect 1
t.wait 3000
zapp = zappa port++, ->
@on connection: ->
t.reached 1
c = t.client(zapp.app)
c.connect()
'server emits': (t) ->
t.expect 1
t.wait 3000
zapp = zappa port++, ->
@on co... | CoffeeScript | mauricemach/zappa | tests/sockets.coffee | MIT | 6a316ab7682d513fca53c7a07686b15e1c0157f2 | 943 | https://github.com/mauricemach/zappa/blob/6a316ab7682d513fca53c7a07686b15e1c0157f2/tests/sockets.coffee | 1 | 50 | ||
mauricemach/zappa:tests/sockets.coffee:1:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
zappa = require '../src/zappa'
port = 15700
@tests =
connects: (t) ->
t.expect 1
t.wait 3000
zapp = zappa port++, ->
@on connection: ->
t.reached 1
c = t.client(zapp.app)
c.connect()
'server emits': (t) ->
t.expect 1
... | var port, zappa;
zappa = require('../src/zappa');
port = 15700;
this.tests = {
connects: function(t) {
var c, zapp;
t.expect(1);
t.wait(3000);
zapp = zappa(port++, function() {
return this.on({
connection: function() {
return t.reached(1);
}
});
});
c =... | CoffeeScript | JavaScript | mauricemach/zappa | tests/sockets.coffee | MIT | 6a316ab7682d513fca53c7a07686b15e1c0157f2 | 943 | https://github.com/mauricemach/zappa/blob/6a316ab7682d513fca53c7a07686b15e1c0157f2/tests/sockets.coffee | 1 | 50 |
mauricemach/zappa:tests/sockets.coffee:1:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
var port, zappa;
zappa = require('../src/zappa');
port = 15700;
this.tests = {
connects: function(t) {
var c, zapp;
t.expect(1);
t.wait(3000);
zapp = zappa(port++, function() {
return this.on({
connection: function() {
r... | zappa = require '../src/zappa'
port = 15700
@tests =
connects: (t) ->
t.expect 1
t.wait 3000
zapp = zappa port++, ->
@on connection: ->
t.reached 1
c = t.client(zapp.app)
c.connect()
'server emits': (t) ->
t.expect 1
t.wait 3000
zapp = zappa port++, ->
@on co... | JavaScript | CoffeeScript | mauricemach/zappa | tests/sockets.coffee | MIT | 6a316ab7682d513fca53c7a07686b15e1c0157f2 | 943 | https://github.com/mauricemach/zappa/blob/6a316ab7682d513fca53c7a07686b15e1c0157f2/tests/sockets.coffee | 1 | 50 |
mauricemach/zappa:tests/sockets.coffee:1:completion | completion | zappa = require '../src/zappa'
port = 15700
@tests =
connects: (t) ->
t.expect 1
t.wait 3000
zapp = zappa port++, ->
@on connection: ->
t.reached 1
c = t.client(zapp.app)
c.connect()
'server emits': (t) ->
t.expect 1
t.wait 3000
zapp = zappa port++, ->
@on co... | c.on 'welcome', ->
t.reached 1
'server broadcasts': (t) ->
t.expect 'reached1', 'reached2', 'data1', 'data2'
t.wait 3000
zapp = zappa port++, {t}, ->
@on shout: ->
@io.sockets.emit 'shout', {@foo}
c = t.client(zapp.app)
c.connect()
c2 = t.client(zapp.app)
c2.connect(... | CoffeeScript | CoffeeScript | mauricemach/zappa | tests/sockets.coffee | MIT | 6a316ab7682d513fca53c7a07686b15e1c0157f2 | 943 | https://github.com/mauricemach/zappa/blob/6a316ab7682d513fca53c7a07686b15e1c0157f2/tests/sockets.coffee | 1 | 50 |
mauricemach/zappa:tests/sockets.coffee:1:raw_corpus | raw_corpus | zappa = require '../src/zappa'
port = 15700
@tests =
connects: (t) ->
t.expect 1
t.wait 3000
zapp = zappa port++, ->
@on connection: ->
t.reached 1
c = t.client(zapp.app)
c.connect()
'server emits': (t) ->
t.expect 1
t.wait 3000
zapp = zappa port++, ->
@on co... | CoffeeScript | mauricemach/zappa | tests/sockets.coffee | MIT | a62a122802b516d4195b60a741cef044d2ef59bb | 943 | https://github.com/mauricemach/zappa/blob/a62a122802b516d4195b60a741cef044d2ef59bb/tests/sockets.coffee | 1 | 50 | ||
mauricemach/zappa:tests/sockets.coffee:1:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
zappa = require '../src/zappa'
port = 15700
@tests =
connects: (t) ->
t.expect 1
t.wait 3000
zapp = zappa port++, ->
@on connection: ->
t.reached 1
c = t.client(zapp.app)
c.connect()
'server emits': (t) ->
t.expect 1
... | var port, zappa;
zappa = require('../src/zappa');
port = 15700;
this.tests = {
connects: function(t) {
var c, zapp;
t.expect(1);
t.wait(3000);
zapp = zappa(port++, function() {
return this.on({
connection: function() {
return t.reached(1);
}
});
});
c =... | CoffeeScript | JavaScript | mauricemach/zappa | tests/sockets.coffee | MIT | a62a122802b516d4195b60a741cef044d2ef59bb | 943 | https://github.com/mauricemach/zappa/blob/a62a122802b516d4195b60a741cef044d2ef59bb/tests/sockets.coffee | 1 | 50 |
mauricemach/zappa:tests/sockets.coffee:1:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
var port, zappa;
zappa = require('../src/zappa');
port = 15700;
this.tests = {
connects: function(t) {
var c, zapp;
t.expect(1);
t.wait(3000);
zapp = zappa(port++, function() {
return this.on({
connection: function() {
r... | zappa = require '../src/zappa'
port = 15700
@tests =
connects: (t) ->
t.expect 1
t.wait 3000
zapp = zappa port++, ->
@on connection: ->
t.reached 1
c = t.client(zapp.app)
c.connect()
'server emits': (t) ->
t.expect 1
t.wait 3000
zapp = zappa port++, ->
@on co... | JavaScript | CoffeeScript | mauricemach/zappa | tests/sockets.coffee | MIT | a62a122802b516d4195b60a741cef044d2ef59bb | 943 | https://github.com/mauricemach/zappa/blob/a62a122802b516d4195b60a741cef044d2ef59bb/tests/sockets.coffee | 1 | 50 |
mauricemach/zappa:tests/sockets.coffee:1:completion | completion | zappa = require '../src/zappa'
port = 15700
@tests =
connects: (t) ->
t.expect 1
t.wait 3000
zapp = zappa port++, ->
@on connection: ->
t.reached 1
c = t.client(zapp.app)
c.connect()
'server emits': (t) ->
t.expect 1
t.wait 3000
zapp = zappa port++, ->
@on co... | c.on 'welcome', ->
t.reached 1
'server broadcasts': (t) ->
t.expect 'reached1', 'reached2', 'data1', 'data2'
t.wait 3000
zapp = zappa port++, {t}, ->
@on shout: ->
@io.sockets.emit 'shout', {foo: @data.foo}
c = t.client(zapp.app)
c.connect()
c2 = t.client(zapp.app)
c... | CoffeeScript | CoffeeScript | mauricemach/zappa | tests/sockets.coffee | MIT | a62a122802b516d4195b60a741cef044d2ef59bb | 943 | https://github.com/mauricemach/zappa/blob/a62a122802b516d4195b60a741cef044d2ef59bb/tests/sockets.coffee | 1 | 50 |
mauricemach/zappa:tests/sockets.coffee:1:raw_corpus | raw_corpus | zappa = require '../src/zappa'
port = 15700
@tests =
connects: (t) ->
t.expect 1
t.wait 3000
zapp = zappa port++, {t}, ->
at connection: ->
t.reached 1
c = t.client(zapp.app)
c.connect()
'server emits': (t) ->
t.expect 1
t.wait 3000
zapp = zappa port++, ->
at... | CoffeeScript | mauricemach/zappa | tests/sockets.coffee | MIT | e678a4fc9acd5ad7a595a580ab84efe03677ee1d | 943 | https://github.com/mauricemach/zappa/blob/e678a4fc9acd5ad7a595a580ab84efe03677ee1d/tests/sockets.coffee | 1 | 50 | ||
mauricemach/zappa:tests/sockets.coffee:1:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
zappa = require '../src/zappa'
port = 15700
@tests =
connects: (t) ->
t.expect 1
t.wait 3000
zapp = zappa port++, {t}, ->
at connection: ->
t.reached 1
c = t.client(zapp.app)
c.connect()
'server emits': (t) ->
t.expec... | var port, zappa;
zappa = require('../src/zappa');
port = 15700;
this.tests = {
connects: function(t) {
var c, zapp;
t.expect(1);
t.wait(3000);
zapp = zappa(port++, {t}, function() {
return at({
connection: function() {
return t.reached(1);
}
});
});
c =... | CoffeeScript | JavaScript | mauricemach/zappa | tests/sockets.coffee | MIT | e678a4fc9acd5ad7a595a580ab84efe03677ee1d | 943 | https://github.com/mauricemach/zappa/blob/e678a4fc9acd5ad7a595a580ab84efe03677ee1d/tests/sockets.coffee | 1 | 50 |
mauricemach/zappa:tests/sockets.coffee:1:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
var port, zappa;
zappa = require('../src/zappa');
port = 15700;
this.tests = {
connects: function(t) {
var c, zapp;
t.expect(1);
t.wait(3000);
zapp = zappa(port++, {t}, function() {
return at({
connection: function() {
r... | zappa = require '../src/zappa'
port = 15700
@tests =
connects: (t) ->
t.expect 1
t.wait 3000
zapp = zappa port++, {t}, ->
at connection: ->
t.reached 1
c = t.client(zapp.app)
c.connect()
'server emits': (t) ->
t.expect 1
t.wait 3000
zapp = zappa port++, ->
at... | JavaScript | CoffeeScript | mauricemach/zappa | tests/sockets.coffee | MIT | e678a4fc9acd5ad7a595a580ab84efe03677ee1d | 943 | https://github.com/mauricemach/zappa/blob/e678a4fc9acd5ad7a595a580ab84efe03677ee1d/tests/sockets.coffee | 1 | 50 |
mauricemach/zappa:tests/sockets.coffee:1:completion | completion | zappa = require '../src/zappa'
port = 15700
@tests =
connects: (t) ->
t.expect 1
t.wait 3000
zapp = zappa port++, {t}, ->
at connection: ->
t.reached 1
c = t.client(zapp.app)
c.connect()
'server emits': (t) ->
t.expect 1
t.wait 3000
zapp = zappa port++, ->
at... | c.on 'welcome', ->
t.reached 1
'server broadcasts': (t) ->
t.expect 'reached1', 'reached2', 'data1', 'data2'
t.wait 3000
zapp = zappa port++, {t}, ->
at shout: ->
io.sockets.emit 'shout', {@foo}
c = t.client(zapp.app)
c.connect()
c2 = t.client(zapp.app)
c2.connect()
... | CoffeeScript | CoffeeScript | mauricemach/zappa | tests/sockets.coffee | MIT | e678a4fc9acd5ad7a595a580ab84efe03677ee1d | 943 | https://github.com/mauricemach/zappa/blob/e678a4fc9acd5ad7a595a580ab84efe03677ee1d/tests/sockets.coffee | 1 | 50 |
yakyak/yakyak:src/ui/models/menuhandler.coffee:1:raw_corpus | raw_corpus | { Menu } = require('electron')
menuaction = (mainWindow, it) ->
params = (it.action.params ? []).map (p) ->
if p is ':checked'
it.checked
else if p is ':value'
it.value
else
p
mainWindow.webContents.send 'menuaction', it.action.name, params
processM... | CoffeeScript | yakyak/yakyak | src/ui/models/menuhandler.coffee | MIT | 8f8cbc081c66ca00b5e9520a9bef5f2bc1d64dfd | 3,762 | https://github.com/yakyak/yakyak/blob/8f8cbc081c66ca00b5e9520a9bef5f2bc1d64dfd/src/ui/models/menuhandler.coffee | 1 | 29 | ||
yakyak/yakyak:src/ui/models/menuhandler.coffee:1:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
{ Menu } = require('electron')
menuaction = (mainWindow, it) ->
params = (it.action.params ? []).map (p) ->
if p is ':checked'
it.checked
else if p is ':value'
it.value
else
p
mainWindow.webCon... | var Menu, menuaction, processMenu;
({Menu} = require('electron'));
menuaction = function(mainWindow, it) {
var params, ref;
params = ((ref = it.action.params) != null ? ref : []).map(function(p) {
if (p === ':checked') {
return it.checked;
} else if (p === ':value') {
return it.value;
} el... | CoffeeScript | JavaScript | yakyak/yakyak | src/ui/models/menuhandler.coffee | MIT | 8f8cbc081c66ca00b5e9520a9bef5f2bc1d64dfd | 3,762 | https://github.com/yakyak/yakyak/blob/8f8cbc081c66ca00b5e9520a9bef5f2bc1d64dfd/src/ui/models/menuhandler.coffee | 1 | 29 |
yakyak/yakyak:src/ui/models/menuhandler.coffee:1:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
var Menu, menuaction, processMenu;
({Menu} = require('electron'));
menuaction = function(mainWindow, it) {
var params, ref;
params = ((ref = it.action.params) != null ? ref : []).map(function(p) {
if (p === ':checked') {
return it.checked;
} els... | { Menu } = require('electron')
menuaction = (mainWindow, it) ->
params = (it.action.params ? []).map (p) ->
if p is ':checked'
it.checked
else if p is ':value'
it.value
else
p
mainWindow.webContents.send 'menuaction', it.action.name, params
processM... | JavaScript | CoffeeScript | yakyak/yakyak | src/ui/models/menuhandler.coffee | MIT | 8f8cbc081c66ca00b5e9520a9bef5f2bc1d64dfd | 3,762 | https://github.com/yakyak/yakyak/blob/8f8cbc081c66ca00b5e9520a9bef5f2bc1d64dfd/src/ui/models/menuhandler.coffee | 1 | 29 |
yakyak/yakyak:src/ui/models/menuhandler.coffee:1:completion | completion | { Menu } = require('electron')
menuaction = (mainWindow, it) ->
params = (it.action.params ? []).map (p) ->
if p is ':checked'
it.checked
else if p is ':value'
it.value
else
p
mainWindow.webContents.send 'menuaction', it.action.name, params
processM... | (template ? []).forEach (e) ->
if e.submenu?
processMenu mainWindow, e.submenu
return
if not e.action?
return
e.click = (it) ->
menuaction mainWindow, it
module.exports = (mainWindow, template) ->
processMenu mainWindow, template
Menu.b... | CoffeeScript | CoffeeScript | yakyak/yakyak | src/ui/models/menuhandler.coffee | MIT | 8f8cbc081c66ca00b5e9520a9bef5f2bc1d64dfd | 3,762 | https://github.com/yakyak/yakyak/blob/8f8cbc081c66ca00b5e9520a9bef5f2bc1d64dfd/src/ui/models/menuhandler.coffee | 1 | 29 |
yakyak/yakyak:src/ui/models/menuhandler.coffee:1:raw_corpus | raw_corpus | { Menu } = require('electron')
menuaction = (mainWindow, it) ->
if it.action.params?
params = it.action.params.map (p) ->
if p is ':checked'
it.checked
if p is ':value'
it.value
else
p
console.error('menuaction', i... | CoffeeScript | yakyak/yakyak | src/ui/models/menuhandler.coffee | MIT | 37e3ee633141c7b757f09585c084f73da7b6ec3b | 3,762 | https://github.com/yakyak/yakyak/blob/37e3ee633141c7b757f09585c084f73da7b6ec3b/src/ui/models/menuhandler.coffee | 1 | 35 | ||
yakyak/yakyak:src/ui/models/menuhandler.coffee:1:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
{ Menu } = require('electron')
menuaction = (mainWindow, it) ->
if it.action.params?
params = it.action.params.map (p) ->
if p is ':checked'
it.checked
if p is ':value'
it.value
else... | var Menu, menuaction, processMenu;
({Menu} = require('electron'));
menuaction = function(mainWindow, it) {
var params;
if (it.action.params != null) {
params = it.action.params.map(function(p) {
if (p === ':checked') {
it.checked;
}
if (p === ':value') {
return it.value;
... | CoffeeScript | JavaScript | yakyak/yakyak | src/ui/models/menuhandler.coffee | MIT | 37e3ee633141c7b757f09585c084f73da7b6ec3b | 3,762 | https://github.com/yakyak/yakyak/blob/37e3ee633141c7b757f09585c084f73da7b6ec3b/src/ui/models/menuhandler.coffee | 1 | 35 |
yakyak/yakyak:src/ui/models/menuhandler.coffee:1:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
var Menu, menuaction, processMenu;
({Menu} = require('electron'));
menuaction = function(mainWindow, it) {
var params;
if (it.action.params != null) {
params = it.action.params.map(function(p) {
if (p === ':checked') {
it.checked;
}
... | { Menu } = require('electron')
menuaction = (mainWindow, it) ->
if it.action.params?
params = it.action.params.map (p) ->
if p is ':checked'
it.checked
if p is ':value'
it.value
else
p
console.error('menuaction', i... | JavaScript | CoffeeScript | yakyak/yakyak | src/ui/models/menuhandler.coffee | MIT | 37e3ee633141c7b757f09585c084f73da7b6ec3b | 3,762 | https://github.com/yakyak/yakyak/blob/37e3ee633141c7b757f09585c084f73da7b6ec3b/src/ui/models/menuhandler.coffee | 1 | 35 |
yakyak/yakyak:src/ui/models/menuhandler.coffee:1:completion | completion | { Menu } = require('electron')
menuaction = (mainWindow, it) ->
if it.action.params?
params = it.action.params.map (p) ->
if p is ':checked'
it.checked
if p is ':value'
it.value
else
p
console.error('menuaction', i... | mainWindow.webContents.send 'menuaction', it.action.name
processMenu = (mainWindow, template) =>
(template ? []).forEach (e) ->
if e.submenu?
processMenu mainWindow, e.submenu
return
if not e.action?
return
e.click = (it) ->
menuaction mainW... | CoffeeScript | CoffeeScript | yakyak/yakyak | src/ui/models/menuhandler.coffee | MIT | 37e3ee633141c7b757f09585c084f73da7b6ec3b | 3,762 | https://github.com/yakyak/yakyak/blob/37e3ee633141c7b757f09585c084f73da7b6ec3b/src/ui/models/menuhandler.coffee | 1 | 35 |
yakyak/yakyak:src/ui/models/menuhandler.coffee:1:raw_corpus | raw_corpus | { Menu } = require('electron')
menuaction = (mainWindow, it) ->
if it.action.params?
params = it.action.params.map (p) ->
if p is ':checked'
it.checked
if p is ':value'
it.value
else
p
console.error('menuaction', i... | CoffeeScript | yakyak/yakyak | src/ui/models/menuhandler.coffee | MIT | 8292038b149cf25da2c85c9e263a8a773848d3cc | 3,762 | https://github.com/yakyak/yakyak/blob/8292038b149cf25da2c85c9e263a8a773848d3cc/src/ui/models/menuhandler.coffee | 1 | 34 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.