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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
yakyak/yakyak:src/ui/util.coffee:4:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
drawAvatar = (user_id, viewstate, entity, image = null, email = null, initials = null) ->
#
entity.needEntity(user_id) unless entity[user_id]?
#
# overwrites if entity is cached
initials = initialsof entity[user_id] if entity[user_id]?
ema... | var drawAvatar;
drawAvatar = function(user_id, viewstate, entity, image = null, email = null, initials = null) {
var ref, ref1, ref2, ref3, ref4, ref5;
if (entity[user_id] == null) {
entity.needEntity(user_id);
}
if (entity[user_id] != null) {
// overwrites if entity is cached
initials = initials... | CoffeeScript | JavaScript | yakyak/yakyak | src/ui/util.coffee | MIT | dc332442781b05911398f751dcae340436cee619 | 3,762 | https://github.com/yakyak/yakyak/blob/dc332442781b05911398f751dcae340436cee619/src/ui/util.coffee | 35 | 58 |
yakyak/yakyak:src/ui/util.coffee:4:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
var drawAvatar;
drawAvatar = function(user_id, viewstate, entity, image = null, email = null, initials = null) {
var ref, ref1, ref2, ref3, ref4, ref5;
if (entity[user_id] == null) {
entity.needEntity(user_id);
}
if (entity[user_id] != null) {
//... | drawAvatar = (user_id, viewstate, entity, image = null, email = null, initials = null) ->
#
entity.needEntity(user_id) unless entity[user_id]?
#
# overwrites if entity is cached
initials = initialsof entity[user_id] if entity[user_id]?
email = entity[user_id]?.email?[0] unless entity[user_id]... | JavaScript | CoffeeScript | yakyak/yakyak | src/ui/util.coffee | MIT | dc332442781b05911398f751dcae340436cee619 | 3,762 | https://github.com/yakyak/yakyak/blob/dc332442781b05911398f751dcae340436cee619/src/ui/util.coffee | 35 | 58 |
yakyak/yakyak:src/ui/util.coffee:4:completion | completion | drawAvatar = (user_id, viewstate, entity, image = null, email = null, initials = null) ->
#
entity.needEntity(user_id) unless entity[user_id]?
#
# overwrites if entity is cached
initials = initialsof entity[user_id] if entity[user_id]?
email = entity[user_id]?.email?[0] unless entity[user_id]... | image += "?sz=50"
#
img src:fixlink(image), "data-initials": initials
, title: email
, onerror: (ev) ->
# in case the image is not available, it
# fallbacks to initials
ev.target.parentElement.classList.add "fallback-on"
... | CoffeeScript | CoffeeScript | yakyak/yakyak | src/ui/util.coffee | MIT | dc332442781b05911398f751dcae340436cee619 | 3,762 | https://github.com/yakyak/yakyak/blob/dc332442781b05911398f751dcae340436cee619/src/ui/util.coffee | 35 | 58 |
yakyak/yakyak:src/ui/util.coffee:3:raw_corpus | raw_corpus | initialsof = (e) ->
if e?.first_name
name = nameof e
firstname = e?.first_name
return firstname.charAt(0) + name.replace(firstname, "").charAt(1)
else
return '?' | CoffeeScript | yakyak/yakyak | src/ui/util.coffee | MIT | 052b1d260ff0f09504564b466203b2e19baf4073 | 3,762 | https://github.com/yakyak/yakyak/blob/052b1d260ff0f09504564b466203b2e19baf4073/src/ui/util.coffee | 16 | 22 | ||
yakyak/yakyak:src/ui/util.coffee:3:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
initialsof = (e) ->
if e?.first_name
name = nameof e
firstname = e?.first_name
return firstname.charAt(0) + name.replace(firstname, "").charAt(1)
else
return '?'
``` | var initialsof;
initialsof = function(e) {
var firstname, name;
if (e != null ? e.first_name : void 0) {
name = nameof(e);
firstname = e != null ? e.first_name : void 0;
return firstname.charAt(0) + name.replace(firstname, "").charAt(1);
} else {
return '?';
}
}; | CoffeeScript | JavaScript | yakyak/yakyak | src/ui/util.coffee | MIT | 052b1d260ff0f09504564b466203b2e19baf4073 | 3,762 | https://github.com/yakyak/yakyak/blob/052b1d260ff0f09504564b466203b2e19baf4073/src/ui/util.coffee | 16 | 22 |
yakyak/yakyak:src/ui/util.coffee:3:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
var initialsof;
initialsof = function(e) {
var firstname, name;
if (e != null ? e.first_name : void 0) {
name = nameof(e);
firstname = e != null ? e.first_name : void 0;
return firstname.charAt(0) + name.replace(firstname, "").charAt(1);
} else {... | initialsof = (e) ->
if e?.first_name
name = nameof e
firstname = e?.first_name
return firstname.charAt(0) + name.replace(firstname, "").charAt(1)
else
return '?' | JavaScript | CoffeeScript | yakyak/yakyak | src/ui/util.coffee | MIT | 052b1d260ff0f09504564b466203b2e19baf4073 | 3,762 | https://github.com/yakyak/yakyak/blob/052b1d260ff0f09504564b466203b2e19baf4073/src/ui/util.coffee | 16 | 22 |
yakyak/yakyak:src/ui/util.coffee:3:completion | completion | initialsof = (e) ->
if e?.first_name
name = nameof e | firstname = e?.first_name
return firstname.charAt(0) + name.replace(firstname, "").charAt(1)
else
return '?' | CoffeeScript | CoffeeScript | yakyak/yakyak | src/ui/util.coffee | MIT | 052b1d260ff0f09504564b466203b2e19baf4073 | 3,762 | https://github.com/yakyak/yakyak/blob/052b1d260ff0f09504564b466203b2e19baf4073/src/ui/util.coffee | 16 | 22 |
yakyak/yakyak:src/ui/util.coffee:4:raw_corpus | raw_corpus | drawAvatar = (user_id, viewstate, entity, image = null, email = null, initials = null) ->
#
entity.needEntity(user_id) unless entity[user_id]?
#
initials = initialsof entity[user_id] unless initials
email = entity[user_id]?.email?[0] unless email?
#
div class: 'avatar', 'data-id': user_id, -... | CoffeeScript | yakyak/yakyak | src/ui/util.coffee | MIT | 052b1d260ff0f09504564b466203b2e19baf4073 | 3,762 | https://github.com/yakyak/yakyak/blob/052b1d260ff0f09504564b466203b2e19baf4073/src/ui/util.coffee | 24 | 48 | ||
yakyak/yakyak:src/ui/util.coffee:4:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
drawAvatar = (user_id, viewstate, entity, image = null, email = null, initials = null) ->
#
entity.needEntity(user_id) unless entity[user_id]?
#
initials = initialsof entity[user_id] unless initials
email = entity[user_id]?.email?[0] unless em... | var drawAvatar;
drawAvatar = function(user_id, viewstate, entity, image = null, email = null, initials = null) {
var ref, ref1;
if (entity[user_id] == null) {
entity.needEntity(user_id);
}
if (!initials) {
initials = initialsof(entity[user_id]);
}
if (email == null) {
email = (ref = entity[us... | CoffeeScript | JavaScript | yakyak/yakyak | src/ui/util.coffee | MIT | 052b1d260ff0f09504564b466203b2e19baf4073 | 3,762 | https://github.com/yakyak/yakyak/blob/052b1d260ff0f09504564b466203b2e19baf4073/src/ui/util.coffee | 24 | 48 |
yakyak/yakyak:src/ui/util.coffee:4:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
var drawAvatar;
drawAvatar = function(user_id, viewstate, entity, image = null, email = null, initials = null) {
var ref, ref1;
if (entity[user_id] == null) {
entity.needEntity(user_id);
}
if (!initials) {
initials = initialsof(entity[user_id]);
... | drawAvatar = (user_id, viewstate, entity, image = null, email = null, initials = null) ->
#
entity.needEntity(user_id) unless entity[user_id]?
#
initials = initialsof entity[user_id] unless initials
email = entity[user_id]?.email?[0] unless email?
#
div class: 'avatar', 'data-id': user_id, -... | JavaScript | CoffeeScript | yakyak/yakyak | src/ui/util.coffee | MIT | 052b1d260ff0f09504564b466203b2e19baf4073 | 3,762 | https://github.com/yakyak/yakyak/blob/052b1d260ff0f09504564b466203b2e19baf4073/src/ui/util.coffee | 24 | 48 |
yakyak/yakyak:src/ui/util.coffee:4:completion | completion | drawAvatar = (user_id, viewstate, entity, image = null, email = null, initials = null) ->
#
entity.needEntity(user_id) unless entity[user_id]?
#
initials = initialsof entity[user_id] unless initials
email = entity[user_id]?.email?[0] unless email?
#
div class: 'avatar', 'data-id': user_id, -... | #
img src:fixlink(image), "data-initials": initials
, title: email
, onerror: (ev) ->
# in case the image is not available, it
# fallbacks to initials
ev.target.parentElement.classList.add "fallback-on"
, onload: (ev) ->
... | CoffeeScript | CoffeeScript | yakyak/yakyak | src/ui/util.coffee | MIT | 052b1d260ff0f09504564b466203b2e19baf4073 | 3,762 | https://github.com/yakyak/yakyak/blob/052b1d260ff0f09504564b466203b2e19baf4073/src/ui/util.coffee | 24 | 48 |
yakyak/yakyak:src/ui/util.coffee:4:raw_corpus | raw_corpus | drawAvatar = (user_id, viewstate, entity) ->
initials = initialsof entity[user_id]
div class: 'avatar', 'data-id': user_id, ->
image = entity[user_id]?.photo_url
if image
if !viewstate?.showAnimatedThumbs
image += "?sz=50"
#
img src:fixlink(ima... | CoffeeScript | yakyak/yakyak | src/ui/util.coffee | MIT | 7436d1cb9c8be24ecc705c776af2e07bf527148e | 3,762 | https://github.com/yakyak/yakyak/blob/7436d1cb9c8be24ecc705c776af2e07bf527148e/src/ui/util.coffee | 24 | 42 | ||
yakyak/yakyak:src/ui/util.coffee:4:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
drawAvatar = (user_id, viewstate, entity) ->
initials = initialsof entity[user_id]
div class: 'avatar', 'data-id': user_id, ->
image = entity[user_id]?.photo_url
if image
if !viewstate?.showAnimatedThumbs
image ... | var drawAvatar;
drawAvatar = function(user_id, viewstate, entity) {
var initials;
initials = initialsof(entity[user_id]);
return div({
class: 'avatar',
'data-id': user_id
}, function() {
var image, ref;
image = (ref = entity[user_id]) != null ? ref.photo_url : void 0;
if (image) {
if ... | CoffeeScript | JavaScript | yakyak/yakyak | src/ui/util.coffee | MIT | 7436d1cb9c8be24ecc705c776af2e07bf527148e | 3,762 | https://github.com/yakyak/yakyak/blob/7436d1cb9c8be24ecc705c776af2e07bf527148e/src/ui/util.coffee | 24 | 42 |
yakyak/yakyak:src/ui/util.coffee:4:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
var drawAvatar;
drawAvatar = function(user_id, viewstate, entity) {
var initials;
initials = initialsof(entity[user_id]);
return div({
class: 'avatar',
'data-id': user_id
}, function() {
var image, ref;
image = (ref = entity[user_id]) != nu... | drawAvatar = (user_id, viewstate, entity) ->
initials = initialsof entity[user_id]
div class: 'avatar', 'data-id': user_id, ->
image = entity[user_id]?.photo_url
if image
if !viewstate?.showAnimatedThumbs
image += "?sz=50"
#
img src:fixlink(ima... | JavaScript | CoffeeScript | yakyak/yakyak | src/ui/util.coffee | MIT | 7436d1cb9c8be24ecc705c776af2e07bf527148e | 3,762 | https://github.com/yakyak/yakyak/blob/7436d1cb9c8be24ecc705c776af2e07bf527148e/src/ui/util.coffee | 24 | 42 |
yakyak/yakyak:src/ui/util.coffee:4:completion | completion | drawAvatar = (user_id, viewstate, entity) ->
initials = initialsof entity[user_id]
div class: 'avatar', 'data-id': user_id, ->
image = entity[user_id]?.photo_url
if image
if !viewstate?.showAnimatedThumbs
image += "?sz=50"
#
img src:fixlink(ima... | , onerror: (ev) ->
# in case the image is not available, it
# fallbacks to initials
ev.target.parentElement.classList.add "fallback-on"
, onload: (ev) ->
# when loading successfuly, update again all other imgs
ev.target.parent... | CoffeeScript | CoffeeScript | yakyak/yakyak | src/ui/util.coffee | MIT | 7436d1cb9c8be24ecc705c776af2e07bf527148e | 3,762 | https://github.com/yakyak/yakyak/blob/7436d1cb9c8be24ecc705c776af2e07bf527148e/src/ui/util.coffee | 24 | 42 |
gss/engine:src/properties/Getters.coffee:1:raw_corpus | raw_corpus | class Getters
# Global variables managed by the engine
'::window':
width: ->
return Math.min(window.innerWidth, document.documentElement.clientWidth)
height: ->
return document.documentElement.clientHeight
x: 0
y: 0
'::document':
height: ->
return document.documentEleme... | CoffeeScript | gss/engine | src/properties/Getters.coffee | MIT | 400ff13b657e4fa06d6819db318c341c4f17c3e5 | 2,854 | https://github.com/gss/engine/blob/400ff13b657e4fa06d6819db318c341c4f17c3e5/src/properties/Getters.coffee | 1 | 50 | ||
gss/engine:src/properties/Getters.coffee:1:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
class Getters
# Global variables managed by the engine
'::window':
width: ->
return Math.min(window.innerWidth, document.documentElement.clientWidth)
height: ->
return document.documentElement.clientHeight
x: 0
y: 0
'::docum... | var Getters;
Getters = (function() {
class Getters {};
// Global variables managed by the engine
Getters.prototype['::window'] = {
width: function() {
return Math.min(window.innerWidth, document.documentElement.clientWidth);
},
height: function() {
return document.documentElement.clientH... | CoffeeScript | JavaScript | gss/engine | src/properties/Getters.coffee | MIT | 400ff13b657e4fa06d6819db318c341c4f17c3e5 | 2,854 | https://github.com/gss/engine/blob/400ff13b657e4fa06d6819db318c341c4f17c3e5/src/properties/Getters.coffee | 1 | 50 |
gss/engine:src/properties/Getters.coffee:1:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
var Getters;
Getters = (function() {
class Getters {};
// Global variables managed by the engine
Getters.prototype['::window'] = {
width: function() {
return Math.min(window.innerWidth, document.documentElement.clientWidth);
},
height: fun... | class Getters
# Global variables managed by the engine
'::window':
width: ->
return Math.min(window.innerWidth, document.documentElement.clientWidth)
height: ->
return document.documentElement.clientHeight
x: 0
y: 0
'::document':
height: ->
return document.documentEleme... | JavaScript | CoffeeScript | gss/engine | src/properties/Getters.coffee | MIT | 400ff13b657e4fa06d6819db318c341c4f17c3e5 | 2,854 | https://github.com/gss/engine/blob/400ff13b657e4fa06d6819db318c341c4f17c3e5/src/properties/Getters.coffee | 1 | 50 |
gss/engine:src/properties/Getters.coffee:1:completion | completion | class Getters
# Global variables managed by the engine
'::window':
width: ->
return Math.min(window.innerWidth, document.documentElement.clientWidth)
height: ->
return document.documentElement.clientHeight
x: 0
y: 0
'::document':
height: ->
return document.documentEleme... | scroll:
height: ->
return document.body.scrollHeight
width: ->
return document.body.scrollWidth
left: ->
return window.pageXOffset || document.documentElement.scrollLeft || document.body.scrollLeft
top: ->
return window.pageYOffset || document.documentElement.sc... | CoffeeScript | CoffeeScript | gss/engine | src/properties/Getters.coffee | MIT | 400ff13b657e4fa06d6819db318c341c4f17c3e5 | 2,854 | https://github.com/gss/engine/blob/400ff13b657e4fa06d6819db318c341c4f17c3e5/src/properties/Getters.coffee | 1 | 50 |
gss/engine:src/properties/Getters.coffee:2:raw_corpus | raw_corpus | return
scroll:
left: (element) ->
return element.scrollLeft
top: (element) ->
return element.scrollTop
height: (element) ->
return element.scrollHeight
width: (element) ->
return element.scrollWidth
client:
left: (element) ->
return element.clientLeft
to... | CoffeeScript | gss/engine | src/properties/Getters.coffee | MIT | 400ff13b657e4fa06d6819db318c341c4f17c3e5 | 2,854 | https://github.com/gss/engine/blob/400ff13b657e4fa06d6819db318c341c4f17c3e5/src/properties/Getters.coffee | 51 | 93 | ||
gss/engine:src/properties/Getters.coffee:2:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
return
scroll:
left: (element) ->
return element.scrollLeft
top: (element) ->
return element.scrollTop
height: (element) ->
return element.scrollHeight
width: (element) ->
return element.scrollWidth
client:
l... | return {
scroll: {
left: function(element) {
return element.scrollLeft;
},
top: function(element) {
return element.scrollTop;
},
height: function(element) {
return element.scrollHeight;
},
width: function(element) {
return element.scrollWidth;
}
},
client: {... | CoffeeScript | JavaScript | gss/engine | src/properties/Getters.coffee | MIT | 400ff13b657e4fa06d6819db318c341c4f17c3e5 | 2,854 | https://github.com/gss/engine/blob/400ff13b657e4fa06d6819db318c341c4f17c3e5/src/properties/Getters.coffee | 51 | 93 |
gss/engine:src/properties/Getters.coffee:2:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
return {
scroll: {
left: function(element) {
return element.scrollLeft;
},
top: function(element) {
return element.scrollTop;
},
height: function(element) {
return element.scrollHeight;
},
width: function(element) {
... | return
scroll:
left: (element) ->
return element.scrollLeft
top: (element) ->
return element.scrollTop
height: (element) ->
return element.scrollHeight
width: (element) ->
return element.scrollWidth
client:
left: (element) ->
return element.clientLeft
to... | JavaScript | CoffeeScript | gss/engine | src/properties/Getters.coffee | MIT | 400ff13b657e4fa06d6819db318c341c4f17c3e5 | 2,854 | https://github.com/gss/engine/blob/400ff13b657e4fa06d6819db318c341c4f17c3e5/src/properties/Getters.coffee | 51 | 93 |
gss/engine:src/properties/Getters.coffee:2:completion | completion | return
scroll:
left: (element) ->
return element.scrollLeft
top: (element) ->
return element.scrollTop
height: (element) ->
return element.scrollHeight
width: (element) ->
return element.scrollWidth
client:
left: (element) ->
return element.clientLeft | top: (element) ->
return element.clientTop
height: (element) ->
return element.clientHeight
width: (element) ->
return element.clientWidth
offset:
left: (element) ->
return element.offsetLeft
top: (element) ->
return element.offsetTop
height: (element) ->
... | CoffeeScript | CoffeeScript | gss/engine | src/properties/Getters.coffee | MIT | 400ff13b657e4fa06d6819db318c341c4f17c3e5 | 2,854 | https://github.com/gss/engine/blob/400ff13b657e4fa06d6819db318c341c4f17c3e5/src/properties/Getters.coffee | 51 | 93 |
gss/engine:src/properties/Getters.coffee:1:raw_corpus | raw_corpus | class Getters
# Global variables managed by the engine
'::window':
width: ->
return document.documentElement.clientWidth
height: ->
return Math.min(window.innerHeight, document.documentElement.clientHeight)
x: 0
y: 0
'::document':
height: ->
return document.documentElem... | CoffeeScript | gss/engine | src/properties/Getters.coffee | MIT | 10bca5fdbfe6d8db65f0c354bc31b9fd817e263f | 2,854 | https://github.com/gss/engine/blob/10bca5fdbfe6d8db65f0c354bc31b9fd817e263f/src/properties/Getters.coffee | 1 | 50 | ||
gss/engine:src/properties/Getters.coffee:1:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
class Getters
# Global variables managed by the engine
'::window':
width: ->
return document.documentElement.clientWidth
height: ->
return Math.min(window.innerHeight, document.documentElement.clientHeight)
x: 0
y: 0
'::docu... | var Getters;
Getters = (function() {
class Getters {};
// Global variables managed by the engine
Getters.prototype['::window'] = {
width: function() {
return document.documentElement.clientWidth;
},
height: function() {
return Math.min(window.innerHeight, document.documentElement.clientH... | CoffeeScript | JavaScript | gss/engine | src/properties/Getters.coffee | MIT | 10bca5fdbfe6d8db65f0c354bc31b9fd817e263f | 2,854 | https://github.com/gss/engine/blob/10bca5fdbfe6d8db65f0c354bc31b9fd817e263f/src/properties/Getters.coffee | 1 | 50 |
gss/engine:src/properties/Getters.coffee:1:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
var Getters;
Getters = (function() {
class Getters {};
// Global variables managed by the engine
Getters.prototype['::window'] = {
width: function() {
return document.documentElement.clientWidth;
},
height: function() {
return Math.m... | class Getters
# Global variables managed by the engine
'::window':
width: ->
return document.documentElement.clientWidth
height: ->
return Math.min(window.innerHeight, document.documentElement.clientHeight)
x: 0
y: 0
'::document':
height: ->
return document.documentElem... | JavaScript | CoffeeScript | gss/engine | src/properties/Getters.coffee | MIT | 10bca5fdbfe6d8db65f0c354bc31b9fd817e263f | 2,854 | https://github.com/gss/engine/blob/10bca5fdbfe6d8db65f0c354bc31b9fd817e263f/src/properties/Getters.coffee | 1 | 50 |
gss/engine:src/properties/Getters.coffee:1:completion | completion | class Getters
# Global variables managed by the engine
'::window':
width: ->
return document.documentElement.clientWidth
height: ->
return Math.min(window.innerHeight, document.documentElement.clientHeight)
x: 0
y: 0
'::document':
height: ->
return document.documentElem... | scroll:
height: ->
return document.body.scrollHeight
width: ->
return document.body.scrollWidth
left: ->
return window.pageXOffset || document.documentElement.scrollLeft || document.body.scrollLeft
top: ->
return window.pageYOffset || document.documentElement.sc... | CoffeeScript | CoffeeScript | gss/engine | src/properties/Getters.coffee | MIT | 10bca5fdbfe6d8db65f0c354bc31b9fd817e263f | 2,854 | https://github.com/gss/engine/blob/10bca5fdbfe6d8db65f0c354bc31b9fd817e263f/src/properties/Getters.coffee | 1 | 50 |
gss/engine:src/properties/Getters.coffee:1:raw_corpus | raw_corpus | class Getters
# Global variables managed by the engine
'::window':
width: ->
return window.innerWidth
height: ->
return window.innerHeight
x: 0
y: 0
'::document':
height: ->
return document.body.offsetHeight
width: ->
return document.body.offsetWidth
x: ... | CoffeeScript | gss/engine | src/properties/Getters.coffee | MIT | dd16ea9387358f279a6c6c2a602f44874e2d0e6f | 2,854 | https://github.com/gss/engine/blob/dd16ea9387358f279a6c6c2a602f44874e2d0e6f/src/properties/Getters.coffee | 1 | 50 | ||
gss/engine:src/properties/Getters.coffee:1:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
class Getters
# Global variables managed by the engine
'::window':
width: ->
return window.innerWidth
height: ->
return window.innerHeight
x: 0
y: 0
'::document':
height: ->
return document.body.offsetHeight
... | var Getters;
Getters = (function() {
class Getters {};
// Global variables managed by the engine
Getters.prototype['::window'] = {
width: function() {
return window.innerWidth;
},
height: function() {
return window.innerHeight;
},
x: 0,
y: 0
};
Getters.prototype['::docum... | CoffeeScript | JavaScript | gss/engine | src/properties/Getters.coffee | MIT | dd16ea9387358f279a6c6c2a602f44874e2d0e6f | 2,854 | https://github.com/gss/engine/blob/dd16ea9387358f279a6c6c2a602f44874e2d0e6f/src/properties/Getters.coffee | 1 | 50 |
gss/engine:src/properties/Getters.coffee:1:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
var Getters;
Getters = (function() {
class Getters {};
// Global variables managed by the engine
Getters.prototype['::window'] = {
width: function() {
return window.innerWidth;
},
height: function() {
return window.innerHeight;
}... | class Getters
# Global variables managed by the engine
'::window':
width: ->
return window.innerWidth
height: ->
return window.innerHeight
x: 0
y: 0
'::document':
height: ->
return document.body.offsetHeight
width: ->
return document.body.offsetWidth
x: ... | JavaScript | CoffeeScript | gss/engine | src/properties/Getters.coffee | MIT | dd16ea9387358f279a6c6c2a602f44874e2d0e6f | 2,854 | https://github.com/gss/engine/blob/dd16ea9387358f279a6c6c2a602f44874e2d0e6f/src/properties/Getters.coffee | 1 | 50 |
gss/engine:src/properties/Getters.coffee:1:completion | completion | class Getters
# Global variables managed by the engine
'::window':
width: ->
return window.innerWidth
height: ->
return window.innerHeight
x: 0
y: 0
'::document':
height: ->
return document.body.offsetHeight
width: ->
return document.body.offsetWidth
x: ... | scroll:
height: ->
return document.body.scrollHeight
width: ->
return document.body.scrollWidth
left: ->
return window.pageXOffset || document.documentElement.scrollLeft || document.body.scrollLeft
top: ->
return window.pageYOffset || document.documentElement.sc... | CoffeeScript | CoffeeScript | gss/engine | src/properties/Getters.coffee | MIT | dd16ea9387358f279a6c6c2a602f44874e2d0e6f | 2,854 | https://github.com/gss/engine/blob/dd16ea9387358f279a6c6c2a602f44874e2d0e6f/src/properties/Getters.coffee | 1 | 50 |
gss/engine:src/properties/Getters.coffee:1:raw_corpus | raw_corpus | class Getters
# Global variables managed by the engine
'::window':
width: ->
return window.innerWidth
height: ->
return window.innerHeight
#right: '::window[width]'
#bottom: '::window[height]'
#
#center:
# x: ->
# return window.innerWidth / 2
#
# y: ->
... | CoffeeScript | gss/engine | src/properties/Getters.coffee | MIT | d3a6c74b85e6d12a9ec02c24fef87d4c22bd9cb0 | 2,854 | https://github.com/gss/engine/blob/d3a6c74b85e6d12a9ec02c24fef87d4c22bd9cb0/src/properties/Getters.coffee | 1 | 50 | ||
gss/engine:src/properties/Getters.coffee:1:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
class Getters
# Global variables managed by the engine
'::window':
width: ->
return window.innerWidth
height: ->
return window.innerHeight
#right: '::window[width]'
#bottom: '::window[height]'
#
#center:
# x: ->
... | var Getters;
Getters = (function() {
class Getters {};
// Global variables managed by the engine
Getters.prototype['::window'] = {
width: function() {
return window.innerWidth;
},
height: function() {
return window.innerHeight;
},
//right: '::window[width]'
//bottom: '::windo... | CoffeeScript | JavaScript | gss/engine | src/properties/Getters.coffee | MIT | d3a6c74b85e6d12a9ec02c24fef87d4c22bd9cb0 | 2,854 | https://github.com/gss/engine/blob/d3a6c74b85e6d12a9ec02c24fef87d4c22bd9cb0/src/properties/Getters.coffee | 1 | 50 |
gss/engine:src/properties/Getters.coffee:1:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
var Getters;
Getters = (function() {
class Getters {};
// Global variables managed by the engine
Getters.prototype['::window'] = {
width: function() {
return window.innerWidth;
},
height: function() {
return window.innerHeight;
}... | class Getters
# Global variables managed by the engine
'::window':
width: ->
return window.innerWidth
height: ->
return window.innerHeight
#right: '::window[width]'
#bottom: '::window[height]'
#
#center:
# x: ->
# return window.innerWidth / 2
#
# y: ->
... | JavaScript | CoffeeScript | gss/engine | src/properties/Getters.coffee | MIT | d3a6c74b85e6d12a9ec02c24fef87d4c22bd9cb0 | 2,854 | https://github.com/gss/engine/blob/d3a6c74b85e6d12a9ec02c24fef87d4c22bd9cb0/src/properties/Getters.coffee | 1 | 50 |
gss/engine:src/properties/Getters.coffee:1:completion | completion | class Getters
# Global variables managed by the engine
'::window':
width: ->
return window.innerWidth
height: ->
return window.innerHeight
#right: '::window[width]'
#bottom: '::window[height]'
#
#center:
# x: ->
# return window.innerWidth / 2
#
# y: ->
... | left: ->
return window.pageXOffset || document.documentElement.scrollLeft || document.body.scrollLeft
top: ->
return window.pageYOffset || document.documentElement.scrollTop || document.body.scrollTop
x: 0
y: 0
'::document':
scroll:
left: '::window[scroll-left]'
top: ... | CoffeeScript | CoffeeScript | gss/engine | src/properties/Getters.coffee | MIT | d3a6c74b85e6d12a9ec02c24fef87d4c22bd9cb0 | 2,854 | https://github.com/gss/engine/blob/d3a6c74b85e6d12a9ec02c24fef87d4c22bd9cb0/src/properties/Getters.coffee | 1 | 50 |
gss/engine:src/properties/Getters.coffee:2:raw_corpus | raw_corpus | y: (element) ->
return
x: (element) ->
return
scroll:
left: (element) ->
return element.scrollLeft
top: (element) ->
return element.scrollTop
height: (element) ->
return element.scrollHeight
width: (element) ->
return element.scrollWidth
client:
le... | CoffeeScript | gss/engine | src/properties/Getters.coffee | MIT | d3a6c74b85e6d12a9ec02c24fef87d4c22bd9cb0 | 2,854 | https://github.com/gss/engine/blob/d3a6c74b85e6d12a9ec02c24fef87d4c22bd9cb0/src/properties/Getters.coffee | 51 | 97 | ||
gss/engine:src/properties/Getters.coffee:2:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
y: (element) ->
return
x: (element) ->
return
scroll:
left: (element) ->
return element.scrollLeft
top: (element) ->
return element.scrollTop
height: (element) ->
return element.scrollHeight
width: (elemen... | ({
y: function(element) {},
x: function(element) {},
scroll: {
left: function(element) {
return element.scrollLeft;
},
top: function(element) {
return element.scrollTop;
},
height: function(element) {
return element.scrollHeight;
},
width: function(element) {
re... | CoffeeScript | JavaScript | gss/engine | src/properties/Getters.coffee | MIT | d3a6c74b85e6d12a9ec02c24fef87d4c22bd9cb0 | 2,854 | https://github.com/gss/engine/blob/d3a6c74b85e6d12a9ec02c24fef87d4c22bd9cb0/src/properties/Getters.coffee | 51 | 97 |
gss/engine:src/properties/Getters.coffee:2:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
({
y: function(element) {},
x: function(element) {},
scroll: {
left: function(element) {
return element.scrollLeft;
},
top: function(element) {
return element.scrollTop;
},
height: function(element) {
return element.scrol... | y: (element) ->
return
x: (element) ->
return
scroll:
left: (element) ->
return element.scrollLeft
top: (element) ->
return element.scrollTop
height: (element) ->
return element.scrollHeight
width: (element) ->
return element.scrollWidth
client:
le... | JavaScript | CoffeeScript | gss/engine | src/properties/Getters.coffee | MIT | d3a6c74b85e6d12a9ec02c24fef87d4c22bd9cb0 | 2,854 | https://github.com/gss/engine/blob/d3a6c74b85e6d12a9ec02c24fef87d4c22bd9cb0/src/properties/Getters.coffee | 51 | 97 |
gss/engine:src/properties/Getters.coffee:2:completion | completion | y: (element) ->
return
x: (element) ->
return
scroll:
left: (element) ->
return element.scrollLeft
top: (element) ->
return element.scrollTop
height: (element) ->
return element.scrollHeight
width: (element) ->
return element.scrollWidth
client:
le... | return element.clientLeft
top: (element) ->
return element.clientTop
height: (element) ->
return element.clientHeight
width: (element) ->
return element.clientWidth
offset:
left: (element) ->
return element.offsetLeft
top: (element) ->
return element.offsetTop
... | CoffeeScript | CoffeeScript | gss/engine | src/properties/Getters.coffee | MIT | d3a6c74b85e6d12a9ec02c24fef87d4c22bd9cb0 | 2,854 | https://github.com/gss/engine/blob/d3a6c74b85e6d12a9ec02c24fef87d4c22bd9cb0/src/properties/Getters.coffee | 51 | 97 |
Glavin001/atom-beautify:src/beautifiers/clang-format.coffee:1:raw_corpus | raw_corpus | module.exports = class ClangFormat extends Beautifier
name: "clang-format"
link: "https://clang.llvm.org/docs/ClangFormat.html"
executables: [
{
name: "ClangFormat"
cmd: "clang-format"
homepage: "https://clang.llvm.org/docs/ClangFormat.html"
installation: "https://clang.llvm.org/docs/... | CoffeeScript | Glavin001/atom-beautify | src/beautifiers/clang-format.coffee | MIT | 41d5051b399f7fe11efd149504a232df16179d60 | 1,503 | https://github.com/Glavin001/atom-beautify/blob/41d5051b399f7fe11efd149504a232df16179d60/src/beautifiers/clang-format.coffee | 10 | 59 | ||
Glavin001/atom-beautify:src/beautifiers/clang-format.coffee:1:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
module.exports = class ClangFormat extends Beautifier
name: "clang-format"
link: "https://clang.llvm.org/docs/ClangFormat.html"
executables: [
{
name: "ClangFormat"
cmd: "clang-format"
homepage: "https://clang.llvm.org/docs/ClangForma... | var ClangFormat;
module.exports = ClangFormat = (function() {
class ClangFormat extends Beautifier {
/*
Dump contents to a given file
*/
dumpToFile(name = "atom-beautify-dump", contents = "") {
return new this.Promise((resolve, reject) => {
return fs.open(name, "w", (err, fd) => {
... | CoffeeScript | JavaScript | Glavin001/atom-beautify | src/beautifiers/clang-format.coffee | MIT | 41d5051b399f7fe11efd149504a232df16179d60 | 1,503 | https://github.com/Glavin001/atom-beautify/blob/41d5051b399f7fe11efd149504a232df16179d60/src/beautifiers/clang-format.coffee | 10 | 59 |
Glavin001/atom-beautify:src/beautifiers/clang-format.coffee:1:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
var ClangFormat;
module.exports = ClangFormat = (function() {
class ClangFormat extends Beautifier {
/*
Dump contents to a given file
*/
dumpToFile(name = "atom-beautify-dump", contents = "") {
return new this.Promise((resolve, reject) =>... | module.exports = class ClangFormat extends Beautifier
name: "clang-format"
link: "https://clang.llvm.org/docs/ClangFormat.html"
executables: [
{
name: "ClangFormat"
cmd: "clang-format"
homepage: "https://clang.llvm.org/docs/ClangFormat.html"
installation: "https://clang.llvm.org/docs/... | JavaScript | CoffeeScript | Glavin001/atom-beautify | src/beautifiers/clang-format.coffee | MIT | 41d5051b399f7fe11efd149504a232df16179d60 | 1,503 | https://github.com/Glavin001/atom-beautify/blob/41d5051b399f7fe11efd149504a232df16179d60/src/beautifiers/clang-format.coffee | 10 | 59 |
Glavin001/atom-beautify:src/beautifiers/clang-format.coffee:1:completion | completion | module.exports = class ClangFormat extends Beautifier
name: "clang-format"
link: "https://clang.llvm.org/docs/ClangFormat.html"
executables: [
{
name: "ClangFormat"
cmd: "clang-format"
homepage: "https://clang.llvm.org/docs/ClangFormat.html"
installation: "https://clang.llvm.org/docs/... | ###
Dump contents to a given file
###
dumpToFile: (name = "atom-beautify-dump", contents = "") ->
return new @Promise((resolve, reject) =>
fs.open(name, "w", (err, fd) =>
@debug('dumpToFile', name, err, fd)
return reject(err) if err
fs.write(fd, contents, (err) ->
ret... | CoffeeScript | CoffeeScript | Glavin001/atom-beautify | src/beautifiers/clang-format.coffee | MIT | 41d5051b399f7fe11efd149504a232df16179d60 | 1,503 | https://github.com/Glavin001/atom-beautify/blob/41d5051b399f7fe11efd149504a232df16179d60/src/beautifiers/clang-format.coffee | 10 | 59 |
Glavin001/atom-beautify:src/beautifiers/clang-format.coffee:2:raw_corpus | raw_corpus | # config file in directory and parent directories of the input file,
# and retreat to default style if not found. Projects often makes use of
# this rule to define their own style in its top directory. Users often
# put a `.clang-format` in their $HOME to define his/her style. To honor
# this rule, we H... | CoffeeScript | Glavin001/atom-beautify | src/beautifiers/clang-format.coffee | MIT | 41d5051b399f7fe11efd149504a232df16179d60 | 1,503 | https://github.com/Glavin001/atom-beautify/blob/41d5051b399f7fe11efd149504a232df16179d60/src/beautifiers/clang-format.coffee | 60 | 86 | ||
Glavin001/atom-beautify:src/beautifiers/clang-format.coffee:2:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
# config file in directory and parent directories of the input file,
# and retreat to default style if not found. Projects often makes use of
# this rule to define their own style in its top directory. Users often
# put a `.clang-format` in their $HOM... | // config file in directory and parent directories of the input file,
// and retreat to default style if not found. Projects often makes use of
// this rule to define their own style in its top directory. Users often
// put a `.clang-format` in their $HOME to define his/her style. To honor
// this rule, we HAVE TO gene... | CoffeeScript | JavaScript | Glavin001/atom-beautify | src/beautifiers/clang-format.coffee | MIT | 41d5051b399f7fe11efd149504a232df16179d60 | 1,503 | https://github.com/Glavin001/atom-beautify/blob/41d5051b399f7fe11efd149504a232df16179d60/src/beautifiers/clang-format.coffee | 60 | 86 |
Glavin001/atom-beautify:src/beautifiers/clang-format.coffee:2:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
// config file in directory and parent directories of the input file,
// and retreat to default style if not found. Projects often makes use of
// this rule to define their own style in its top directory. Users often
// put a `.clang-format` in their $HOME to defin... | # config file in directory and parent directories of the input file,
# and retreat to default style if not found. Projects often makes use of
# this rule to define their own style in its top directory. Users often
# put a `.clang-format` in their $HOME to define his/her style. To honor
# this rule, we H... | JavaScript | CoffeeScript | Glavin001/atom-beautify | src/beautifiers/clang-format.coffee | MIT | 41d5051b399f7fe11efd149504a232df16179d60 | 1,503 | https://github.com/Glavin001/atom-beautify/blob/41d5051b399f7fe11efd149504a232df16179d60/src/beautifiers/clang-format.coffee | 60 | 86 |
Glavin001/atom-beautify:src/beautifiers/clang-format.coffee:2:completion | completion | # config file in directory and parent directories of the input file,
# and retreat to default style if not found. Projects often makes use of
# this rule to define their own style in its top directory. Users often
# put a `.clang-format` in their $HOME to define his/her style. To honor
# this rule, we H... | dumpFile = path.join(currDir, ".atom-beautify.#{currFile}")
resolve dumpFile
else
reject(new Error("No active editor found!"))
)
.then((dumpFile) =>
# console.log("clang-format", dumpFile)
return @exe("clang-format").run([
@dumpToFile(dumpFile, text)
["--style=f... | CoffeeScript | CoffeeScript | Glavin001/atom-beautify | src/beautifiers/clang-format.coffee | MIT | 41d5051b399f7fe11efd149504a232df16179d60 | 1,503 | https://github.com/Glavin001/atom-beautify/blob/41d5051b399f7fe11efd149504a232df16179d60/src/beautifiers/clang-format.coffee | 60 | 86 |
Glavin001/atom-beautify:src/beautifiers/clang-format.coffee:1:raw_corpus | raw_corpus | module.exports = class ClangFormat extends Beautifier
name: "clang-format"
link: "https://clang.llvm.org/docs/ClangFormat.html"
executables: [
{
name: "ClangFormat"
cmd: "clang-format"
homepage: "https://clang.llvm.org/docs/ClangFormat.html"
installation: "https://clang.llvm.org/docs/... | CoffeeScript | Glavin001/atom-beautify | src/beautifiers/clang-format.coffee | MIT | 738847c1564667b969bf613c7e2669461182baea | 1,503 | https://github.com/Glavin001/atom-beautify/blob/738847c1564667b969bf613c7e2669461182baea/src/beautifiers/clang-format.coffee | 10 | 59 | ||
Glavin001/atom-beautify:src/beautifiers/clang-format.coffee:1:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
module.exports = class ClangFormat extends Beautifier
name: "clang-format"
link: "https://clang.llvm.org/docs/ClangFormat.html"
executables: [
{
name: "ClangFormat"
cmd: "clang-format"
homepage: "https://clang.llvm.org/docs/ClangForma... | var ClangFormat;
module.exports = ClangFormat = (function() {
class ClangFormat extends Beautifier {
/*
Dump contents to a given file
*/
dumpToFile(name = "atom-beautify-dump", contents = "") {
return new this.Promise((resolve, reject) => {
return fs.open(name, "w", (err, fd) => {
... | CoffeeScript | JavaScript | Glavin001/atom-beautify | src/beautifiers/clang-format.coffee | MIT | 738847c1564667b969bf613c7e2669461182baea | 1,503 | https://github.com/Glavin001/atom-beautify/blob/738847c1564667b969bf613c7e2669461182baea/src/beautifiers/clang-format.coffee | 10 | 59 |
Glavin001/atom-beautify:src/beautifiers/clang-format.coffee:1:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
var ClangFormat;
module.exports = ClangFormat = (function() {
class ClangFormat extends Beautifier {
/*
Dump contents to a given file
*/
dumpToFile(name = "atom-beautify-dump", contents = "") {
return new this.Promise((resolve, reject) =>... | module.exports = class ClangFormat extends Beautifier
name: "clang-format"
link: "https://clang.llvm.org/docs/ClangFormat.html"
executables: [
{
name: "ClangFormat"
cmd: "clang-format"
homepage: "https://clang.llvm.org/docs/ClangFormat.html"
installation: "https://clang.llvm.org/docs/... | JavaScript | CoffeeScript | Glavin001/atom-beautify | src/beautifiers/clang-format.coffee | MIT | 738847c1564667b969bf613c7e2669461182baea | 1,503 | https://github.com/Glavin001/atom-beautify/blob/738847c1564667b969bf613c7e2669461182baea/src/beautifiers/clang-format.coffee | 10 | 59 |
Glavin001/atom-beautify:src/beautifiers/clang-format.coffee:1:completion | completion | module.exports = class ClangFormat extends Beautifier
name: "clang-format"
link: "https://clang.llvm.org/docs/ClangFormat.html"
executables: [
{
name: "ClangFormat"
cmd: "clang-format"
homepage: "https://clang.llvm.org/docs/ClangFormat.html"
installation: "https://clang.llvm.org/docs/... | ###
dumpToFile: (name = "atom-beautify-dump", contents = "") ->
return new @Promise((resolve, reject) =>
fs.open(name, "w", (err, fd) =>
@debug('dumpToFile', name, err, fd)
return reject(err) if err
fs.write(fd, contents, (err) ->
return reject(err) if err
fs.clos... | CoffeeScript | CoffeeScript | Glavin001/atom-beautify | src/beautifiers/clang-format.coffee | MIT | 738847c1564667b969bf613c7e2669461182baea | 1,503 | https://github.com/Glavin001/atom-beautify/blob/738847c1564667b969bf613c7e2669461182baea/src/beautifiers/clang-format.coffee | 10 | 59 |
Glavin001/atom-beautify:src/beautifiers/clang-format.coffee:2:raw_corpus | raw_corpus | # put a `.clang-format` in their $HOME to define his/her style. To honor
# this rule, we HAVE TO generate the temp file in THE SAME directory as
# the editing file. However, this mechanism is not directly supported by
# atom-beautify at the moment. So we introduce lots of code here.
return new @Promise(... | CoffeeScript | Glavin001/atom-beautify | src/beautifiers/clang-format.coffee | MIT | 738847c1564667b969bf613c7e2669461182baea | 1,503 | https://github.com/Glavin001/atom-beautify/blob/738847c1564667b969bf613c7e2669461182baea/src/beautifiers/clang-format.coffee | 60 | 83 | ||
Glavin001/atom-beautify:src/beautifiers/clang-format.coffee:2:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
# put a `.clang-format` in their $HOME to define his/her style. To honor
# this rule, we HAVE TO generate the temp file in THE SAME directory as
# the editing file. However, this mechanism is not directly supported by
# atom-beautify at the moment. So... | // put a `.clang-format` in their $HOME to define his/her style. To honor
// this rule, we HAVE TO generate the temp file in THE SAME directory as
// the editing file. However, this mechanism is not directly supported by
// atom-beautify at the moment. So we introduce lots of code here.
return new this.Promise(function... | CoffeeScript | JavaScript | Glavin001/atom-beautify | src/beautifiers/clang-format.coffee | MIT | 738847c1564667b969bf613c7e2669461182baea | 1,503 | https://github.com/Glavin001/atom-beautify/blob/738847c1564667b969bf613c7e2669461182baea/src/beautifiers/clang-format.coffee | 60 | 83 |
Glavin001/atom-beautify:src/beautifiers/clang-format.coffee:2:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
// put a `.clang-format` in their $HOME to define his/her style. To honor
// this rule, we HAVE TO generate the temp file in THE SAME directory as
// the editing file. However, this mechanism is not directly supported by
// atom-beautify at the moment. So we introd... | # put a `.clang-format` in their $HOME to define his/her style. To honor
# this rule, we HAVE TO generate the temp file in THE SAME directory as
# the editing file. However, this mechanism is not directly supported by
# atom-beautify at the moment. So we introduce lots of code here.
return new @Promise(... | JavaScript | CoffeeScript | Glavin001/atom-beautify | src/beautifiers/clang-format.coffee | MIT | 738847c1564667b969bf613c7e2669461182baea | 1,503 | https://github.com/Glavin001/atom-beautify/blob/738847c1564667b969bf613c7e2669461182baea/src/beautifiers/clang-format.coffee | 60 | 83 |
Glavin001/atom-beautify:src/beautifiers/clang-format.coffee:2:completion | completion | # put a `.clang-format` in their $HOME to define his/her style. To honor
# this rule, we HAVE TO generate the temp file in THE SAME directory as
# the editing file. However, this mechanism is not directly supported by
# atom-beautify at the moment. So we introduce lots of code here.
return new @Promise(... | else
reject(new Error("No active editor found!"))
)
.then((dumpFile) =>
# console.log("clang-format", dumpFile)
return @exe("clang-format").run([
@dumpToFile(dumpFile, text)
["--style=file"]
]).finally( ->
fs.unlink(dumpFile)
)
) | CoffeeScript | CoffeeScript | Glavin001/atom-beautify | src/beautifiers/clang-format.coffee | MIT | 738847c1564667b969bf613c7e2669461182baea | 1,503 | https://github.com/Glavin001/atom-beautify/blob/738847c1564667b969bf613c7e2669461182baea/src/beautifiers/clang-format.coffee | 60 | 83 |
Glavin001/atom-beautify:src/beautifiers/clang-format.coffee:1:raw_corpus | raw_corpus | ###
Requires clang-format (https://clang.llvm.org)
###
"use strict"
Beautifier = require('./beautifier')
path = require('path')
fs = require('fs')
module.exports = class ClangFormat extends Beautifier
name: "clang-format"
link: "https://clang.llvm.org/docs/ClangFormat.html"
isPreInstalled: false
options: {
... | CoffeeScript | Glavin001/atom-beautify | src/beautifiers/clang-format.coffee | MIT | ba2198675cbcc1ecd05f18e28e97133cdd2d5319 | 1,503 | https://github.com/Glavin001/atom-beautify/blob/ba2198675cbcc1ecd05f18e28e97133cdd2d5319/src/beautifiers/clang-format.coffee | 1 | 50 | ||
Glavin001/atom-beautify:src/beautifiers/clang-format.coffee:1:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
###
Requires clang-format (https://clang.llvm.org)
###
"use strict"
Beautifier = require('./beautifier')
path = require('path')
fs = require('fs')
module.exports = class ClangFormat extends Beautifier
name: "clang-format"
link: "https://clang.llvm.org/docs... | /*
Requires clang-format (https://clang.llvm.org)
*/
"use strict";
var Beautifier, ClangFormat, fs, path;
Beautifier = require('./beautifier');
path = require('path');
fs = require('fs');
module.exports = ClangFormat = (function() {
class ClangFormat extends Beautifier {
/*
Dump contents to a given file... | CoffeeScript | JavaScript | Glavin001/atom-beautify | src/beautifiers/clang-format.coffee | MIT | ba2198675cbcc1ecd05f18e28e97133cdd2d5319 | 1,503 | https://github.com/Glavin001/atom-beautify/blob/ba2198675cbcc1ecd05f18e28e97133cdd2d5319/src/beautifiers/clang-format.coffee | 1 | 50 |
Glavin001/atom-beautify:src/beautifiers/clang-format.coffee:1:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
/*
Requires clang-format (https://clang.llvm.org)
*/
"use strict";
var Beautifier, ClangFormat, fs, path;
Beautifier = require('./beautifier');
path = require('path');
fs = require('fs');
module.exports = ClangFormat = (function() {
class ClangFormat extends ... | ###
Requires clang-format (https://clang.llvm.org)
###
"use strict"
Beautifier = require('./beautifier')
path = require('path')
fs = require('fs')
module.exports = class ClangFormat extends Beautifier
name: "clang-format"
link: "https://clang.llvm.org/docs/ClangFormat.html"
isPreInstalled: false
options: {
... | JavaScript | CoffeeScript | Glavin001/atom-beautify | src/beautifiers/clang-format.coffee | MIT | ba2198675cbcc1ecd05f18e28e97133cdd2d5319 | 1,503 | https://github.com/Glavin001/atom-beautify/blob/ba2198675cbcc1ecd05f18e28e97133cdd2d5319/src/beautifiers/clang-format.coffee | 1 | 50 |
Glavin001/atom-beautify:src/beautifiers/clang-format.coffee:1:completion | completion | ###
Requires clang-format (https://clang.llvm.org)
###
"use strict"
Beautifier = require('./beautifier')
path = require('path')
fs = require('fs')
module.exports = class ClangFormat extends Beautifier
name: "clang-format"
link: "https://clang.llvm.org/docs/ClangFormat.html"
isPreInstalled: false
options: {
... | dumpToFile: (name = "atom-beautify-dump", contents = "") ->
return new @Promise((resolve, reject) =>
fs.open(name, "w", (err, fd) =>
@debug('dumpToFile', name, err, fd)
return reject(err) if err
fs.write(fd, contents, (err) ->
return reject(err) if err
fs.close(fd, ... | CoffeeScript | CoffeeScript | Glavin001/atom-beautify | src/beautifiers/clang-format.coffee | MIT | ba2198675cbcc1ecd05f18e28e97133cdd2d5319 | 1,503 | https://github.com/Glavin001/atom-beautify/blob/ba2198675cbcc1ecd05f18e28e97133cdd2d5319/src/beautifiers/clang-format.coffee | 1 | 50 |
Glavin001/atom-beautify:src/beautifiers/clang-format.coffee:2:raw_corpus | raw_corpus | # this rule, we HAVE TO generate the temp file in THE SAME directory as
# the editing file. However, this mechanism is not directly supported by
# atom-beautify at the moment. So we introduce lots of code here.
return new @Promise((resolve, reject) ->
editor = atom?.workspace?.getActiveTextEditor()
... | CoffeeScript | Glavin001/atom-beautify | src/beautifiers/clang-format.coffee | MIT | ba2198675cbcc1ecd05f18e28e97133cdd2d5319 | 1,503 | https://github.com/Glavin001/atom-beautify/blob/ba2198675cbcc1ecd05f18e28e97133cdd2d5319/src/beautifiers/clang-format.coffee | 51 | 75 | ||
Glavin001/atom-beautify:src/beautifiers/clang-format.coffee:2:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
# this rule, we HAVE TO generate the temp file in THE SAME directory as
# the editing file. However, this mechanism is not directly supported by
# atom-beautify at the moment. So we introduce lots of code here.
return new @Promise((resolve, reject) ->... | // this rule, we HAVE TO generate the temp file in THE SAME directory as
// the editing file. However, this mechanism is not directly supported by
// atom-beautify at the moment. So we introduce lots of code here.
return new this.Promise(function(resolve, reject) {
var currDir, currFile, dumpFile, editor, fullPath, r... | CoffeeScript | JavaScript | Glavin001/atom-beautify | src/beautifiers/clang-format.coffee | MIT | ba2198675cbcc1ecd05f18e28e97133cdd2d5319 | 1,503 | https://github.com/Glavin001/atom-beautify/blob/ba2198675cbcc1ecd05f18e28e97133cdd2d5319/src/beautifiers/clang-format.coffee | 51 | 75 |
Glavin001/atom-beautify:src/beautifiers/clang-format.coffee:2:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
// this rule, we HAVE TO generate the temp file in THE SAME directory as
// the editing file. However, this mechanism is not directly supported by
// atom-beautify at the moment. So we introduce lots of code here.
return new this.Promise(function(resolve, reject) {... | # this rule, we HAVE TO generate the temp file in THE SAME directory as
# the editing file. However, this mechanism is not directly supported by
# atom-beautify at the moment. So we introduce lots of code here.
return new @Promise((resolve, reject) ->
editor = atom?.workspace?.getActiveTextEditor()
... | JavaScript | CoffeeScript | Glavin001/atom-beautify | src/beautifiers/clang-format.coffee | MIT | ba2198675cbcc1ecd05f18e28e97133cdd2d5319 | 1,503 | https://github.com/Glavin001/atom-beautify/blob/ba2198675cbcc1ecd05f18e28e97133cdd2d5319/src/beautifiers/clang-format.coffee | 51 | 75 |
Glavin001/atom-beautify:src/beautifiers/clang-format.coffee:2:completion | completion | # this rule, we HAVE TO generate the temp file in THE SAME directory as
# the editing file. However, this mechanism is not directly supported by
# atom-beautify at the moment. So we introduce lots of code here.
return new @Promise((resolve, reject) ->
editor = atom?.workspace?.getActiveTextEditor()
... | reject(new Error("No active editor found!"))
)
.then((dumpFile) =>
# console.log("clang-format", dumpFile)
return @run("clang-format", [
@dumpToFile(dumpFile, text)
["--style=file"]
], help: {
link: "https://clang.llvm.org/docs/ClangFormat.html"
}).finally( ... | CoffeeScript | CoffeeScript | Glavin001/atom-beautify | src/beautifiers/clang-format.coffee | MIT | ba2198675cbcc1ecd05f18e28e97133cdd2d5319 | 1,503 | https://github.com/Glavin001/atom-beautify/blob/ba2198675cbcc1ecd05f18e28e97133cdd2d5319/src/beautifiers/clang-format.coffee | 51 | 75 |
Glavin001/atom-beautify:src/beautifiers/clang-format.coffee:1:raw_corpus | raw_corpus | ###
Requires clang-format (https://clang.llvm.org)
###
"use strict"
Beautifier = require('./beautifier')
path = require('path')
fs = require('fs')
module.exports = class ClangFormat extends Beautifier
name: "clang-format"
link: "https://clang.llvm.org/docs/ClangFormat.html"
options: {
"C++": false
"C"... | CoffeeScript | Glavin001/atom-beautify | src/beautifiers/clang-format.coffee | MIT | 640c71c2b98f93a5a514d067bffea03ad854ad98 | 1,503 | https://github.com/Glavin001/atom-beautify/blob/640c71c2b98f93a5a514d067bffea03ad854ad98/src/beautifiers/clang-format.coffee | 1 | 50 | ||
Glavin001/atom-beautify:src/beautifiers/clang-format.coffee:1:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
###
Requires clang-format (https://clang.llvm.org)
###
"use strict"
Beautifier = require('./beautifier')
path = require('path')
fs = require('fs')
module.exports = class ClangFormat extends Beautifier
name: "clang-format"
link: "https://clang.llvm.org/docs... | /*
Requires clang-format (https://clang.llvm.org)
*/
"use strict";
var Beautifier, ClangFormat, fs, path;
Beautifier = require('./beautifier');
path = require('path');
fs = require('fs');
module.exports = ClangFormat = (function() {
class ClangFormat extends Beautifier {
/*
Dump contents to a given file... | CoffeeScript | JavaScript | Glavin001/atom-beautify | src/beautifiers/clang-format.coffee | MIT | 640c71c2b98f93a5a514d067bffea03ad854ad98 | 1,503 | https://github.com/Glavin001/atom-beautify/blob/640c71c2b98f93a5a514d067bffea03ad854ad98/src/beautifiers/clang-format.coffee | 1 | 50 |
Glavin001/atom-beautify:src/beautifiers/clang-format.coffee:1:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
/*
Requires clang-format (https://clang.llvm.org)
*/
"use strict";
var Beautifier, ClangFormat, fs, path;
Beautifier = require('./beautifier');
path = require('path');
fs = require('fs');
module.exports = ClangFormat = (function() {
class ClangFormat extends ... | ###
Requires clang-format (https://clang.llvm.org)
###
"use strict"
Beautifier = require('./beautifier')
path = require('path')
fs = require('fs')
module.exports = class ClangFormat extends Beautifier
name: "clang-format"
link: "https://clang.llvm.org/docs/ClangFormat.html"
options: {
"C++": false
"C"... | JavaScript | CoffeeScript | Glavin001/atom-beautify | src/beautifiers/clang-format.coffee | MIT | 640c71c2b98f93a5a514d067bffea03ad854ad98 | 1,503 | https://github.com/Glavin001/atom-beautify/blob/640c71c2b98f93a5a514d067bffea03ad854ad98/src/beautifiers/clang-format.coffee | 1 | 50 |
Glavin001/atom-beautify:src/beautifiers/clang-format.coffee:1:completion | completion | ###
Requires clang-format (https://clang.llvm.org)
###
"use strict"
Beautifier = require('./beautifier')
path = require('path')
fs = require('fs')
module.exports = class ClangFormat extends Beautifier
name: "clang-format"
link: "https://clang.llvm.org/docs/ClangFormat.html"
options: {
"C++": false
"C"... | return new @Promise((resolve, reject) =>
fs.open(name, "w", (err, fd) =>
@debug('dumpToFile', name, err, fd)
return reject(err) if err
fs.write(fd, contents, (err) ->
return reject(err) if err
fs.close(fd, (err) ->
return reject(err) if err
resol... | CoffeeScript | CoffeeScript | Glavin001/atom-beautify | src/beautifiers/clang-format.coffee | MIT | 640c71c2b98f93a5a514d067bffea03ad854ad98 | 1,503 | https://github.com/Glavin001/atom-beautify/blob/640c71c2b98f93a5a514d067bffea03ad854ad98/src/beautifiers/clang-format.coffee | 1 | 50 |
Glavin001/atom-beautify:src/beautifiers/clang-format.coffee:2:raw_corpus | raw_corpus | # the editing file. However, this mechanism is not directly supported by
# atom-beautify at the moment. So we introduce lots of code here.
return new @Promise((resolve, reject) ->
editor = atom?.workspace?.getActiveTextEditor()
if editor?
fullPath = editor.getPath()
currDir = path.di... | CoffeeScript | Glavin001/atom-beautify | src/beautifiers/clang-format.coffee | MIT | 640c71c2b98f93a5a514d067bffea03ad854ad98 | 1,503 | https://github.com/Glavin001/atom-beautify/blob/640c71c2b98f93a5a514d067bffea03ad854ad98/src/beautifiers/clang-format.coffee | 51 | 74 | ||
Glavin001/atom-beautify:src/beautifiers/clang-format.coffee:2:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
# the editing file. However, this mechanism is not directly supported by
# atom-beautify at the moment. So we introduce lots of code here.
return new @Promise((resolve, reject) ->
editor = atom?.workspace?.getActiveTextEditor()
if editor?
... | // the editing file. However, this mechanism is not directly supported by
// atom-beautify at the moment. So we introduce lots of code here.
return new this.Promise(function(resolve, reject) {
var currDir, currFile, dumpFile, editor, fullPath, ref;
editor = typeof atom !== "undefined" && atom !== null ? (ref = atom... | CoffeeScript | JavaScript | Glavin001/atom-beautify | src/beautifiers/clang-format.coffee | MIT | 640c71c2b98f93a5a514d067bffea03ad854ad98 | 1,503 | https://github.com/Glavin001/atom-beautify/blob/640c71c2b98f93a5a514d067bffea03ad854ad98/src/beautifiers/clang-format.coffee | 51 | 74 |
Glavin001/atom-beautify:src/beautifiers/clang-format.coffee:2:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
// the editing file. However, this mechanism is not directly supported by
// atom-beautify at the moment. So we introduce lots of code here.
return new this.Promise(function(resolve, reject) {
var currDir, currFile, dumpFile, editor, fullPath, ref;
editor = typ... | # the editing file. However, this mechanism is not directly supported by
# atom-beautify at the moment. So we introduce lots of code here.
return new @Promise((resolve, reject) ->
editor = atom?.workspace?.getActiveTextEditor()
if editor?
fullPath = editor.getPath()
currDir = path.di... | JavaScript | CoffeeScript | Glavin001/atom-beautify | src/beautifiers/clang-format.coffee | MIT | 640c71c2b98f93a5a514d067bffea03ad854ad98 | 1,503 | https://github.com/Glavin001/atom-beautify/blob/640c71c2b98f93a5a514d067bffea03ad854ad98/src/beautifiers/clang-format.coffee | 51 | 74 |
Glavin001/atom-beautify:src/beautifiers/clang-format.coffee:2:completion | completion | # the editing file. However, this mechanism is not directly supported by
# atom-beautify at the moment. So we introduce lots of code here.
return new @Promise((resolve, reject) ->
editor = atom?.workspace?.getActiveTextEditor()
if editor?
fullPath = editor.getPath()
currDir = path.di... | )
.then((dumpFile) =>
# console.log("clang-format", dumpFile)
return @run("clang-format", [
@dumpToFile(dumpFile, text)
["--style=file"]
], help: {
link: "https://clang.llvm.org/docs/ClangFormat.html"
}).finally( ->
fs.unlink(dumpFile)
)
) | CoffeeScript | CoffeeScript | Glavin001/atom-beautify | src/beautifiers/clang-format.coffee | MIT | 640c71c2b98f93a5a514d067bffea03ad854ad98 | 1,503 | https://github.com/Glavin001/atom-beautify/blob/640c71c2b98f93a5a514d067bffea03ad854ad98/src/beautifiers/clang-format.coffee | 51 | 74 |
xhan/qqbot:tests/bot.coffee:1:raw_corpus | raw_corpus | #!/usr/bin/env coffee
# qqbot相关的测试代码
log = new (require 'log')('debug')
jsons = JSON.stringify
api = require "../src/qqapi"
QQBot = require "../src/qqbot"
defaults = require '../src/defaults'
config = require '../config'
# 设置登录信息
cookies = defaults.data 'cookie'
auth_info = defaults.data 'auth'
bot = new QQBo... | CoffeeScript | xhan/qqbot | tests/bot.coffee | MIT | f3b62a4a6e423cd85a7a2e06da5e5e51da940fe0 | 1,435 | https://github.com/xhan/qqbot/blob/f3b62a4a6e423cd85a7a2e06da5e5e51da940fe0/tests/bot.coffee | 1 | 33 | ||
xhan/qqbot:tests/bot.coffee:1:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
#!/usr/bin/env coffee
# qqbot相关的测试代码
log = new (require 'log')('debug')
jsons = JSON.stringify
api = require "../src/qqapi"
QQBot = require "../src/qqbot"
defaults = require '../src/defaults'
config = require '../config'
# 设置登录信息
cookies = defaults.data '... | //!/usr/bin/env coffee
// qqbot相关的测试代码
var QQBot, api, auth_info, bot, config, cookies, defaults, group, jsons, log;
log = new (require('log'))('debug');
jsons = JSON.stringify;
api = require("../src/qqapi");
QQBot = require("../src/qqbot");
defaults = require('../src/defaults');
config = require('../config');
/... | CoffeeScript | JavaScript | xhan/qqbot | tests/bot.coffee | MIT | f3b62a4a6e423cd85a7a2e06da5e5e51da940fe0 | 1,435 | https://github.com/xhan/qqbot/blob/f3b62a4a6e423cd85a7a2e06da5e5e51da940fe0/tests/bot.coffee | 1 | 33 |
xhan/qqbot:tests/bot.coffee:1:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
//!/usr/bin/env coffee
// qqbot相关的测试代码
var QQBot, api, auth_info, bot, config, cookies, defaults, group, jsons, log;
log = new (require('log'))('debug');
jsons = JSON.stringify;
api = require("../src/qqapi");
QQBot = require("../src/qqbot");
defaults = require... | #!/usr/bin/env coffee
# qqbot相关的测试代码
log = new (require 'log')('debug')
jsons = JSON.stringify
api = require "../src/qqapi"
QQBot = require "../src/qqbot"
defaults = require '../src/defaults'
config = require '../config'
# 设置登录信息
cookies = defaults.data 'cookie'
auth_info = defaults.data 'auth'
bot = new QQBo... | JavaScript | CoffeeScript | xhan/qqbot | tests/bot.coffee | MIT | f3b62a4a6e423cd85a7a2e06da5e5e51da940fe0 | 1,435 | https://github.com/xhan/qqbot/blob/f3b62a4a6e423cd85a7a2e06da5e5e51da940fe0/tests/bot.coffee | 1 | 33 |
xhan/qqbot:tests/bot.coffee:1:completion | completion | #!/usr/bin/env coffee
# qqbot相关的测试代码
log = new (require 'log')('debug')
jsons = JSON.stringify
api = require "../src/qqapi"
QQBot = require "../src/qqbot"
defaults = require '../src/defaults'
config = require '../config'
# 设置登录信息
cookies = defaults.data 'cookie' | auth_info = defaults.data 'auth'
bot = new QQBot(cookies,auth_info,config)
group = null
bot.listen_group "qqbot群" , (_group,error)->
log.info "enter long poll mode, have fun"
bot.runloop()
group = _group
group.on_message (content ,send, robot, message)->
log.info 'received',content
if content.matc... | CoffeeScript | CoffeeScript | xhan/qqbot | tests/bot.coffee | MIT | f3b62a4a6e423cd85a7a2e06da5e5e51da940fe0 | 1,435 | https://github.com/xhan/qqbot/blob/f3b62a4a6e423cd85a7a2e06da5e5e51da940fe0/tests/bot.coffee | 1 | 33 |
xhan/qqbot:tests/bot.coffee:1:raw_corpus | raw_corpus | #!/usr/bin/env coffee
# qqbot相关的测试代码
int = (v) -> parseInt v
log = console.log
jsons = JSON.stringify
auth = require "../src/qqauth"
api = require "../src/qqapi"
QQBot = require "../src/qqbot"
defaults = require '../src/defaults'
config = require '../config'
qq = config.account
pass = config.password
# 设置登录信息
api... | CoffeeScript | xhan/qqbot | tests/bot.coffee | MIT | 892369b05169ede69a4a7702bf380561abce5110 | 1,435 | https://github.com/xhan/qqbot/blob/892369b05169ede69a4a7702bf380561abce5110/tests/bot.coffee | 1 | 50 | ||
xhan/qqbot:tests/bot.coffee:1:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
#!/usr/bin/env coffee
# qqbot相关的测试代码
int = (v) -> parseInt v
log = console.log
jsons = JSON.stringify
auth = require "../src/qqauth"
api = require "../src/qqapi"
QQBot = require "../src/qqbot"
defaults = require '../src/defaults'
config = require '../config'... | //!/usr/bin/env coffee
// qqbot相关的测试代码
/*
auth_opts ={
psessionid
clientid
ptwebqq
uin
vfwebqq
}
*/
var QQBot, api, auth, auth_opts, bot, config, defaults, int, jsons, log, pass, qq;
int = function(v) {
return parseInt(v);
};
log = console.log;
jsons = JSON.stringify;
auth = require("../src/q... | CoffeeScript | JavaScript | xhan/qqbot | tests/bot.coffee | MIT | 892369b05169ede69a4a7702bf380561abce5110 | 1,435 | https://github.com/xhan/qqbot/blob/892369b05169ede69a4a7702bf380561abce5110/tests/bot.coffee | 1 | 50 |
xhan/qqbot:tests/bot.coffee:1:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
//!/usr/bin/env coffee
// qqbot相关的测试代码
/*
auth_opts ={
psessionid
clientid
ptwebqq
uin
vfwebqq
}
*/
var QQBot, api, auth, auth_opts, bot, config, defaults, int, jsons, log, pass, qq;
int = function(v) {
return parseInt(v);
};
log = console.... | #!/usr/bin/env coffee
# qqbot相关的测试代码
int = (v) -> parseInt v
log = console.log
jsons = JSON.stringify
auth = require "../src/qqauth"
api = require "../src/qqapi"
QQBot = require "../src/qqbot"
defaults = require '../src/defaults'
config = require '../config'
qq = config.account
pass = config.password
# 设置登录信息
api... | JavaScript | CoffeeScript | xhan/qqbot | tests/bot.coffee | MIT | 892369b05169ede69a4a7702bf380561abce5110 | 1,435 | https://github.com/xhan/qqbot/blob/892369b05169ede69a4a7702bf380561abce5110/tests/bot.coffee | 1 | 50 |
xhan/qqbot:tests/bot.coffee:1:completion | completion | #!/usr/bin/env coffee
# qqbot相关的测试代码
int = (v) -> parseInt v
log = console.log
jsons = JSON.stringify
auth = require "../src/qqauth"
api = require "../src/qqapi"
QQBot = require "../src/qqbot"
defaults = require '../src/defaults'
config = require '../config'
qq = config.account
pass = config.password
# 设置登录信息
api... | vfwebqq
}
###
bot = new QQBot( api.cookies(), auth_opts ,config )
api.get_buddy_list auth_opts, (ret,e)->
log e if e
log 'friend',jsons ret
log ''
bot.save_buddy_info ret.result if ret.retcode == 0
api.get_group_list auth_opts, (ret , e)->
log e if e
log 'group',jsons ret
log ''
... | CoffeeScript | CoffeeScript | xhan/qqbot | tests/bot.coffee | MIT | 892369b05169ede69a4a7702bf380561abce5110 | 1,435 | https://github.com/xhan/qqbot/blob/892369b05169ede69a4a7702bf380561abce5110/tests/bot.coffee | 1 | 50 |
xhan/qqbot:tests/bot.coffee:2:raw_corpus | raw_corpus | log e if e
log jsons ret
bot.handle_poll_responce(ret) | CoffeeScript | xhan/qqbot | tests/bot.coffee | MIT | 892369b05169ede69a4a7702bf380561abce5110 | 1,435 | https://github.com/xhan/qqbot/blob/892369b05169ede69a4a7702bf380561abce5110/tests/bot.coffee | 51 | 53 | ||
xhan/qqbot:tests/bot.coffee:2:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
log e if e
log jsons ret
bot.handle_poll_responce(ret)
``` | log(e(e ? (log(jsons(ret)), bot.handle_poll_responce(ret)) : void 0)); | CoffeeScript | JavaScript | xhan/qqbot | tests/bot.coffee | MIT | 892369b05169ede69a4a7702bf380561abce5110 | 1,435 | https://github.com/xhan/qqbot/blob/892369b05169ede69a4a7702bf380561abce5110/tests/bot.coffee | 51 | 53 |
xhan/qqbot:tests/bot.coffee:2:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
log(e(e ? (log(jsons(ret)), bot.handle_poll_responce(ret)) : void 0));
``` | log e if e
log jsons ret
bot.handle_poll_responce(ret) | JavaScript | CoffeeScript | xhan/qqbot | tests/bot.coffee | MIT | 892369b05169ede69a4a7702bf380561abce5110 | 1,435 | https://github.com/xhan/qqbot/blob/892369b05169ede69a4a7702bf380561abce5110/tests/bot.coffee | 51 | 53 |
xhan/qqbot:tests/bot.coffee:1:raw_corpus | raw_corpus | #!/usr/bin/env coffee
# qqbot相关的测试代码
int = (v) -> parseInt v
log = console.log
jsons = JSON.stringify
auth = require "../src/qqauth"
api = require "../src/qqapi"
QQBot = require "../src/qqbot"
config = require '../config'
qq = config.account
pass = config.password
api.defaults_read()
psessionid = api.defaults '... | CoffeeScript | xhan/qqbot | tests/bot.coffee | MIT | 8b146ed387f65ad6f5d7829dedccbd5eb2d05717 | 1,435 | https://github.com/xhan/qqbot/blob/8b146ed387f65ad6f5d7829dedccbd5eb2d05717/tests/bot.coffee | 1 | 50 | ||
xhan/qqbot:tests/bot.coffee:1:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
#!/usr/bin/env coffee
# qqbot相关的测试代码
int = (v) -> parseInt v
log = console.log
jsons = JSON.stringify
auth = require "../src/qqauth"
api = require "../src/qqapi"
QQBot = require "../src/qqbot"
config = require '../config'
qq = config.account
pass = config.pa... | //!/usr/bin/env coffee
// qqbot相关的测试代码
var QQBot, api, auth, auth_opts, bot, clientid, config, int, jsons, log, pass, psessionid, ptwebqq, qq, uin, vfwebqq;
int = function(v) {
return parseInt(v);
};
log = console.log;
jsons = JSON.stringify;
auth = require("../src/qqauth");
api = require("../src/qqapi");
QQBo... | CoffeeScript | JavaScript | xhan/qqbot | tests/bot.coffee | MIT | 8b146ed387f65ad6f5d7829dedccbd5eb2d05717 | 1,435 | https://github.com/xhan/qqbot/blob/8b146ed387f65ad6f5d7829dedccbd5eb2d05717/tests/bot.coffee | 1 | 50 |
xhan/qqbot:tests/bot.coffee:1:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
//!/usr/bin/env coffee
// qqbot相关的测试代码
var QQBot, api, auth, auth_opts, bot, clientid, config, int, jsons, log, pass, psessionid, ptwebqq, qq, uin, vfwebqq;
int = function(v) {
return parseInt(v);
};
log = console.log;
jsons = JSON.stringify;
auth = require(... | #!/usr/bin/env coffee
# qqbot相关的测试代码
int = (v) -> parseInt v
log = console.log
jsons = JSON.stringify
auth = require "../src/qqauth"
api = require "../src/qqapi"
QQBot = require "../src/qqbot"
config = require '../config'
qq = config.account
pass = config.password
api.defaults_read()
psessionid = api.defaults '... | JavaScript | CoffeeScript | xhan/qqbot | tests/bot.coffee | MIT | 8b146ed387f65ad6f5d7829dedccbd5eb2d05717 | 1,435 | https://github.com/xhan/qqbot/blob/8b146ed387f65ad6f5d7829dedccbd5eb2d05717/tests/bot.coffee | 1 | 50 |
xhan/qqbot:tests/bot.coffee:1:completion | completion | #!/usr/bin/env coffee
# qqbot相关的测试代码
int = (v) -> parseInt v
log = console.log
jsons = JSON.stringify
auth = require "../src/qqauth"
api = require "../src/qqapi"
QQBot = require "../src/qqbot"
config = require '../config'
qq = config.account
pass = config.password
api.defaults_read()
psessionid = api.defaults '... | psessionid
clientid
ptwebqq
uin
vfwebqq
}
bot = new QQBot("叫我小可爱", api.cookies(), auth_opts)
api.get_buddy_list auth_opts, (ret,e)->
log e if e
log 'friend',jsons ret
log ''
bot.save_buddy_info ret.result if ret.retcode == 0
api.get_group_list auth_opts, (ret , e)->
log e if e
... | CoffeeScript | CoffeeScript | xhan/qqbot | tests/bot.coffee | MIT | 8b146ed387f65ad6f5d7829dedccbd5eb2d05717 | 1,435 | https://github.com/xhan/qqbot/blob/8b146ed387f65ad6f5d7829dedccbd5eb2d05717/tests/bot.coffee | 1 | 50 |
xhan/qqbot:tests/bot.coffee:2:raw_corpus | raw_corpus | # BY 2769546520
bot.update_group_member({name:"qqbot群"})
api.long_poll auth_opts, (ret,e)->
log e if e
log jsons ret
bot.handle_poll_responce(ret) | CoffeeScript | xhan/qqbot | tests/bot.coffee | MIT | 8b146ed387f65ad6f5d7829dedccbd5eb2d05717 | 1,435 | https://github.com/xhan/qqbot/blob/8b146ed387f65ad6f5d7829dedccbd5eb2d05717/tests/bot.coffee | 51 | 58 | ||
xhan/qqbot:tests/bot.coffee:2:completion | completion | # BY 2769546520
bot.update_group_member({name:"qqbot群"}) | api.long_poll auth_opts, (ret,e)->
log e if e
log jsons ret
bot.handle_poll_responce(ret) | CoffeeScript | CoffeeScript | xhan/qqbot | tests/bot.coffee | MIT | 8b146ed387f65ad6f5d7829dedccbd5eb2d05717 | 1,435 | https://github.com/xhan/qqbot/blob/8b146ed387f65ad6f5d7829dedccbd5eb2d05717/tests/bot.coffee | 51 | 58 |
xhan/qqbot:tests/bot.coffee:1:raw_corpus | raw_corpus | #!/usr/bin/env coffee
# qqbot相关的测试代码
int = (v) -> parseInt v
log = console.log
jsons = JSON.stringify
auth = require "../src/qqauth"
api = require "../src/qqapi"
QQBot = require "../src/qqbot"
config = require '../config'
qq = config.account
pass = config.password
api.defaults_read()
psessionid = api.defaults '... | CoffeeScript | xhan/qqbot | tests/bot.coffee | MIT | ffa8f9d3a50a773263fd5125626a97ac1a27bfeb | 1,435 | https://github.com/xhan/qqbot/blob/ffa8f9d3a50a773263fd5125626a97ac1a27bfeb/tests/bot.coffee | 1 | 50 | ||
xhan/qqbot:tests/bot.coffee:1:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
#!/usr/bin/env coffee
# qqbot相关的测试代码
int = (v) -> parseInt v
log = console.log
jsons = JSON.stringify
auth = require "../src/qqauth"
api = require "../src/qqapi"
QQBot = require "../src/qqbot"
config = require '../config'
qq = config.account
pass = config.pa... | //!/usr/bin/env coffee
// qqbot相关的测试代码
var QQBot, api, auth, auth_opts, bot, clientid, config, int, jsons, log, pass, psessionid, ptwebqq, qq, uin, vfwebqq;
int = function(v) {
return parseInt(v);
};
log = console.log;
jsons = JSON.stringify;
auth = require("../src/qqauth");
api = require("../src/qqapi");
QQBo... | CoffeeScript | JavaScript | xhan/qqbot | tests/bot.coffee | MIT | ffa8f9d3a50a773263fd5125626a97ac1a27bfeb | 1,435 | https://github.com/xhan/qqbot/blob/ffa8f9d3a50a773263fd5125626a97ac1a27bfeb/tests/bot.coffee | 1 | 50 |
xhan/qqbot:tests/bot.coffee:1:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
//!/usr/bin/env coffee
// qqbot相关的测试代码
var QQBot, api, auth, auth_opts, bot, clientid, config, int, jsons, log, pass, psessionid, ptwebqq, qq, uin, vfwebqq;
int = function(v) {
return parseInt(v);
};
log = console.log;
jsons = JSON.stringify;
auth = require(... | #!/usr/bin/env coffee
# qqbot相关的测试代码
int = (v) -> parseInt v
log = console.log
jsons = JSON.stringify
auth = require "../src/qqauth"
api = require "../src/qqapi"
QQBot = require "../src/qqbot"
config = require '../config'
qq = config.account
pass = config.password
api.defaults_read()
psessionid = api.defaults '... | JavaScript | CoffeeScript | xhan/qqbot | tests/bot.coffee | MIT | ffa8f9d3a50a773263fd5125626a97ac1a27bfeb | 1,435 | https://github.com/xhan/qqbot/blob/ffa8f9d3a50a773263fd5125626a97ac1a27bfeb/tests/bot.coffee | 1 | 50 |
xhan/qqbot:tests/bot.coffee:1:completion | completion | #!/usr/bin/env coffee
# qqbot相关的测试代码
int = (v) -> parseInt v
log = console.log
jsons = JSON.stringify
auth = require "../src/qqauth"
api = require "../src/qqapi"
QQBot = require "../src/qqbot"
config = require '../config'
qq = config.account
pass = config.password
api.defaults_read()
psessionid = api.defaults '... | psessionid
clientid
ptwebqq
uin
vfwebqq
}
bot = new QQBot("叫我小可爱",auth_opts)
api.get_buddy_list auth_opts, (ret,e)->
log e if e
log 'friend',jsons ret
log ''
bot.save_buddy_info ret.result if ret.retcode == 0
api.get_group_list auth_opts, (ret , e)->
log e if e
log 'group',... | CoffeeScript | CoffeeScript | xhan/qqbot | tests/bot.coffee | MIT | ffa8f9d3a50a773263fd5125626a97ac1a27bfeb | 1,435 | https://github.com/xhan/qqbot/blob/ffa8f9d3a50a773263fd5125626a97ac1a27bfeb/tests/bot.coffee | 1 | 50 |
xhan/qqbot:tests/bot.coffee:2:raw_corpus | raw_corpus | # BY 2769546520
bot.update_group_member({name:"qqbot群"})
api.long_poll auth_opts, (ret,e)->
log e if e
log ret
bot.handle_poll_responce(ret)
# | CoffeeScript | xhan/qqbot | tests/bot.coffee | MIT | 9ddeb4dad8091333635d835b60aae973281f2664 | 1,435 | https://github.com/xhan/qqbot/blob/9ddeb4dad8091333635d835b60aae973281f2664/tests/bot.coffee | 51 | 59 | ||
xhan/qqbot:tests/bot.coffee:2:completion | completion | # BY 2769546520
bot.update_group_member({name:"qqbot群"}) | api.long_poll auth_opts, (ret,e)->
log e if e
log ret
bot.handle_poll_responce(ret)
# | CoffeeScript | CoffeeScript | xhan/qqbot | tests/bot.coffee | MIT | 9ddeb4dad8091333635d835b60aae973281f2664 | 1,435 | https://github.com/xhan/qqbot/blob/9ddeb4dad8091333635d835b60aae973281f2664/tests/bot.coffee | 51 | 59 |
xhan/qqbot:tests/bot.coffee:1:raw_corpus | raw_corpus | #!/usr/bin/env coffee
# qqbot相关的测试代码
int = (v) -> parseInt v
log = console.log
jsons = JSON.stringify
auth = require "../src/qqauth"
api = require "../src/qqapi"
QQBot = require "../src/qqbot"
config = require '../config'
qq = config.account
pass = config.password
api.defaults_read()
psessionid = api.defaults '... | CoffeeScript | xhan/qqbot | tests/bot.coffee | MIT | 650f1919840a2c1e3cb45bf162b1743ea536f54c | 1,435 | https://github.com/xhan/qqbot/blob/650f1919840a2c1e3cb45bf162b1743ea536f54c/tests/bot.coffee | 1 | 50 | ||
xhan/qqbot:tests/bot.coffee:1:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
#!/usr/bin/env coffee
# qqbot相关的测试代码
int = (v) -> parseInt v
log = console.log
jsons = JSON.stringify
auth = require "../src/qqauth"
api = require "../src/qqapi"
QQBot = require "../src/qqbot"
config = require '../config'
qq = config.account
pass = config.pa... | //!/usr/bin/env coffee
// qqbot相关的测试代码
var QQBot, api, auth, auth_opts, bot, clientid, config, int, jsons, log, pass, psessionid, ptwebqq, qq, uin, vfwebqq;
int = function(v) {
return parseInt(v);
};
log = console.log;
jsons = JSON.stringify;
auth = require("../src/qqauth");
api = require("../src/qqapi");
QQBo... | CoffeeScript | JavaScript | xhan/qqbot | tests/bot.coffee | MIT | 650f1919840a2c1e3cb45bf162b1743ea536f54c | 1,435 | https://github.com/xhan/qqbot/blob/650f1919840a2c1e3cb45bf162b1743ea536f54c/tests/bot.coffee | 1 | 50 |
xhan/qqbot:tests/bot.coffee:1:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
//!/usr/bin/env coffee
// qqbot相关的测试代码
var QQBot, api, auth, auth_opts, bot, clientid, config, int, jsons, log, pass, psessionid, ptwebqq, qq, uin, vfwebqq;
int = function(v) {
return parseInt(v);
};
log = console.log;
jsons = JSON.stringify;
auth = require(... | #!/usr/bin/env coffee
# qqbot相关的测试代码
int = (v) -> parseInt v
log = console.log
jsons = JSON.stringify
auth = require "../src/qqauth"
api = require "../src/qqapi"
QQBot = require "../src/qqbot"
config = require '../config'
qq = config.account
pass = config.password
api.defaults_read()
psessionid = api.defaults '... | JavaScript | CoffeeScript | xhan/qqbot | tests/bot.coffee | MIT | 650f1919840a2c1e3cb45bf162b1743ea536f54c | 1,435 | https://github.com/xhan/qqbot/blob/650f1919840a2c1e3cb45bf162b1743ea536f54c/tests/bot.coffee | 1 | 50 |
xhan/qqbot:tests/bot.coffee:1:completion | completion | #!/usr/bin/env coffee
# qqbot相关的测试代码
int = (v) -> parseInt v
log = console.log
jsons = JSON.stringify
auth = require "../src/qqauth"
api = require "../src/qqapi"
QQBot = require "../src/qqbot"
config = require '../config'
qq = config.account
pass = config.password
api.defaults_read()
psessionid = api.defaults '... | psessionid
clientid
ptwebqq
uin
vfwebqq
}
bot = new QQBot("叫我小可爱")
api.get_buddy_list auth_opts, (ret,e)->
log e if e
log 'friend',ret
log ''
bot.save_buddy_info ret.result if ret.retcode == 0
api.get_group_list auth_opts, (ret , e)->
log e if e
log 'group',ret
log ''
... | CoffeeScript | CoffeeScript | xhan/qqbot | tests/bot.coffee | MIT | 650f1919840a2c1e3cb45bf162b1743ea536f54c | 1,435 | https://github.com/xhan/qqbot/blob/650f1919840a2c1e3cb45bf162b1743ea536f54c/tests/bot.coffee | 1 | 50 |
jianliaoim/talk-os:talk-api2x/server/schemas/index.coffee:1:raw_corpus | raw_corpus | methods =
$save: ->
model = this
new Promise (resolve, reject) ->
model.save (err, model) ->
return reject(err) if err
resolve model
$remove: ->
model = this
new Promise (resolve, reject) ->
model.remove (err, model) ->
return reject(err) if err
resolve mo... | CoffeeScript | jianliaoim/talk-os | talk-api2x/server/schemas/index.coffee | MIT | 2545c4497865779a55762e03963a39237df9046b | 2,703 | https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-api2x/server/schemas/index.coffee | 77 | 126 | ||
jianliaoim/talk-os:talk-api2x/server/schemas/index.coffee:1:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
methods =
$save: ->
model = this
new Promise (resolve, reject) ->
model.save (err, model) ->
return reject(err) if err
resolve model
$remove: ->
model = this
new Promise (resolve, reject) ->
model.remove (err, model... | var methods, overwrites, schemas;
methods = {
$save: function() {
var model;
model = this;
return new Promise(function(resolve, reject) {
return model.save(function(err, model) {
if (err) {
return reject(err);
}
return resolve(model);
});
});
},
$remo... | CoffeeScript | JavaScript | jianliaoim/talk-os | talk-api2x/server/schemas/index.coffee | MIT | 2545c4497865779a55762e03963a39237df9046b | 2,703 | https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-api2x/server/schemas/index.coffee | 77 | 126 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.