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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
xhan/qqbot:tests/main.coffee:8:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
var after_logined;
after_logined = function() {
var client_id, psessionid, ptwebqq, uin, vfwebqq;
psessionid = api.defaults('psessionid');
client_id = api.defaults('clientid');
ptwebqq = api.defaults('ptwebqq');
uin = api.defaults('uin');
vfwebqq = api... | after_logined = ->
psessionid = api.defaults 'psessionid'
client_id = api.defaults 'clientid'
ptwebqq = api.defaults 'ptwebqq'
uin = api.defaults 'uin'
vfwebqq = api.defaults 'vfwebqq'
api.long_poll client_id , psessionid , (ret)->
log ret
api.get_friend_list uin, p... | JavaScript | CoffeeScript | xhan/qqbot | tests/main.coffee | MIT | ac7a9bd1a1d3e8c3beae93a884de07392ea38afd | 1,435 | https://github.com/xhan/qqbot/blob/ac7a9bd1a1d3e8c3beae93a884de07392ea38afd/tests/main.coffee | 97 | 117 |
xhan/qqbot:tests/main.coffee:8:completion | completion | after_logined = ->
psessionid = api.defaults 'psessionid'
client_id = api.defaults 'clientid'
ptwebqq = api.defaults 'ptwebqq'
uin = api.defaults 'uin'
vfwebqq = api.defaults 'vfwebqq'
api.long_poll client_id , psessionid , (ret)-> | log ret
api.get_friend_list uin, ptwebqq, vfwebqq, (ret,e)->
log 'friend',ret
api.get_group_list vfwebqq, (ret , e)->
log 'group',ret
# 86784314
api.get_group_member 86784314, vfwebqq , (ret,e)->
log 'group_member' , ret | CoffeeScript | CoffeeScript | xhan/qqbot | tests/main.coffee | MIT | ac7a9bd1a1d3e8c3beae93a884de07392ea38afd | 1,435 | https://github.com/xhan/qqbot/blob/ac7a9bd1a1d3e8c3beae93a884de07392ea38afd/tests/main.coffee | 97 | 117 |
xhan/qqbot:tests/main.coffee:8:raw_corpus | raw_corpus | after_logined = ->
psessionid = api.defaults 'psessionid'
client_id = api.defaults 'clientid'
ptwebqq = api.defaults 'ptwebqq'
uin = api.defaults 'uin'
vfwebqq = api.defaults 'vfwebqq'
api.long_poll client_id , psessionid , (ret)->
log ret
api.get_friend_list uin, p... | CoffeeScript | xhan/qqbot | tests/main.coffee | MIT | 603eb7e07d8eee1868bf930c335d7a1b6c6f78e5 | 1,435 | https://github.com/xhan/qqbot/blob/603eb7e07d8eee1868bf930c335d7a1b6c6f78e5/tests/main.coffee | 97 | 113 | ||
xhan/qqbot:tests/main.coffee:8:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
after_logined = ->
psessionid = api.defaults 'psessionid'
client_id = api.defaults 'clientid'
ptwebqq = api.defaults 'ptwebqq'
uin = api.defaults 'uin'
vfwebqq = api.defaults 'vfwebqq'
api.long_poll client_id , psessionid ... | var after_logined;
after_logined = function() {
var client_id, psessionid, ptwebqq, uin, vfwebqq;
psessionid = api.defaults('psessionid');
client_id = api.defaults('clientid');
ptwebqq = api.defaults('ptwebqq');
uin = api.defaults('uin');
vfwebqq = api.defaults('vfwebqq');
api.long_poll(client_id, psessi... | CoffeeScript | JavaScript | xhan/qqbot | tests/main.coffee | MIT | 603eb7e07d8eee1868bf930c335d7a1b6c6f78e5 | 1,435 | https://github.com/xhan/qqbot/blob/603eb7e07d8eee1868bf930c335d7a1b6c6f78e5/tests/main.coffee | 97 | 113 |
xhan/qqbot:tests/main.coffee:8:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
var after_logined;
after_logined = function() {
var client_id, psessionid, ptwebqq, uin, vfwebqq;
psessionid = api.defaults('psessionid');
client_id = api.defaults('clientid');
ptwebqq = api.defaults('ptwebqq');
uin = api.defaults('uin');
vfwebqq = api... | after_logined = ->
psessionid = api.defaults 'psessionid'
client_id = api.defaults 'clientid'
ptwebqq = api.defaults 'ptwebqq'
uin = api.defaults 'uin'
vfwebqq = api.defaults 'vfwebqq'
api.long_poll client_id , psessionid , (ret)->
log ret
api.get_friend_list uin, p... | JavaScript | CoffeeScript | xhan/qqbot | tests/main.coffee | MIT | 603eb7e07d8eee1868bf930c335d7a1b6c6f78e5 | 1,435 | https://github.com/xhan/qqbot/blob/603eb7e07d8eee1868bf930c335d7a1b6c6f78e5/tests/main.coffee | 97 | 113 |
xhan/qqbot:tests/main.coffee:8:completion | completion | after_logined = ->
psessionid = api.defaults 'psessionid'
client_id = api.defaults 'clientid'
ptwebqq = api.defaults 'ptwebqq'
uin = api.defaults 'uin'
vfwebqq = api.defaults 'vfwebqq' | api.long_poll client_id , psessionid , (ret)->
log ret
api.get_friend_list uin, ptwebqq, vfwebqq, (ret,e)->
log 'friend',ret
api.get_group_list vfwebqq, (ret , e)->
log 'group',ret | CoffeeScript | CoffeeScript | xhan/qqbot | tests/main.coffee | MIT | 603eb7e07d8eee1868bf930c335d7a1b6c6f78e5 | 1,435 | https://github.com/xhan/qqbot/blob/603eb7e07d8eee1868bf930c335d7a1b6c6f78e5/tests/main.coffee | 97 | 113 |
xhan/qqbot:tests/main.coffee:1:raw_corpus | raw_corpus | int = (v) -> parseInt v
log = console.log
auth = require "../src/qqauth"
api = require "../src/qqapi"
log "testing..."
config = require '../config'
qq = config.account
pass = config.password | CoffeeScript | xhan/qqbot | tests/main.coffee | MIT | d11c6934d16cfdd64d5e1692e7e62ceb9a87ec07 | 1,435 | https://github.com/xhan/qqbot/blob/d11c6934d16cfdd64d5e1692e7e62ceb9a87ec07/tests/main.coffee | 3 | 12 | ||
xhan/qqbot:tests/main.coffee:1:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
int = (v) -> parseInt v
log = console.log
auth = require "../src/qqauth"
api = require "../src/qqapi"
log "testing..."
config = require '../config'
qq = config.account
pass = config.password
``` | var api, auth, config, int, log, pass, qq;
int = function(v) {
return parseInt(v);
};
log = console.log;
auth = require("../src/qqauth");
api = require("../src/qqapi");
log("testing...");
config = require('../config');
qq = config.account;
pass = config.password; | CoffeeScript | JavaScript | xhan/qqbot | tests/main.coffee | MIT | d11c6934d16cfdd64d5e1692e7e62ceb9a87ec07 | 1,435 | https://github.com/xhan/qqbot/blob/d11c6934d16cfdd64d5e1692e7e62ceb9a87ec07/tests/main.coffee | 3 | 12 |
xhan/qqbot:tests/main.coffee:1:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
var api, auth, config, int, log, pass, qq;
int = function(v) {
return parseInt(v);
};
log = console.log;
auth = require("../src/qqauth");
api = require("../src/qqapi");
log("testing...");
config = require('../config');
qq = config.account;
pass = config.p... | int = (v) -> parseInt v
log = console.log
auth = require "../src/qqauth"
api = require "../src/qqapi"
log "testing..."
config = require '../config'
qq = config.account
pass = config.password | JavaScript | CoffeeScript | xhan/qqbot | tests/main.coffee | MIT | d11c6934d16cfdd64d5e1692e7e62ceb9a87ec07 | 1,435 | https://github.com/xhan/qqbot/blob/d11c6934d16cfdd64d5e1692e7e62ceb9a87ec07/tests/main.coffee | 3 | 12 |
xhan/qqbot:tests/main.coffee:1:completion | completion | int = (v) -> parseInt v
log = console.log
auth = require "../src/qqauth"
api = require "../src/qqapi" | log "testing..."
config = require '../config'
qq = config.account
pass = config.password | CoffeeScript | CoffeeScript | xhan/qqbot | tests/main.coffee | MIT | d11c6934d16cfdd64d5e1692e7e62ceb9a87ec07 | 1,435 | https://github.com/xhan/qqbot/blob/d11c6934d16cfdd64d5e1692e7e62ceb9a87ec07/tests/main.coffee | 3 | 12 |
xhan/qqbot:tests/main.coffee:6:raw_corpus | raw_corpus | test_login_full = ->
login_next = (qq , encoded_pass , verify_code)->
log "开始登录1 密码校验"
auth.login qq, encoded_pass , verify_code , (ret)->
log '登录结果'
log ret
return unless ret[2].match /^http/
log "开始登录2 cookie获取"
auth.login_step2 ret[2] ... | CoffeeScript | xhan/qqbot | tests/main.coffee | MIT | d11c6934d16cfdd64d5e1692e7e62ceb9a87ec07 | 1,435 | https://github.com/xhan/qqbot/blob/d11c6934d16cfdd64d5e1692e7e62ceb9a87ec07/tests/main.coffee | 45 | 93 | ||
xhan/qqbot:tests/main.coffee:6:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
test_login_full = ->
login_next = (qq , encoded_pass , verify_code)->
log "开始登录1 密码校验"
auth.login qq, encoded_pass , verify_code , (ret)->
log '登录结果'
log ret
return unless ret[2].match /^http/
... | var test_login_full;
test_login_full = function() {
var login_next;
login_next = function(qq, encoded_pass, verify_code) {
log("开始登录1 密码校验");
return auth.login(qq, encoded_pass, verify_code, function(ret) {
log('登录结果');
log(ret);
if (!ret[2].match(/^http/)) {
return;
}
... | CoffeeScript | JavaScript | xhan/qqbot | tests/main.coffee | MIT | d11c6934d16cfdd64d5e1692e7e62ceb9a87ec07 | 1,435 | https://github.com/xhan/qqbot/blob/d11c6934d16cfdd64d5e1692e7e62ceb9a87ec07/tests/main.coffee | 45 | 93 |
xhan/qqbot:tests/main.coffee:6:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
var test_login_full;
test_login_full = function() {
var login_next;
login_next = function(qq, encoded_pass, verify_code) {
log("开始登录1 密码校验");
return auth.login(qq, encoded_pass, verify_code, function(ret) {
log('登录结果');
log(ret);
if (... | test_login_full = ->
login_next = (qq , encoded_pass , verify_code)->
log "开始登录1 密码校验"
auth.login qq, encoded_pass , verify_code , (ret)->
log '登录结果'
log ret
return unless ret[2].match /^http/
log "开始登录2 cookie获取"
auth.login_step2 ret[2] ... | JavaScript | CoffeeScript | xhan/qqbot | tests/main.coffee | MIT | d11c6934d16cfdd64d5e1692e7e62ceb9a87ec07 | 1,435 | https://github.com/xhan/qqbot/blob/d11c6934d16cfdd64d5e1692e7e62ceb9a87ec07/tests/main.coffee | 45 | 93 |
xhan/qqbot:tests/main.coffee:6:completion | completion | test_login_full = ->
login_next = (qq , encoded_pass , verify_code)->
log "开始登录1 密码校验"
auth.login qq, encoded_pass , verify_code , (ret)->
log '登录结果'
log ret
return unless ret[2].match /^http/
log "开始登录2 cookie获取"
auth.login_step2 ret[2] ... | log "验证帐号..."
auth.check_qq qq , (result) ->
# log "验证帐号:", result
is_need_verify_code = int result[0]
verify_code = result[1]
bits = result[2]
#TODO: login_next 异步破坏了代码的结构性,这块如何优化
if is_need_verify_code
log "需要验证码...获取中..."
auth.get_verify_c... | CoffeeScript | CoffeeScript | xhan/qqbot | tests/main.coffee | MIT | d11c6934d16cfdd64d5e1692e7e62ceb9a87ec07 | 1,435 | https://github.com/xhan/qqbot/blob/d11c6934d16cfdd64d5e1692e7e62ceb9a87ec07/tests/main.coffee | 45 | 93 |
xhan/qqbot:tests/main.coffee:9:raw_corpus | raw_corpus | test_long_pull = ->
api.long_pull
# test_check_qq()
# test_encode_password2()
test_login_full()
# test_login_token()
# test_get_verify_code() | CoffeeScript | xhan/qqbot | tests/main.coffee | MIT | d11c6934d16cfdd64d5e1692e7e62ceb9a87ec07 | 1,435 | https://github.com/xhan/qqbot/blob/d11c6934d16cfdd64d5e1692e7e62ceb9a87ec07/tests/main.coffee | 104 | 114 | ||
xhan/qqbot:tests/main.coffee:9:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
test_long_pull = ->
api.long_pull
# test_check_qq()
# test_encode_password2()
test_login_full()
# test_login_token()
# test_get_verify_code()
``` | var test_long_pull;
test_long_pull = function() {
return api.long_pull;
};
// test_check_qq()
// test_encode_password2()
test_login_full();
// test_login_token()
// test_get_verify_code() | CoffeeScript | JavaScript | xhan/qqbot | tests/main.coffee | MIT | d11c6934d16cfdd64d5e1692e7e62ceb9a87ec07 | 1,435 | https://github.com/xhan/qqbot/blob/d11c6934d16cfdd64d5e1692e7e62ceb9a87ec07/tests/main.coffee | 104 | 114 |
xhan/qqbot:tests/main.coffee:9:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
var test_long_pull;
test_long_pull = function() {
return api.long_pull;
};
// test_check_qq()
// test_encode_password2()
test_login_full();
// test_login_token()
// test_get_verify_code()
``` | test_long_pull = ->
api.long_pull
# test_check_qq()
# test_encode_password2()
test_login_full()
# test_login_token()
# test_get_verify_code() | JavaScript | CoffeeScript | xhan/qqbot | tests/main.coffee | MIT | d11c6934d16cfdd64d5e1692e7e62ceb9a87ec07 | 1,435 | https://github.com/xhan/qqbot/blob/d11c6934d16cfdd64d5e1692e7e62ceb9a87ec07/tests/main.coffee | 104 | 114 |
xhan/qqbot:tests/main.coffee:1:raw_corpus | raw_corpus | int = (v) -> parseInt v
log = console.log
auth = require("../src/qqauth")
log "testing..."
config = require '../config'
qq = config.account
pass = config.password | CoffeeScript | xhan/qqbot | tests/main.coffee | MIT | a3b2188eea9ffeddfa60644f52f4ad28d9213462 | 1,435 | https://github.com/xhan/qqbot/blob/a3b2188eea9ffeddfa60644f52f4ad28d9213462/tests/main.coffee | 3 | 12 | ||
xhan/qqbot:tests/main.coffee:1:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
int = (v) -> parseInt v
log = console.log
auth = require("../src/qqauth")
log "testing..."
config = require '../config'
qq = config.account
pass = config.password
``` | var auth, config, int, log, pass, qq;
int = function(v) {
return parseInt(v);
};
log = console.log;
auth = require("../src/qqauth");
log("testing...");
config = require('../config');
qq = config.account;
pass = config.password; | CoffeeScript | JavaScript | xhan/qqbot | tests/main.coffee | MIT | a3b2188eea9ffeddfa60644f52f4ad28d9213462 | 1,435 | https://github.com/xhan/qqbot/blob/a3b2188eea9ffeddfa60644f52f4ad28d9213462/tests/main.coffee | 3 | 12 |
xhan/qqbot:tests/main.coffee:1:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
var auth, config, int, log, pass, qq;
int = function(v) {
return parseInt(v);
};
log = console.log;
auth = require("../src/qqauth");
log("testing...");
config = require('../config');
qq = config.account;
pass = config.password;
``` | int = (v) -> parseInt v
log = console.log
auth = require("../src/qqauth")
log "testing..."
config = require '../config'
qq = config.account
pass = config.password | JavaScript | CoffeeScript | xhan/qqbot | tests/main.coffee | MIT | a3b2188eea9ffeddfa60644f52f4ad28d9213462 | 1,435 | https://github.com/xhan/qqbot/blob/a3b2188eea9ffeddfa60644f52f4ad28d9213462/tests/main.coffee | 3 | 12 |
xhan/qqbot:tests/main.coffee:1:completion | completion | int = (v) -> parseInt v
log = console.log
auth = require("../src/qqauth") | log "testing..."
config = require '../config'
qq = config.account
pass = config.password | CoffeeScript | CoffeeScript | xhan/qqbot | tests/main.coffee | MIT | a3b2188eea9ffeddfa60644f52f4ad28d9213462 | 1,435 | https://github.com/xhan/qqbot/blob/a3b2188eea9ffeddfa60644f52f4ad28d9213462/tests/main.coffee | 3 | 12 |
xhan/qqbot:tests/main.coffee:5:raw_corpus | raw_corpus | test_encode_password2 = ->
# verify zkmm
# '4GJSgm18Bw-8yw5JGKpSOXH-0idqvaCU'
# \x00\x00\x00\x00\xa5\x13\xed\x18
log auth.encode_password(pass,'zkmm','\\x00\\x00\\x00\\x00\\xa5\\x13\\xed\\x18')
# should equal to F16B5C4EBE52641313403CB93C0FF569 | CoffeeScript | xhan/qqbot | tests/main.coffee | MIT | a3b2188eea9ffeddfa60644f52f4ad28d9213462 | 1,435 | https://github.com/xhan/qqbot/blob/a3b2188eea9ffeddfa60644f52f4ad28d9213462/tests/main.coffee | 40 | 45 | ||
xhan/qqbot:tests/main.coffee:5:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
test_encode_password2 = ->
# verify zkmm
# '4GJSgm18Bw-8yw5JGKpSOXH-0idqvaCU'
# \x00\x00\x00\x00\xa5\x13\xed\x18
log auth.encode_password(pass,'zkmm','\\x00\\x00\\x00\\x00\\xa5\\x13\\xed\\x18')
# should equal to F16B5C4EBE52641313403CB93C0FF56... | var test_encode_password2;
test_encode_password2 = function() {
// verify zkmm
// '4GJSgm18Bw-8yw5JGKpSOXH-0idqvaCU'
// \x00\x00\x00\x00\xa5\x13\xed\x18
return log(auth.encode_password(pass, 'zkmm', '\\x00\\x00\\x00\\x00\\xa5\\x13\\xed\\x18'));
};
// should equal to F16B5C4EBE52641313403CB93C0FF569 | CoffeeScript | JavaScript | xhan/qqbot | tests/main.coffee | MIT | a3b2188eea9ffeddfa60644f52f4ad28d9213462 | 1,435 | https://github.com/xhan/qqbot/blob/a3b2188eea9ffeddfa60644f52f4ad28d9213462/tests/main.coffee | 40 | 45 |
xhan/qqbot:tests/main.coffee:5:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
var test_encode_password2;
test_encode_password2 = function() {
// verify zkmm
// '4GJSgm18Bw-8yw5JGKpSOXH-0idqvaCU'
// \x00\x00\x00\x00\xa5\x13\xed\x18
return log(auth.encode_password(pass, 'zkmm', '\\x00\\x00\\x00\\x00\\xa5\\x13\\xed\\x18'));
};
// shou... | test_encode_password2 = ->
# verify zkmm
# '4GJSgm18Bw-8yw5JGKpSOXH-0idqvaCU'
# \x00\x00\x00\x00\xa5\x13\xed\x18
log auth.encode_password(pass,'zkmm','\\x00\\x00\\x00\\x00\\xa5\\x13\\xed\\x18')
# should equal to F16B5C4EBE52641313403CB93C0FF569 | JavaScript | CoffeeScript | xhan/qqbot | tests/main.coffee | MIT | a3b2188eea9ffeddfa60644f52f4ad28d9213462 | 1,435 | https://github.com/xhan/qqbot/blob/a3b2188eea9ffeddfa60644f52f4ad28d9213462/tests/main.coffee | 40 | 45 |
xhan/qqbot:tests/main.coffee:5:completion | completion | test_encode_password2 = ->
# verify zkmm
# '4GJSgm18Bw-8yw5JGKpSOXH-0idqvaCU' | # \x00\x00\x00\x00\xa5\x13\xed\x18
log auth.encode_password(pass,'zkmm','\\x00\\x00\\x00\\x00\\xa5\\x13\\xed\\x18')
# should equal to F16B5C4EBE52641313403CB93C0FF569 | CoffeeScript | CoffeeScript | xhan/qqbot | tests/main.coffee | MIT | a3b2188eea9ffeddfa60644f52f4ad28d9213462 | 1,435 | https://github.com/xhan/qqbot/blob/a3b2188eea9ffeddfa60644f52f4ad28d9213462/tests/main.coffee | 40 | 45 |
xhan/qqbot:tests/main.coffee:6:raw_corpus | raw_corpus | test_login_full = ->
login_next = (qq , encoded_pass , verify_code)->
log "开始登录1 密码校验"
auth.login qq, encoded_pass , verify_code , (ret)->
log '登录结果'
log ret
return unless ret[2].match /^http/
log "开始登录2 cookie获取"
auth.login_step2 ret[2] ... | CoffeeScript | xhan/qqbot | tests/main.coffee | MIT | a3b2188eea9ffeddfa60644f52f4ad28d9213462 | 1,435 | https://github.com/xhan/qqbot/blob/a3b2188eea9ffeddfa60644f52f4ad28d9213462/tests/main.coffee | 48 | 85 | ||
xhan/qqbot:tests/main.coffee:6:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
test_login_full = ->
login_next = (qq , encoded_pass , verify_code)->
log "开始登录1 密码校验"
auth.login qq, encoded_pass , verify_code , (ret)->
log '登录结果'
log ret
return unless ret[2].match /^http/
... | var test_login_full;
test_login_full = function() {
var login_next;
login_next = function(qq, encoded_pass, verify_code) {
log("开始登录1 密码校验");
return auth.login(qq, encoded_pass, verify_code, function(ret) {
log('登录结果');
log(ret);
if (!ret[2].match(/^http/)) {
return;
}
... | CoffeeScript | JavaScript | xhan/qqbot | tests/main.coffee | MIT | a3b2188eea9ffeddfa60644f52f4ad28d9213462 | 1,435 | https://github.com/xhan/qqbot/blob/a3b2188eea9ffeddfa60644f52f4ad28d9213462/tests/main.coffee | 48 | 85 |
xhan/qqbot:tests/main.coffee:6:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
var test_login_full;
test_login_full = function() {
var login_next;
login_next = function(qq, encoded_pass, verify_code) {
log("开始登录1 密码校验");
return auth.login(qq, encoded_pass, verify_code, function(ret) {
log('登录结果');
log(ret);
if (... | test_login_full = ->
login_next = (qq , encoded_pass , verify_code)->
log "开始登录1 密码校验"
auth.login qq, encoded_pass , verify_code , (ret)->
log '登录结果'
log ret
return unless ret[2].match /^http/
log "开始登录2 cookie获取"
auth.login_step2 ret[2] ... | JavaScript | CoffeeScript | xhan/qqbot | tests/main.coffee | MIT | a3b2188eea9ffeddfa60644f52f4ad28d9213462 | 1,435 | https://github.com/xhan/qqbot/blob/a3b2188eea9ffeddfa60644f52f4ad28d9213462/tests/main.coffee | 48 | 85 |
xhan/qqbot:tests/main.coffee:6:completion | completion | test_login_full = ->
login_next = (qq , encoded_pass , verify_code)->
log "开始登录1 密码校验"
auth.login qq, encoded_pass , verify_code , (ret)->
log '登录结果'
log ret
return unless ret[2].match /^http/
log "开始登录2 cookie获取"
auth.login_step2 ret[2] ... | verify_code = result[1]
bits = result[2]
#TODO: login_next 异步破坏了代码的结构性,这块如何优化
if is_need_verify_code
log "需要验证码...获取中..."
auth.get_verify_code qq, config.host, config.port, (error) ->
require('child_process').exec 'open tmp'
log "http://... | CoffeeScript | CoffeeScript | xhan/qqbot | tests/main.coffee | MIT | a3b2188eea9ffeddfa60644f52f4ad28d9213462 | 1,435 | https://github.com/xhan/qqbot/blob/a3b2188eea9ffeddfa60644f52f4ad28d9213462/tests/main.coffee | 48 | 85 |
xhan/qqbot:tests/main.coffee:8:raw_corpus | raw_corpus | test_get_verify_code = ->
auth.get_verify_code qq, config.host, config.port, (error) ->
log 'oh yeah'
# test_check_qq()
# test_encode_password2()
test_login_full()
# test_login_token()
# test_get_verify_code() | CoffeeScript | xhan/qqbot | tests/main.coffee | MIT | a3b2188eea9ffeddfa60644f52f4ad28d9213462 | 1,435 | https://github.com/xhan/qqbot/blob/a3b2188eea9ffeddfa60644f52f4ad28d9213462/tests/main.coffee | 92 | 101 | ||
xhan/qqbot:tests/main.coffee:8:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
test_get_verify_code = ->
auth.get_verify_code qq, config.host, config.port, (error) ->
log 'oh yeah'
# test_check_qq()
# test_encode_password2()
test_login_full()
# test_login_token()
# test_get_verify_code()
``` | var test_get_verify_code;
test_get_verify_code = function() {
return auth.get_verify_code(qq, config.host, config.port, function(error) {
return log('oh yeah');
});
};
// test_check_qq()
// test_encode_password2()
test_login_full();
// test_login_token()
// test_get_verify_code() | CoffeeScript | JavaScript | xhan/qqbot | tests/main.coffee | MIT | a3b2188eea9ffeddfa60644f52f4ad28d9213462 | 1,435 | https://github.com/xhan/qqbot/blob/a3b2188eea9ffeddfa60644f52f4ad28d9213462/tests/main.coffee | 92 | 101 |
xhan/qqbot:tests/main.coffee:8:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
var test_get_verify_code;
test_get_verify_code = function() {
return auth.get_verify_code(qq, config.host, config.port, function(error) {
return log('oh yeah');
});
};
// test_check_qq()
// test_encode_password2()
test_login_full();
// test_login_token()... | test_get_verify_code = ->
auth.get_verify_code qq, config.host, config.port, (error) ->
log 'oh yeah'
# test_check_qq()
# test_encode_password2()
test_login_full()
# test_login_token()
# test_get_verify_code() | JavaScript | CoffeeScript | xhan/qqbot | tests/main.coffee | MIT | a3b2188eea9ffeddfa60644f52f4ad28d9213462 | 1,435 | https://github.com/xhan/qqbot/blob/a3b2188eea9ffeddfa60644f52f4ad28d9213462/tests/main.coffee | 92 | 101 |
xhan/qqbot:tests/main.coffee:1:raw_corpus | raw_corpus | int = (v) -> parseInt v
log = console.log
api = require("../src/qqapi")
log "testing..."
config = require '../config'
qq = config.account
pass = config.password | CoffeeScript | xhan/qqbot | tests/main.coffee | MIT | 6cd2e1127421f1307ba64b6c9fdff905d9a9e921 | 1,435 | https://github.com/xhan/qqbot/blob/6cd2e1127421f1307ba64b6c9fdff905d9a9e921/tests/main.coffee | 3 | 12 | ||
xhan/qqbot:tests/main.coffee:1:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
int = (v) -> parseInt v
log = console.log
api = require("../src/qqapi")
log "testing..."
config = require '../config'
qq = config.account
pass = config.password
``` | var api, config, int, log, pass, qq;
int = function(v) {
return parseInt(v);
};
log = console.log;
api = require("../src/qqapi");
log("testing...");
config = require('../config');
qq = config.account;
pass = config.password; | CoffeeScript | JavaScript | xhan/qqbot | tests/main.coffee | MIT | 6cd2e1127421f1307ba64b6c9fdff905d9a9e921 | 1,435 | https://github.com/xhan/qqbot/blob/6cd2e1127421f1307ba64b6c9fdff905d9a9e921/tests/main.coffee | 3 | 12 |
xhan/qqbot:tests/main.coffee:1:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
var api, config, int, log, pass, qq;
int = function(v) {
return parseInt(v);
};
log = console.log;
api = require("../src/qqapi");
log("testing...");
config = require('../config');
qq = config.account;
pass = config.password;
``` | int = (v) -> parseInt v
log = console.log
api = require("../src/qqapi")
log "testing..."
config = require '../config'
qq = config.account
pass = config.password | JavaScript | CoffeeScript | xhan/qqbot | tests/main.coffee | MIT | 6cd2e1127421f1307ba64b6c9fdff905d9a9e921 | 1,435 | https://github.com/xhan/qqbot/blob/6cd2e1127421f1307ba64b6c9fdff905d9a9e921/tests/main.coffee | 3 | 12 |
xhan/qqbot:tests/main.coffee:1:completion | completion | int = (v) -> parseInt v
log = console.log
api = require("../src/qqapi") | log "testing..."
config = require '../config'
qq = config.account
pass = config.password | CoffeeScript | CoffeeScript | xhan/qqbot | tests/main.coffee | MIT | 6cd2e1127421f1307ba64b6c9fdff905d9a9e921 | 1,435 | https://github.com/xhan/qqbot/blob/6cd2e1127421f1307ba64b6c9fdff905d9a9e921/tests/main.coffee | 3 | 12 |
xhan/qqbot:tests/main.coffee:3:raw_corpus | raw_corpus | test_check_qq = ->
api.check_qq '123774072' , (result) ->
log int result[0]
log result[1]
log result[2] | CoffeeScript | xhan/qqbot | tests/main.coffee | MIT | 6cd2e1127421f1307ba64b6c9fdff905d9a9e921 | 1,435 | https://github.com/xhan/qqbot/blob/6cd2e1127421f1307ba64b6c9fdff905d9a9e921/tests/main.coffee | 28 | 32 | ||
xhan/qqbot:tests/main.coffee:3:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
test_check_qq = ->
api.check_qq '123774072' , (result) ->
log int result[0]
log result[1]
log result[2]
``` | var test_check_qq;
test_check_qq = function() {
return api.check_qq('123774072', function(result) {
log(int(result[0]));
log(result[1]);
return log(result[2]);
});
}; | CoffeeScript | JavaScript | xhan/qqbot | tests/main.coffee | MIT | 6cd2e1127421f1307ba64b6c9fdff905d9a9e921 | 1,435 | https://github.com/xhan/qqbot/blob/6cd2e1127421f1307ba64b6c9fdff905d9a9e921/tests/main.coffee | 28 | 32 |
xhan/qqbot:tests/main.coffee:3:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
var test_check_qq;
test_check_qq = function() {
return api.check_qq('123774072', function(result) {
log(int(result[0]));
log(result[1]);
return log(result[2]);
});
};
``` | test_check_qq = ->
api.check_qq '123774072' , (result) ->
log int result[0]
log result[1]
log result[2] | JavaScript | CoffeeScript | xhan/qqbot | tests/main.coffee | MIT | 6cd2e1127421f1307ba64b6c9fdff905d9a9e921 | 1,435 | https://github.com/xhan/qqbot/blob/6cd2e1127421f1307ba64b6c9fdff905d9a9e921/tests/main.coffee | 28 | 32 |
xhan/qqbot:tests/main.coffee:4:raw_corpus | raw_corpus | test_encode_password = ->
log api.encode_password(pass,"!PYL",'\\x00\\x00\\x00\\x00\\x07\\x60\\xa4\\x78')
# should equal to 7BB648B45C561A5F986DECCD94644A3E
# 需要验证码的登录 | CoffeeScript | xhan/qqbot | tests/main.coffee | MIT | 6cd2e1127421f1307ba64b6c9fdff905d9a9e921 | 1,435 | https://github.com/xhan/qqbot/blob/6cd2e1127421f1307ba64b6c9fdff905d9a9e921/tests/main.coffee | 35 | 39 | ||
xhan/qqbot:tests/main.coffee:4:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
test_encode_password = ->
log api.encode_password(pass,"!PYL",'\\x00\\x00\\x00\\x00\\x07\\x60\\xa4\\x78')
# should equal to 7BB648B45C561A5F986DECCD94644A3E
# 需要验证码的登录
``` | var test_encode_password;
test_encode_password = function() {
return log(api.encode_password(pass, "!PYL", '\\x00\\x00\\x00\\x00\\x07\\x60\\xa4\\x78'));
};
// should equal to 7BB648B45C561A5F986DECCD94644A3E
// 需要验证码的登录 | CoffeeScript | JavaScript | xhan/qqbot | tests/main.coffee | MIT | 6cd2e1127421f1307ba64b6c9fdff905d9a9e921 | 1,435 | https://github.com/xhan/qqbot/blob/6cd2e1127421f1307ba64b6c9fdff905d9a9e921/tests/main.coffee | 35 | 39 |
xhan/qqbot:tests/main.coffee:4:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
var test_encode_password;
test_encode_password = function() {
return log(api.encode_password(pass, "!PYL", '\\x00\\x00\\x00\\x00\\x07\\x60\\xa4\\x78'));
};
// should equal to 7BB648B45C561A5F986DECCD94644A3E
// 需要验证码的登录
``` | test_encode_password = ->
log api.encode_password(pass,"!PYL",'\\x00\\x00\\x00\\x00\\x07\\x60\\xa4\\x78')
# should equal to 7BB648B45C561A5F986DECCD94644A3E
# 需要验证码的登录 | JavaScript | CoffeeScript | xhan/qqbot | tests/main.coffee | MIT | 6cd2e1127421f1307ba64b6c9fdff905d9a9e921 | 1,435 | https://github.com/xhan/qqbot/blob/6cd2e1127421f1307ba64b6c9fdff905d9a9e921/tests/main.coffee | 35 | 39 |
xhan/qqbot:tests/main.coffee:5:raw_corpus | raw_corpus | test_encode_password2 = ->
# verify zkmm
# '4GJSgm18Bw-8yw5JGKpSOXH-0idqvaCU'
# \x00\x00\x00\x00\xa5\x13\xed\x18
log api.encode_password(pass,'zkmm','\\x00\\x00\\x00\\x00\\xa5\\x13\\xed\\x18')
# should equal to F16B5C4EBE52641313403CB93C0FF569 | CoffeeScript | xhan/qqbot | tests/main.coffee | MIT | 6cd2e1127421f1307ba64b6c9fdff905d9a9e921 | 1,435 | https://github.com/xhan/qqbot/blob/6cd2e1127421f1307ba64b6c9fdff905d9a9e921/tests/main.coffee | 40 | 45 | ||
xhan/qqbot:tests/main.coffee:5:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
test_encode_password2 = ->
# verify zkmm
# '4GJSgm18Bw-8yw5JGKpSOXH-0idqvaCU'
# \x00\x00\x00\x00\xa5\x13\xed\x18
log api.encode_password(pass,'zkmm','\\x00\\x00\\x00\\x00\\xa5\\x13\\xed\\x18')
# should equal to F16B5C4EBE52641313403CB93C0FF569... | var test_encode_password2;
test_encode_password2 = function() {
// verify zkmm
// '4GJSgm18Bw-8yw5JGKpSOXH-0idqvaCU'
// \x00\x00\x00\x00\xa5\x13\xed\x18
return log(api.encode_password(pass, 'zkmm', '\\x00\\x00\\x00\\x00\\xa5\\x13\\xed\\x18'));
};
// should equal to F16B5C4EBE52641313403CB93C0FF569 | CoffeeScript | JavaScript | xhan/qqbot | tests/main.coffee | MIT | 6cd2e1127421f1307ba64b6c9fdff905d9a9e921 | 1,435 | https://github.com/xhan/qqbot/blob/6cd2e1127421f1307ba64b6c9fdff905d9a9e921/tests/main.coffee | 40 | 45 |
xhan/qqbot:tests/main.coffee:5:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
var test_encode_password2;
test_encode_password2 = function() {
// verify zkmm
// '4GJSgm18Bw-8yw5JGKpSOXH-0idqvaCU'
// \x00\x00\x00\x00\xa5\x13\xed\x18
return log(api.encode_password(pass, 'zkmm', '\\x00\\x00\\x00\\x00\\xa5\\x13\\xed\\x18'));
};
// shoul... | test_encode_password2 = ->
# verify zkmm
# '4GJSgm18Bw-8yw5JGKpSOXH-0idqvaCU'
# \x00\x00\x00\x00\xa5\x13\xed\x18
log api.encode_password(pass,'zkmm','\\x00\\x00\\x00\\x00\\xa5\\x13\\xed\\x18')
# should equal to F16B5C4EBE52641313403CB93C0FF569 | JavaScript | CoffeeScript | xhan/qqbot | tests/main.coffee | MIT | 6cd2e1127421f1307ba64b6c9fdff905d9a9e921 | 1,435 | https://github.com/xhan/qqbot/blob/6cd2e1127421f1307ba64b6c9fdff905d9a9e921/tests/main.coffee | 40 | 45 |
xhan/qqbot:tests/main.coffee:5:completion | completion | test_encode_password2 = ->
# verify zkmm
# '4GJSgm18Bw-8yw5JGKpSOXH-0idqvaCU' | # \x00\x00\x00\x00\xa5\x13\xed\x18
log api.encode_password(pass,'zkmm','\\x00\\x00\\x00\\x00\\xa5\\x13\\xed\\x18')
# should equal to F16B5C4EBE52641313403CB93C0FF569 | CoffeeScript | CoffeeScript | xhan/qqbot | tests/main.coffee | MIT | 6cd2e1127421f1307ba64b6c9fdff905d9a9e921 | 1,435 | https://github.com/xhan/qqbot/blob/6cd2e1127421f1307ba64b6c9fdff905d9a9e921/tests/main.coffee | 40 | 45 |
xhan/qqbot:tests/main.coffee:6:raw_corpus | raw_corpus | test_login_full = ->
login_next = (qq , encoded_pass , verify_code)->
log "开始登录1 密码校验"
api.login qq, encoded_pass , verify_code , (ret)->
log '登录结果'
log ret
return unless ret[2].match /^http/
log "开始登录2 cookie获取"
api.login_step2 ret[2] , ... | CoffeeScript | xhan/qqbot | tests/main.coffee | MIT | 6cd2e1127421f1307ba64b6c9fdff905d9a9e921 | 1,435 | https://github.com/xhan/qqbot/blob/6cd2e1127421f1307ba64b6c9fdff905d9a9e921/tests/main.coffee | 48 | 85 | ||
xhan/qqbot:tests/main.coffee:6:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
test_login_full = ->
login_next = (qq , encoded_pass , verify_code)->
log "开始登录1 密码校验"
api.login qq, encoded_pass , verify_code , (ret)->
log '登录结果'
log ret
return unless ret[2].match /^http/
l... | var test_login_full;
test_login_full = function() {
var login_next;
login_next = function(qq, encoded_pass, verify_code) {
log("开始登录1 密码校验");
return api.login(qq, encoded_pass, verify_code, function(ret) {
log('登录结果');
log(ret);
if (!ret[2].match(/^http/)) {
return;
}
... | CoffeeScript | JavaScript | xhan/qqbot | tests/main.coffee | MIT | 6cd2e1127421f1307ba64b6c9fdff905d9a9e921 | 1,435 | https://github.com/xhan/qqbot/blob/6cd2e1127421f1307ba64b6c9fdff905d9a9e921/tests/main.coffee | 48 | 85 |
xhan/qqbot:tests/main.coffee:6:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
var test_login_full;
test_login_full = function() {
var login_next;
login_next = function(qq, encoded_pass, verify_code) {
log("开始登录1 密码校验");
return api.login(qq, encoded_pass, verify_code, function(ret) {
log('登录结果');
log(ret);
if (!... | test_login_full = ->
login_next = (qq , encoded_pass , verify_code)->
log "开始登录1 密码校验"
api.login qq, encoded_pass , verify_code , (ret)->
log '登录结果'
log ret
return unless ret[2].match /^http/
log "开始登录2 cookie获取"
api.login_step2 ret[2] , ... | JavaScript | CoffeeScript | xhan/qqbot | tests/main.coffee | MIT | 6cd2e1127421f1307ba64b6c9fdff905d9a9e921 | 1,435 | https://github.com/xhan/qqbot/blob/6cd2e1127421f1307ba64b6c9fdff905d9a9e921/tests/main.coffee | 48 | 85 |
xhan/qqbot:tests/main.coffee:6:completion | completion | test_login_full = ->
login_next = (qq , encoded_pass , verify_code)->
log "开始登录1 密码校验"
api.login qq, encoded_pass , verify_code , (ret)->
log '登录结果'
log ret
return unless ret[2].match /^http/
log "开始登录2 cookie获取"
api.login_step2 ret[2] , ... | verify_code = result[1]
bits = result[2]
#TODO: login_next 异步破坏了代码的结构性,这块如何优化
if is_need_verify_code
log "需要验证码...获取中..."
api.get_verify_code qq, config.host, config.port, (error) ->
require('child_process').exec 'open tmp'
log "http://#... | CoffeeScript | CoffeeScript | xhan/qqbot | tests/main.coffee | MIT | 6cd2e1127421f1307ba64b6c9fdff905d9a9e921 | 1,435 | https://github.com/xhan/qqbot/blob/6cd2e1127421f1307ba64b6c9fdff905d9a9e921/tests/main.coffee | 48 | 85 |
xhan/qqbot:tests/main.coffee:8:raw_corpus | raw_corpus | test_get_verify_code = ->
api.get_verify_code qq, config.host, config.port, (error) ->
log 'oh yeah'
# test_check_qq()
# test_encode_password2()
test_login_full()
# test_login_token()
# test_get_verify_code() | CoffeeScript | xhan/qqbot | tests/main.coffee | MIT | 6cd2e1127421f1307ba64b6c9fdff905d9a9e921 | 1,435 | https://github.com/xhan/qqbot/blob/6cd2e1127421f1307ba64b6c9fdff905d9a9e921/tests/main.coffee | 92 | 101 | ||
xhan/qqbot:tests/main.coffee:8:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
test_get_verify_code = ->
api.get_verify_code qq, config.host, config.port, (error) ->
log 'oh yeah'
# test_check_qq()
# test_encode_password2()
test_login_full()
# test_login_token()
# test_get_verify_code()
``` | var test_get_verify_code;
test_get_verify_code = function() {
return api.get_verify_code(qq, config.host, config.port, function(error) {
return log('oh yeah');
});
};
// test_check_qq()
// test_encode_password2()
test_login_full();
// test_login_token()
// test_get_verify_code() | CoffeeScript | JavaScript | xhan/qqbot | tests/main.coffee | MIT | 6cd2e1127421f1307ba64b6c9fdff905d9a9e921 | 1,435 | https://github.com/xhan/qqbot/blob/6cd2e1127421f1307ba64b6c9fdff905d9a9e921/tests/main.coffee | 92 | 101 |
xhan/qqbot:tests/main.coffee:8:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
var test_get_verify_code;
test_get_verify_code = function() {
return api.get_verify_code(qq, config.host, config.port, function(error) {
return log('oh yeah');
});
};
// test_check_qq()
// test_encode_password2()
test_login_full();
// test_login_token()
... | test_get_verify_code = ->
api.get_verify_code qq, config.host, config.port, (error) ->
log 'oh yeah'
# test_check_qq()
# test_encode_password2()
test_login_full()
# test_login_token()
# test_get_verify_code() | JavaScript | CoffeeScript | xhan/qqbot | tests/main.coffee | MIT | 6cd2e1127421f1307ba64b6c9fdff905d9a9e921 | 1,435 | https://github.com/xhan/qqbot/blob/6cd2e1127421f1307ba64b6c9fdff905d9a9e921/tests/main.coffee | 92 | 101 |
xhan/qqbot:tests/main.coffee:1:raw_corpus | raw_corpus | #!/usr/bin/env coffee
int = (v) -> parseInt v
log = console.log
api = require("../src/qqapi")
log "testing..."
config = require '../config'
qq = config.account
pass = config.password
test_check_qq = ->
api.check_qq '123774072' , (result) ->
log int result[0]
log result[1]
log result[2]... | CoffeeScript | xhan/qqbot | tests/main.coffee | MIT | fff65761b7213e4922c46c3c5e509ecff6fac7a6 | 1,435 | https://github.com/xhan/qqbot/blob/fff65761b7213e4922c46c3c5e509ecff6fac7a6/tests/main.coffee | 1 | 50 | ||
xhan/qqbot:tests/main.coffee:1:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
#!/usr/bin/env coffee
int = (v) -> parseInt v
log = console.log
api = require("../src/qqapi")
log "testing..."
config = require '../config'
qq = config.account
pass = config.password
test_check_qq = ->
api.check_qq '123774072' , (result) ->
log ... | //!/usr/bin/env coffee
var api, config, int, log, pass, qq, test_check_qq, test_encode_password, test_login_full;
int = function(v) {
return parseInt(v);
};
log = console.log;
api = require("../src/qqapi");
log("testing...");
config = require('../config');
qq = config.account;
pass = config.password;
test_che... | CoffeeScript | JavaScript | xhan/qqbot | tests/main.coffee | MIT | fff65761b7213e4922c46c3c5e509ecff6fac7a6 | 1,435 | https://github.com/xhan/qqbot/blob/fff65761b7213e4922c46c3c5e509ecff6fac7a6/tests/main.coffee | 1 | 50 |
xhan/qqbot:tests/main.coffee:1:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
//!/usr/bin/env coffee
var api, config, int, log, pass, qq, test_check_qq, test_encode_password, test_login_full;
int = function(v) {
return parseInt(v);
};
log = console.log;
api = require("../src/qqapi");
log("testing...");
config = require('../config');
... | #!/usr/bin/env coffee
int = (v) -> parseInt v
log = console.log
api = require("../src/qqapi")
log "testing..."
config = require '../config'
qq = config.account
pass = config.password
test_check_qq = ->
api.check_qq '123774072' , (result) ->
log int result[0]
log result[1]
log result[2]... | JavaScript | CoffeeScript | xhan/qqbot | tests/main.coffee | MIT | fff65761b7213e4922c46c3c5e509ecff6fac7a6 | 1,435 | https://github.com/xhan/qqbot/blob/fff65761b7213e4922c46c3c5e509ecff6fac7a6/tests/main.coffee | 1 | 50 |
xhan/qqbot:tests/main.coffee:1:completion | completion | #!/usr/bin/env coffee
int = (v) -> parseInt v
log = console.log
api = require("../src/qqapi")
log "testing..."
config = require '../config'
qq = config.account
pass = config.password
test_check_qq = ->
api.check_qq '123774072' , (result) ->
log int result[0]
log result[1]
log result[2]... | test_login_full = ->
log "验证帐号"
api.check_qq qq , (result) ->
log "验证帐号:", result
is_need_verify_code = int result[0]
if is_need_verify_code
log "需要验证码 bye"
return
new_pass = api.encode_password(pass,result[1],result[2])
log "生成加密密码" , new_pass
... | CoffeeScript | CoffeeScript | xhan/qqbot | tests/main.coffee | MIT | fff65761b7213e4922c46c3c5e509ecff6fac7a6 | 1,435 | https://github.com/xhan/qqbot/blob/fff65761b7213e4922c46c3c5e509ecff6fac7a6/tests/main.coffee | 1 | 50 |
xhan/qqbot:tests/main.coffee:2:raw_corpus | raw_corpus | test_login_token = ->
api.post (ret) -> log ret
# test_check_qq()
# test_encode_password()
test_login_full()
# test_login_token() | CoffeeScript | xhan/qqbot | tests/main.coffee | MIT | fff65761b7213e4922c46c3c5e509ecff6fac7a6 | 1,435 | https://github.com/xhan/qqbot/blob/fff65761b7213e4922c46c3c5e509ecff6fac7a6/tests/main.coffee | 51 | 58 | ||
xhan/qqbot:tests/main.coffee:2:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
test_login_token = ->
api.post (ret) -> log ret
# test_check_qq()
# test_encode_password()
test_login_full()
# test_login_token()
``` | var test_login_token;
test_login_token = function() {
return api.post(function(ret) {
return log(ret);
});
};
// test_check_qq()
// test_encode_password()
test_login_full();
// test_login_token() | CoffeeScript | JavaScript | xhan/qqbot | tests/main.coffee | MIT | fff65761b7213e4922c46c3c5e509ecff6fac7a6 | 1,435 | https://github.com/xhan/qqbot/blob/fff65761b7213e4922c46c3c5e509ecff6fac7a6/tests/main.coffee | 51 | 58 |
xhan/qqbot:tests/main.coffee:2:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
var test_login_token;
test_login_token = function() {
return api.post(function(ret) {
return log(ret);
});
};
// test_check_qq()
// test_encode_password()
test_login_full();
// test_login_token()
``` | test_login_token = ->
api.post (ret) -> log ret
# test_check_qq()
# test_encode_password()
test_login_full()
# test_login_token() | JavaScript | CoffeeScript | xhan/qqbot | tests/main.coffee | MIT | fff65761b7213e4922c46c3c5e509ecff6fac7a6 | 1,435 | https://github.com/xhan/qqbot/blob/fff65761b7213e4922c46c3c5e509ecff6fac7a6/tests/main.coffee | 51 | 58 |
xhan/qqbot:tests/main.coffee:1:raw_corpus | raw_corpus | #!/usr/bin/env coffee
int = (v) -> parseInt v
log = console.log
api = require("../src/qqapi")
log "testing..."
config = require '../config'
qq = config.account
pass = config.password
test_check_qq = ->
api.check_qq '123774072' , (result) ->
log int result[0]
log result[1]
log result[2]... | CoffeeScript | xhan/qqbot | tests/main.coffee | MIT | 4ea2e610d00575d1d0e82cc007553f6cdb6be534 | 1,435 | https://github.com/xhan/qqbot/blob/4ea2e610d00575d1d0e82cc007553f6cdb6be534/tests/main.coffee | 1 | 47 | ||
xhan/qqbot:tests/main.coffee:1:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
#!/usr/bin/env coffee
int = (v) -> parseInt v
log = console.log
api = require("../src/qqapi")
log "testing..."
config = require '../config'
qq = config.account
pass = config.password
test_check_qq = ->
api.check_qq '123774072' , (result) ->
log ... | //!/usr/bin/env coffee
var api, config, int, log, pass, qq, test_check_qq, test_encode_password, test_login_full;
int = function(v) {
return parseInt(v);
};
log = console.log;
api = require("../src/qqapi");
log("testing...");
config = require('../config');
qq = config.account;
pass = config.password;
test_che... | CoffeeScript | JavaScript | xhan/qqbot | tests/main.coffee | MIT | 4ea2e610d00575d1d0e82cc007553f6cdb6be534 | 1,435 | https://github.com/xhan/qqbot/blob/4ea2e610d00575d1d0e82cc007553f6cdb6be534/tests/main.coffee | 1 | 47 |
xhan/qqbot:tests/main.coffee:1:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
//!/usr/bin/env coffee
var api, config, int, log, pass, qq, test_check_qq, test_encode_password, test_login_full;
int = function(v) {
return parseInt(v);
};
log = console.log;
api = require("../src/qqapi");
log("testing...");
config = require('../config');
... | #!/usr/bin/env coffee
int = (v) -> parseInt v
log = console.log
api = require("../src/qqapi")
log "testing..."
config = require '../config'
qq = config.account
pass = config.password
test_check_qq = ->
api.check_qq '123774072' , (result) ->
log int result[0]
log result[1]
log result[2]... | JavaScript | CoffeeScript | xhan/qqbot | tests/main.coffee | MIT | 4ea2e610d00575d1d0e82cc007553f6cdb6be534 | 1,435 | https://github.com/xhan/qqbot/blob/4ea2e610d00575d1d0e82cc007553f6cdb6be534/tests/main.coffee | 1 | 47 |
xhan/qqbot:tests/main.coffee:1:completion | completion | #!/usr/bin/env coffee
int = (v) -> parseInt v
log = console.log
api = require("../src/qqapi")
log "testing..."
config = require '../config'
qq = config.account
pass = config.password
test_check_qq = ->
api.check_qq '123774072' , (result) ->
log int result[0]
log result[1]
log result[2]... | # should equal to 7BB648B45C561A5F986DECCD94644A3E
test_login_full = ->
log "验证帐号"
api.check_qq qq , (result) ->
log "验证帐号:", result
is_need_verify_code = int result[0]
if is_need_verify_code
log "需要验证码 bye"
return
new_pass = api.encode_password(pass,re... | CoffeeScript | CoffeeScript | xhan/qqbot | tests/main.coffee | MIT | 4ea2e610d00575d1d0e82cc007553f6cdb6be534 | 1,435 | https://github.com/xhan/qqbot/blob/4ea2e610d00575d1d0e82cc007553f6cdb6be534/tests/main.coffee | 1 | 47 |
xhan/qqbot:tests/main.coffee:1:raw_corpus | raw_corpus | #!/usr/bin/env coffee
int = (v) -> parseInt v
log = console.log
api = require("../src/qqapi")
log "testing..."
test_check_qq = ->
api.check_qq '123774072' , (result) ->
log int result[0]
log result[1]
log result[2]
test_encode_password = ->
log api.encode_password("123","!GZH",... | CoffeeScript | xhan/qqbot | tests/main.coffee | MIT | 831c3670af9a58e3c7b3477df08e30f376cc3235 | 1,435 | https://github.com/xhan/qqbot/blob/831c3670af9a58e3c7b3477df08e30f376cc3235/tests/main.coffee | 1 | 25 | ||
xhan/qqbot:tests/main.coffee:1:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
#!/usr/bin/env coffee
int = (v) -> parseInt v
log = console.log
api = require("../src/qqapi")
log "testing..."
test_check_qq = ->
api.check_qq '123774072' , (result) ->
log int result[0]
log result[1]
log result[2]
test_encod... | //!/usr/bin/env coffee
var api, int, log, test_check_qq, test_encode_password;
int = function(v) {
return parseInt(v);
};
log = console.log;
api = require("../src/qqapi");
log("testing...");
test_check_qq = function() {
return api.check_qq('123774072', function(result) {
log(int(result[0]));
log(result... | CoffeeScript | JavaScript | xhan/qqbot | tests/main.coffee | MIT | 831c3670af9a58e3c7b3477df08e30f376cc3235 | 1,435 | https://github.com/xhan/qqbot/blob/831c3670af9a58e3c7b3477df08e30f376cc3235/tests/main.coffee | 1 | 25 |
xhan/qqbot:tests/main.coffee:1:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
//!/usr/bin/env coffee
var api, int, log, test_check_qq, test_encode_password;
int = function(v) {
return parseInt(v);
};
log = console.log;
api = require("../src/qqapi");
log("testing...");
test_check_qq = function() {
return api.check_qq('123774072', fun... | #!/usr/bin/env coffee
int = (v) -> parseInt v
log = console.log
api = require("../src/qqapi")
log "testing..."
test_check_qq = ->
api.check_qq '123774072' , (result) ->
log int result[0]
log result[1]
log result[2]
test_encode_password = ->
log api.encode_password("123","!GZH",... | JavaScript | CoffeeScript | xhan/qqbot | tests/main.coffee | MIT | 831c3670af9a58e3c7b3477df08e30f376cc3235 | 1,435 | https://github.com/xhan/qqbot/blob/831c3670af9a58e3c7b3477df08e30f376cc3235/tests/main.coffee | 1 | 25 |
xhan/qqbot:tests/main.coffee:1:completion | completion | #!/usr/bin/env coffee
int = (v) -> parseInt v
log = console.log
api = require("../src/qqapi")
log "testing..." | test_check_qq = ->
api.check_qq '123774072' , (result) ->
log int result[0]
log result[1]
log result[2]
test_encode_password = ->
log api.encode_password("123","!GZH",'\\x00\\x00\\x00\\x00\\x07\\x60\\xa4\\x78')
# test_check_qq()
test_encode_password() | CoffeeScript | CoffeeScript | xhan/qqbot | tests/main.coffee | MIT | 831c3670af9a58e3c7b3477df08e30f376cc3235 | 1,435 | https://github.com/xhan/qqbot/blob/831c3670af9a58e3c7b3477df08e30f376cc3235/tests/main.coffee | 1 | 25 |
xhan/qqbot:tests/main.coffee:1:raw_corpus | raw_corpus | #!/usr/bin/env coffee
v = 78
console.log "The value of v is '#{v}'"
test_net_request = ->
"123"
console.log test_net_request()
# http = require('http')
#
#
#
# http
# .get 'http://localhost/blog/archives-404/', (resp)->
# console.log "response: #{resp.statusCode}"
# resp.on 'data', (chunk) ->
# ... | CoffeeScript | xhan/qqbot | tests/main.coffee | MIT | 06be78522668c8d9f7a4de963c9d8a2fb256128d | 1,435 | https://github.com/xhan/qqbot/blob/06be78522668c8d9f7a4de963c9d8a2fb256128d/tests/main.coffee | 1 | 26 | ||
xhan/qqbot:tests/main.coffee:1:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
#!/usr/bin/env coffee
v = 78
console.log "The value of v is '#{v}'"
test_net_request = ->
"123"
console.log test_net_request()
# http = require('http')
#
#
#
# http
# .get 'http://localhost/blog/archives-404/', (resp)->
# console.log "response: #... | //!/usr/bin/env coffee
var api, test_net_request, v;
v = 78;
console.log(`The value of v is '${v}'`);
test_net_request = function() {
return "123";
};
console.log(test_net_request());
// http = require('http')
// http
// .get 'http://localhost/blog/archives-404/', (resp)->
// console.log "response: #{re... | CoffeeScript | JavaScript | xhan/qqbot | tests/main.coffee | MIT | 06be78522668c8d9f7a4de963c9d8a2fb256128d | 1,435 | https://github.com/xhan/qqbot/blob/06be78522668c8d9f7a4de963c9d8a2fb256128d/tests/main.coffee | 1 | 26 |
xhan/qqbot:tests/main.coffee:1:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
//!/usr/bin/env coffee
var api, test_net_request, v;
v = 78;
console.log(`The value of v is '${v}'`);
test_net_request = function() {
return "123";
};
console.log(test_net_request());
// http = require('http')
// http
// .get 'http://localhost/blog/archiv... | #!/usr/bin/env coffee
v = 78
console.log "The value of v is '#{v}'"
test_net_request = ->
"123"
console.log test_net_request()
# http = require('http')
#
#
#
# http
# .get 'http://localhost/blog/archives-404/', (resp)->
# console.log "response: #{resp.statusCode}"
# resp.on 'data', (chunk) ->
# ... | JavaScript | CoffeeScript | xhan/qqbot | tests/main.coffee | MIT | 06be78522668c8d9f7a4de963c9d8a2fb256128d | 1,435 | https://github.com/xhan/qqbot/blob/06be78522668c8d9f7a4de963c9d8a2fb256128d/tests/main.coffee | 1 | 26 |
xhan/qqbot:tests/main.coffee:1:raw_corpus | raw_corpus | #!/usr/bin/env coffee
v = 78
console.log "The value of v is '#{v}'"
test_net_request = ->
"123"
console.log test_net_request()
http = require('http')
# test net request
http.get "http://www.baidu.com", (res) ->
console.log "response: #{res.statusCode}" | CoffeeScript | xhan/qqbot | tests/main.coffee | MIT | dd84182dba8e15b22b101092f8f40f3b63c26dda | 1,435 | https://github.com/xhan/qqbot/blob/dd84182dba8e15b22b101092f8f40f3b63c26dda/tests/main.coffee | 1 | 15 | ||
xhan/qqbot:tests/main.coffee:1:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
#!/usr/bin/env coffee
v = 78
console.log "The value of v is '#{v}'"
test_net_request = ->
"123"
console.log test_net_request()
http = require('http')
# test net request
http.get "http://www.baidu.com", (res) ->
console.log "response: #{res.statusCode... | //!/usr/bin/env coffee
var http, test_net_request, v;
v = 78;
console.log(`The value of v is '${v}'`);
test_net_request = function() {
return "123";
};
console.log(test_net_request());
http = require('http');
// test net request
http.get("http://www.baidu.com", function(res) {
return console.log(`response: ${... | CoffeeScript | JavaScript | xhan/qqbot | tests/main.coffee | MIT | dd84182dba8e15b22b101092f8f40f3b63c26dda | 1,435 | https://github.com/xhan/qqbot/blob/dd84182dba8e15b22b101092f8f40f3b63c26dda/tests/main.coffee | 1 | 15 |
xhan/qqbot:tests/main.coffee:1:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
//!/usr/bin/env coffee
var http, test_net_request, v;
v = 78;
console.log(`The value of v is '${v}'`);
test_net_request = function() {
return "123";
};
console.log(test_net_request());
http = require('http');
// test net request
http.get("http://www.baidu.c... | #!/usr/bin/env coffee
v = 78
console.log "The value of v is '#{v}'"
test_net_request = ->
"123"
console.log test_net_request()
http = require('http')
# test net request
http.get "http://www.baidu.com", (res) ->
console.log "response: #{res.statusCode}" | JavaScript | CoffeeScript | xhan/qqbot | tests/main.coffee | MIT | dd84182dba8e15b22b101092f8f40f3b63c26dda | 1,435 | https://github.com/xhan/qqbot/blob/dd84182dba8e15b22b101092f8f40f3b63c26dda/tests/main.coffee | 1 | 15 |
xhan/qqbot:tests/main.coffee:1:completion | completion | #!/usr/bin/env coffee
v = 78
console.log "The value of v is '#{v}'"
test_net_request = -> | "123"
console.log test_net_request()
http = require('http')
# test net request
http.get "http://www.baidu.com", (res) ->
console.log "response: #{res.statusCode}" | CoffeeScript | CoffeeScript | xhan/qqbot | tests/main.coffee | MIT | dd84182dba8e15b22b101092f8f40f3b63c26dda | 1,435 | https://github.com/xhan/qqbot/blob/dd84182dba8e15b22b101092f8f40f3b63c26dda/tests/main.coffee | 1 | 15 |
jianliaoim/talk-os:talk-web/client/app/form-topic.coffee:1:raw_corpus | raw_corpus | module.exports = React.createClass
displayName: 'form-topic'
propTypes:
data: T.instanceOf(Immutable.Map)
onChange: T.func
onSubmit: T.func
readOnly: T.bool
willSubmit: T.bool
displayMode: T.oneOf([ 'create', 'edit' ]).isRequired
getDefaultProps: ->
onChange: (->)
onSubmit: (->)
... | CoffeeScript | jianliaoim/talk-os | talk-web/client/app/form-topic.coffee | MIT | 2545c4497865779a55762e03963a39237df9046b | 2,703 | https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-web/client/app/form-topic.coffee | 16 | 65 | ||
jianliaoim/talk-os:talk-web/client/app/form-topic.coffee:1:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
module.exports = React.createClass
displayName: 'form-topic'
propTypes:
data: T.instanceOf(Immutable.Map)
onChange: T.func
onSubmit: T.func
readOnly: T.bool
willSubmit: T.bool
displayMode: T.oneOf([ 'create', 'edit' ]).isRequired
g... | module.exports = React.createClass({
displayName: 'form-topic',
propTypes: {
data: T.instanceOf(Immutable.Map),
onChange: T.func,
onSubmit: T.func,
readOnly: T.bool,
willSubmit: T.bool,
displayMode: T.oneOf(['create', 'edit']).isRequired
},
getDefaultProps: function() {
return {
... | CoffeeScript | JavaScript | jianliaoim/talk-os | talk-web/client/app/form-topic.coffee | MIT | 2545c4497865779a55762e03963a39237df9046b | 2,703 | https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-web/client/app/form-topic.coffee | 16 | 65 |
jianliaoim/talk-os:talk-web/client/app/form-topic.coffee:1:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
module.exports = React.createClass({
displayName: 'form-topic',
propTypes: {
data: T.instanceOf(Immutable.Map),
onChange: T.func,
onSubmit: T.func,
readOnly: T.bool,
willSubmit: T.bool,
displayMode: T.oneOf(['create', 'edit']).isRequired... | module.exports = React.createClass
displayName: 'form-topic'
propTypes:
data: T.instanceOf(Immutable.Map)
onChange: T.func
onSubmit: T.func
readOnly: T.bool
willSubmit: T.bool
displayMode: T.oneOf([ 'create', 'edit' ]).isRequired
getDefaultProps: ->
onChange: (->)
onSubmit: (->)
... | JavaScript | CoffeeScript | jianliaoim/talk-os | talk-web/client/app/form-topic.coffee | MIT | 2545c4497865779a55762e03963a39237df9046b | 2,703 | https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-web/client/app/form-topic.coffee | 16 | 65 |
jianliaoim/talk-os:talk-web/client/app/form-topic.coffee:1:completion | completion | module.exports = React.createClass
displayName: 'form-topic'
propTypes:
data: T.instanceOf(Immutable.Map)
onChange: T.func
onSubmit: T.func
readOnly: T.bool
willSubmit: T.bool
displayMode: T.oneOf([ 'create', 'edit' ]).isRequired
getDefaultProps: ->
onChange: (->)
onSubmit: (->)
... | if not nextProps.data?
@setState
data: Immutable.Map protoData
if @props.displayMode is 'edit'
if not @props.readOnly and nextProps.readOnly
@setState
data: @props.data or Immutable.Map protoData
willChange: (key, value) ->
newState =
data: @state.data.set key... | CoffeeScript | CoffeeScript | jianliaoim/talk-os | talk-web/client/app/form-topic.coffee | MIT | 2545c4497865779a55762e03963a39237df9046b | 2,703 | https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-web/client/app/form-topic.coffee | 16 | 65 |
jianliaoim/talk-os:talk-web/client/app/form-topic.coffee:2:raw_corpus | raw_corpus | render: ->
form className: 'form-table', onSubmit: @onFormSubmit,
fieldset {},
div className: 'form-row',
input
type: 'text'
value: @state.data.get('title') or ''
onChange: @handelTitleChange
readOnly: @props.readOnly
autoFocus: not... | CoffeeScript | jianliaoim/talk-os | talk-web/client/app/form-topic.coffee | MIT | 2545c4497865779a55762e03963a39237df9046b | 2,703 | https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-web/client/app/form-topic.coffee | 66 | 85 | ||
jianliaoim/talk-os:talk-web/client/app/form-topic.coffee:2:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
render: ->
form className: 'form-table', onSubmit: @onFormSubmit,
fieldset {},
div className: 'form-row',
input
type: 'text'
value: @state.data.get('title') or ''
onChange: @handelTitleChange
... | ({
render: function() {
return form({
className: 'form-table',
onSubmit: this.onFormSubmit
}, fieldset({}, div({
className: 'form-row'
}, input({
type: 'text',
value: this.state.data.get('title') || '',
onChange: this.handelTitleChange,
readOnly: this.props.readOn... | CoffeeScript | JavaScript | jianliaoim/talk-os | talk-web/client/app/form-topic.coffee | MIT | 2545c4497865779a55762e03963a39237df9046b | 2,703 | https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-web/client/app/form-topic.coffee | 66 | 85 |
jianliaoim/talk-os:talk-web/client/app/form-topic.coffee:2:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
({
render: function() {
return form({
className: 'form-table',
onSubmit: this.onFormSubmit
}, fieldset({}, div({
className: 'form-row'
}, input({
type: 'text',
value: this.state.data.get('title') || '',
onChange: th... | render: ->
form className: 'form-table', onSubmit: @onFormSubmit,
fieldset {},
div className: 'form-row',
input
type: 'text'
value: @state.data.get('title') or ''
onChange: @handelTitleChange
readOnly: @props.readOnly
autoFocus: not... | JavaScript | CoffeeScript | jianliaoim/talk-os | talk-web/client/app/form-topic.coffee | MIT | 2545c4497865779a55762e03963a39237df9046b | 2,703 | https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-web/client/app/form-topic.coffee | 66 | 85 |
jianliaoim/talk-os:talk-web/client/app/form-topic.coffee:2:completion | completion | render: ->
form className: 'form-table', onSubmit: @onFormSubmit,
fieldset {},
div className: 'form-row',
input
type: 'text'
value: @state.data.get('title') or ''
onChange: @handelTitleChange
readOnly: @props.readOnly | autoFocus: not @props.readOnly
className: 'text-row font-large'
placeholder: if not @props.readOnly then lang.getText('share-story-title-placeholder')
div className: 'form-row',
Textarea
value: @state.data.get('text') or ''
onChange: @handleTextChange
... | CoffeeScript | CoffeeScript | jianliaoim/talk-os | talk-web/client/app/form-topic.coffee | MIT | 2545c4497865779a55762e03963a39237df9046b | 2,703 | https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-web/client/app/form-topic.coffee | 66 | 85 |
discolabs/cartjs:src/cartjs.coffee:1:raw_corpus | raw_corpus | # The CartJS namespace.
# ---------------------
CartJS =
# Default settings, publicly accessible on `module.settings`.
settings:
debug: false
dataAPI: true
requestBodyClass: null
rivetsModels: {}
currency: null
moneyFormat: null
moneyWithCurrencyFormat: null
weightUnit: 'g'
weig... | CoffeeScript | discolabs/cartjs | src/cartjs.coffee | MIT | 3d60425769d593c5e0968fd22d12ff78c63bcc4f | 493 | https://github.com/discolabs/cartjs/blob/3d60425769d593c5e0968fd22d12ff78c63bcc4f/src/cartjs.coffee | 1 | 50 | ||
discolabs/cartjs:src/cartjs.coffee:1:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
# The CartJS namespace.
# ---------------------
CartJS =
# Default settings, publicly accessible on `module.settings`.
settings:
debug: false
dataAPI: true
requestBodyClass: null
rivetsModels: {}
currency: null
moneyFormat: null
m... | // The CartJS namespace.
// ---------------------
var CartJS;
CartJS = {
// Default settings, publicly accessible on `module.settings`.
settings: {
debug: false,
dataAPI: true,
requestBodyClass: null,
rivetsModels: {},
currency: null,
moneyFormat: null,
moneyWithCurrencyFormat: null,
... | CoffeeScript | JavaScript | discolabs/cartjs | src/cartjs.coffee | MIT | 3d60425769d593c5e0968fd22d12ff78c63bcc4f | 493 | https://github.com/discolabs/cartjs/blob/3d60425769d593c5e0968fd22d12ff78c63bcc4f/src/cartjs.coffee | 1 | 50 |
discolabs/cartjs:src/cartjs.coffee:1:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
// The CartJS namespace.
// ---------------------
var CartJS;
CartJS = {
// Default settings, publicly accessible on `module.settings`.
settings: {
debug: false,
dataAPI: true,
requestBodyClass: null,
rivetsModels: {},
currency: null,
m... | # The CartJS namespace.
# ---------------------
CartJS =
# Default settings, publicly accessible on `module.settings`.
settings:
debug: false
dataAPI: true
requestBodyClass: null
rivetsModels: {}
currency: null
moneyFormat: null
moneyWithCurrencyFormat: null
weightUnit: 'g'
weig... | JavaScript | CoffeeScript | discolabs/cartjs | src/cartjs.coffee | MIT | 3d60425769d593c5e0968fd22d12ff78c63bcc4f | 493 | https://github.com/discolabs/cartjs/blob/3d60425769d593c5e0968fd22d12ff78c63bcc4f/src/cartjs.coffee | 1 | 50 |
discolabs/cartjs:src/cartjs.coffee:1:completion | completion | # The CartJS namespace.
# ---------------------
CartJS =
# Default settings, publicly accessible on `module.settings`.
settings:
debug: false
dataAPI: true
requestBodyClass: null
rivetsModels: {}
currency: null
moneyFormat: null
moneyWithCurrencyFormat: null
weightUnit: 'g'
weig... | # CartJS.init({{ cart | json }}, {
# dataAPI: true
# });
# </script>
#
CartJS.init = (cart, settings = {}) ->
# Configure settings from any passed settings hash.
CartJS.configure(settings)
# Note that we are initialising the library.
CartJS.Utils.log('Initialising CartJS.')
# Update the cart... | CoffeeScript | CoffeeScript | discolabs/cartjs | src/cartjs.coffee | MIT | 3d60425769d593c5e0968fd22d12ff78c63bcc4f | 493 | https://github.com/discolabs/cartjs/blob/3d60425769d593c5e0968fd22d12ff78c63bcc4f/src/cartjs.coffee | 1 | 50 |
discolabs/cartjs:src/cartjs.coffee:2:raw_corpus | raw_corpus | # Initialise DOM Binding through Rivets module.
# Performs a no-op if Rivets.js isn't present.
CartJS.Rivets.init()
jQuery(document).trigger('cart.ready', [CartJS.cart]);
# Configure CartJS with the given settings object.
CartJS.configure = (settings = {}) ->
CartJS.Utils.extend(CartJS.settings, settings)
# ... | CoffeeScript | discolabs/cartjs | src/cartjs.coffee | MIT | 3d60425769d593c5e0968fd22d12ff78c63bcc4f | 493 | https://github.com/discolabs/cartjs/blob/3d60425769d593c5e0968fd22d12ff78c63bcc4f/src/cartjs.coffee | 51 | 66 | ||
discolabs/cartjs:src/cartjs.coffee:2:completion | completion | # Initialise DOM Binding through Rivets module.
# Performs a no-op if Rivets.js isn't present.
CartJS.Rivets.init()
jQuery(document).trigger('cart.ready', [CartJS.cart]);
# Configure CartJS with the given settings object.
CartJS.configure = (settings = {}) -> | CartJS.Utils.extend(CartJS.settings, settings)
# Add a stubbed out console.log method for browsers that don't implement it.
# Omitting this method can lead to Javascript failures in some browsers.
# See: http://stackoverflow.com/questions/7742781/why-javascript-only-works-after-opening-developer-tools-in-ie-once
unles... | CoffeeScript | CoffeeScript | discolabs/cartjs | src/cartjs.coffee | MIT | 3d60425769d593c5e0968fd22d12ff78c63bcc4f | 493 | https://github.com/discolabs/cartjs/blob/3d60425769d593c5e0968fd22d12ff78c63bcc4f/src/cartjs.coffee | 51 | 66 |
discolabs/cartjs:src/cartjs.coffee:1:raw_corpus | raw_corpus | # The CartJS namespace.
# ---------------------
CartJS =
# Default settings, publicly accessible on `module.settings`.
settings:
debug: false
dataAPI: true
requestBodyClass: null
rivetsModels: {}
currency: null
moneyFormat: null
moneyWithCurrencyFormat: null
weightUnit: 'g'
weig... | CoffeeScript | discolabs/cartjs | src/cartjs.coffee | MIT | e114b63fb748082fbe49c376f295d7742f58682f | 493 | https://github.com/discolabs/cartjs/blob/e114b63fb748082fbe49c376f295d7742f58682f/src/cartjs.coffee | 1 | 50 | ||
discolabs/cartjs:src/cartjs.coffee:1:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
# The CartJS namespace.
# ---------------------
CartJS =
# Default settings, publicly accessible on `module.settings`.
settings:
debug: false
dataAPI: true
requestBodyClass: null
rivetsModels: {}
currency: null
moneyFormat: null
m... | // The CartJS namespace.
// ---------------------
var CartJS;
CartJS = {
// Default settings, publicly accessible on `module.settings`.
settings: {
debug: false,
dataAPI: true,
requestBodyClass: null,
rivetsModels: {},
currency: null,
moneyFormat: null,
moneyWithCurrencyFormat: null,
... | CoffeeScript | JavaScript | discolabs/cartjs | src/cartjs.coffee | MIT | e114b63fb748082fbe49c376f295d7742f58682f | 493 | https://github.com/discolabs/cartjs/blob/e114b63fb748082fbe49c376f295d7742f58682f/src/cartjs.coffee | 1 | 50 |
discolabs/cartjs:src/cartjs.coffee:1:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
// The CartJS namespace.
// ---------------------
var CartJS;
CartJS = {
// Default settings, publicly accessible on `module.settings`.
settings: {
debug: false,
dataAPI: true,
requestBodyClass: null,
rivetsModels: {},
currency: null,
m... | # The CartJS namespace.
# ---------------------
CartJS =
# Default settings, publicly accessible on `module.settings`.
settings:
debug: false
dataAPI: true
requestBodyClass: null
rivetsModels: {}
currency: null
moneyFormat: null
moneyWithCurrencyFormat: null
weightUnit: 'g'
weig... | JavaScript | CoffeeScript | discolabs/cartjs | src/cartjs.coffee | MIT | e114b63fb748082fbe49c376f295d7742f58682f | 493 | https://github.com/discolabs/cartjs/blob/e114b63fb748082fbe49c376f295d7742f58682f/src/cartjs.coffee | 1 | 50 |
discolabs/cartjs:src/cartjs.coffee:1:completion | completion | # The CartJS namespace.
# ---------------------
CartJS =
# Default settings, publicly accessible on `module.settings`.
settings:
debug: false
dataAPI: true
requestBodyClass: null
rivetsModels: {}
currency: null
moneyFormat: null
moneyWithCurrencyFormat: null
weightUnit: 'g'
weig... | # CartJS.init({{ cart | json }}, {
# dataAPI: true
# });
# </script>
#
CartJS.init = (cart, settings = {}) ->
# Configure settings from any passed settings hash.
CartJS.configure(settings)
# Note that we are initialising the library.
CartJS.Utils.log('Initialising CartJS.')
# Update the cart... | CoffeeScript | CoffeeScript | discolabs/cartjs | src/cartjs.coffee | MIT | e114b63fb748082fbe49c376f295d7742f58682f | 493 | https://github.com/discolabs/cartjs/blob/e114b63fb748082fbe49c376f295d7742f58682f/src/cartjs.coffee | 1 | 50 |
discolabs/cartjs:src/cartjs.coffee:2:raw_corpus | raw_corpus | # Initialise DOM Binding through Rivets module.
# Performs a no-op if Rivets.js isn't present.
CartJS.Rivets.init()
$(document).trigger('cart.ready', [CartJS.cart]);
# Configure CartJS with the given settings object.
CartJS.configure = (settings = {}) ->
CartJS.Utils.extend(CartJS.settings, settings)
# Add a ... | CoffeeScript | discolabs/cartjs | src/cartjs.coffee | MIT | 97c38757cf1e5e74b3f4dcece0e1329a639be917 | 493 | https://github.com/discolabs/cartjs/blob/97c38757cf1e5e74b3f4dcece0e1329a639be917/src/cartjs.coffee | 51 | 65 | ||
discolabs/cartjs:src/cartjs.coffee:2:completion | completion | # Initialise DOM Binding through Rivets module.
# Performs a no-op if Rivets.js isn't present.
CartJS.Rivets.init()
$(document).trigger('cart.ready', [CartJS.cart]);
# Configure CartJS with the given settings object.
CartJS.configure = (settings = {}) -> | CartJS.Utils.extend(CartJS.settings, settings)
# Add a stubbed out console.log method for browsers that don't implement it.
# Omitting this method can lead to Javascript failures in some browsers.
# See: http://stackoverflow.com/questions/7742781/why-javascript-only-works-after-opening-developer-tools-in-ie-once
unles... | CoffeeScript | CoffeeScript | discolabs/cartjs | src/cartjs.coffee | MIT | 97c38757cf1e5e74b3f4dcece0e1329a639be917 | 493 | https://github.com/discolabs/cartjs/blob/97c38757cf1e5e74b3f4dcece0e1329a639be917/src/cartjs.coffee | 51 | 65 |
discolabs/cartjs:src/cartjs.coffee:2:raw_corpus | raw_corpus | # Initialise DOM Binding through Rivets module.
# Performs a no-op if Rivets.js isn't present.
CartJS.Rivets.init()
# Configure CartJS with the given settings object.
CartJS.configure = (settings = {}) ->
CartJS.Utils.extend(CartJS.settings, settings)
# Add a stubbed out console.log method for browsers that don... | CoffeeScript | discolabs/cartjs | src/cartjs.coffee | MIT | 0c13aba02f2aa9377a49dc1721aacb2438e1d39d | 493 | https://github.com/discolabs/cartjs/blob/0c13aba02f2aa9377a49dc1721aacb2438e1d39d/src/cartjs.coffee | 51 | 64 | ||
discolabs/cartjs:src/cartjs.coffee:2:completion | completion | # Initialise DOM Binding through Rivets module.
# Performs a no-op if Rivets.js isn't present.
CartJS.Rivets.init()
# Configure CartJS with the given settings object.
CartJS.configure = (settings = {}) ->
CartJS.Utils.extend(CartJS.settings, settings) | # Add a stubbed out console.log method for browsers that don't implement it.
# Omitting this method can lead to Javascript failures in some browsers.
# See: http://stackoverflow.com/questions/7742781/why-javascript-only-works-after-opening-developer-tools-in-ie-once
unless window.console?
window.console = {}
window... | CoffeeScript | CoffeeScript | discolabs/cartjs | src/cartjs.coffee | MIT | 0c13aba02f2aa9377a49dc1721aacb2438e1d39d | 493 | https://github.com/discolabs/cartjs/blob/0c13aba02f2aa9377a49dc1721aacb2438e1d39d/src/cartjs.coffee | 51 | 64 |
discolabs/cartjs:src/cartjs.coffee:1:raw_corpus | raw_corpus | # The CartJS namespace.
# ---------------------
CartJS =
# Default settings, publicly accessible on `module.settings`.
settings:
debug: false
dataAPI: true
requestBodyClass: null
rivetsModels: {}
currency: null
moneyFormat: null
moneyWithCurrencyFormat: null
weightUnit: 'kg'
# O... | CoffeeScript | discolabs/cartjs | src/cartjs.coffee | MIT | 38a25033a44d161ab88847ca28d82fee7ee5a9f0 | 493 | https://github.com/discolabs/cartjs/blob/38a25033a44d161ab88847ca28d82fee7ee5a9f0/src/cartjs.coffee | 1 | 50 | ||
discolabs/cartjs:src/cartjs.coffee:1:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
# The CartJS namespace.
# ---------------------
CartJS =
# Default settings, publicly accessible on `module.settings`.
settings:
debug: false
dataAPI: true
requestBodyClass: null
rivetsModels: {}
currency: null
moneyFormat: null
m... | // The CartJS namespace.
// ---------------------
var CartJS;
CartJS = {
// Default settings, publicly accessible on `module.settings`.
settings: {
debug: false,
dataAPI: true,
requestBodyClass: null,
rivetsModels: {},
currency: null,
moneyFormat: null,
moneyWithCurrencyFormat: null,
... | CoffeeScript | JavaScript | discolabs/cartjs | src/cartjs.coffee | MIT | 38a25033a44d161ab88847ca28d82fee7ee5a9f0 | 493 | https://github.com/discolabs/cartjs/blob/38a25033a44d161ab88847ca28d82fee7ee5a9f0/src/cartjs.coffee | 1 | 50 |
discolabs/cartjs:src/cartjs.coffee:1:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
// The CartJS namespace.
// ---------------------
var CartJS;
CartJS = {
// Default settings, publicly accessible on `module.settings`.
settings: {
debug: false,
dataAPI: true,
requestBodyClass: null,
rivetsModels: {},
currency: null,
m... | # The CartJS namespace.
# ---------------------
CartJS =
# Default settings, publicly accessible on `module.settings`.
settings:
debug: false
dataAPI: true
requestBodyClass: null
rivetsModels: {}
currency: null
moneyFormat: null
moneyWithCurrencyFormat: null
weightUnit: 'kg'
# O... | JavaScript | CoffeeScript | discolabs/cartjs | src/cartjs.coffee | MIT | 38a25033a44d161ab88847ca28d82fee7ee5a9f0 | 493 | https://github.com/discolabs/cartjs/blob/38a25033a44d161ab88847ca28d82fee7ee5a9f0/src/cartjs.coffee | 1 | 50 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.