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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
buttercoin/buttercoin:perf/market_throughput.coffee:3:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
makeRandomOrder = ->
currencies = ['BTC', 'USD']
currencies = currencies.reverse() if randomBool()
new Order({name: "user-#{acctID++}"}, currencies[0], randomInt(1, 5000), currencies[1], randomInt(1, 5000))
``` | var makeRandomOrder;
makeRandomOrder = function() {
var currencies;
currencies = ['BTC', 'USD'];
if (randomBool()) {
currencies = currencies.reverse();
}
return new Order({
name: `user-${acctID++}`
}, currencies[0], randomInt(1, 5000), currencies[1], randomInt(1, 5000));
}; | CoffeeScript | JavaScript | buttercoin/buttercoin | perf/market_throughput.coffee | MIT | a9ed301e4930199af5b144d6c3e2d482f424fe3d | 663 | https://github.com/buttercoin/buttercoin/blob/a9ed301e4930199af5b144d6c3e2d482f424fe3d/perf/market_throughput.coffee | 13 | 16 |
buttercoin/buttercoin:perf/market_throughput.coffee:3:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
var makeRandomOrder;
makeRandomOrder = function() {
var currencies;
currencies = ['BTC', 'USD'];
if (randomBool()) {
currencies = currencies.reverse();
}
return new Order({
name: `user-${acctID++}`
}, currencies[0], randomInt(1, 5000), currenci... | makeRandomOrder = ->
currencies = ['BTC', 'USD']
currencies = currencies.reverse() if randomBool()
new Order({name: "user-#{acctID++}"}, currencies[0], randomInt(1, 5000), currencies[1], randomInt(1, 5000)) | JavaScript | CoffeeScript | buttercoin/buttercoin | perf/market_throughput.coffee | MIT | a9ed301e4930199af5b144d6c3e2d482f424fe3d | 663 | https://github.com/buttercoin/buttercoin/blob/a9ed301e4930199af5b144d6c3e2d482f424fe3d/perf/market_throughput.coffee | 13 | 16 |
buttercoin/buttercoin:perf/market_throughput.coffee:3:completion | completion | makeRandomOrder = ->
currencies = ['BTC', 'USD'] | currencies = currencies.reverse() if randomBool()
new Order({name: "user-#{acctID++}"}, currencies[0], randomInt(1, 5000), currencies[1], randomInt(1, 5000)) | CoffeeScript | CoffeeScript | buttercoin/buttercoin | perf/market_throughput.coffee | MIT | a9ed301e4930199af5b144d6c3e2d482f424fe3d | 663 | https://github.com/buttercoin/buttercoin/blob/a9ed301e4930199af5b144d6c3e2d482f424fe3d/perf/market_throughput.coffee | 13 | 16 |
buttercoin/buttercoin:perf/market_throughput.coffee:4:raw_corpus | raw_corpus | makeMatchingOrder = (n) ->
currencies = if (n % 5) then ['BTC', 'USD'] else ['USD', 'BTC']
amt = if (n % 5) then 0.25 else 1
new Order({name: "user-#{acctID++}"}, currencies[0], amt, currencies[1], amt) | CoffeeScript | buttercoin/buttercoin | perf/market_throughput.coffee | MIT | a9ed301e4930199af5b144d6c3e2d482f424fe3d | 663 | https://github.com/buttercoin/buttercoin/blob/a9ed301e4930199af5b144d6c3e2d482f424fe3d/perf/market_throughput.coffee | 18 | 21 | ||
buttercoin/buttercoin:perf/market_throughput.coffee:4:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
makeMatchingOrder = (n) ->
currencies = if (n % 5) then ['BTC', 'USD'] else ['USD', 'BTC']
amt = if (n % 5) then 0.25 else 1
new Order({name: "user-#{acctID++}"}, currencies[0], amt, currencies[1], amt)
``` | var makeMatchingOrder;
makeMatchingOrder = function(n) {
var amt, currencies;
currencies = n % 5 ? ['BTC', 'USD'] : ['USD', 'BTC'];
amt = n % 5 ? 0.25 : 1;
return new Order({
name: `user-${acctID++}`
}, currencies[0], amt, currencies[1], amt);
}; | CoffeeScript | JavaScript | buttercoin/buttercoin | perf/market_throughput.coffee | MIT | a9ed301e4930199af5b144d6c3e2d482f424fe3d | 663 | https://github.com/buttercoin/buttercoin/blob/a9ed301e4930199af5b144d6c3e2d482f424fe3d/perf/market_throughput.coffee | 18 | 21 |
buttercoin/buttercoin:perf/market_throughput.coffee:4:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
var makeMatchingOrder;
makeMatchingOrder = function(n) {
var amt, currencies;
currencies = n % 5 ? ['BTC', 'USD'] : ['USD', 'BTC'];
amt = n % 5 ? 0.25 : 1;
return new Order({
name: `user-${acctID++}`
}, currencies[0], amt, currencies[1], amt);
};
``` | makeMatchingOrder = (n) ->
currencies = if (n % 5) then ['BTC', 'USD'] else ['USD', 'BTC']
amt = if (n % 5) then 0.25 else 1
new Order({name: "user-#{acctID++}"}, currencies[0], amt, currencies[1], amt) | JavaScript | CoffeeScript | buttercoin/buttercoin | perf/market_throughput.coffee | MIT | a9ed301e4930199af5b144d6c3e2d482f424fe3d | 663 | https://github.com/buttercoin/buttercoin/blob/a9ed301e4930199af5b144d6c3e2d482f424fe3d/perf/market_throughput.coffee | 18 | 21 |
buttercoin/buttercoin:perf/market_throughput.coffee:4:completion | completion | makeMatchingOrder = (n) ->
currencies = if (n % 5) then ['BTC', 'USD'] else ['USD', 'BTC'] | amt = if (n % 5) then 0.25 else 1
new Order({name: "user-#{acctID++}"}, currencies[0], amt, currencies[1], amt) | CoffeeScript | CoffeeScript | buttercoin/buttercoin | perf/market_throughput.coffee | MIT | a9ed301e4930199af5b144d6c3e2d482f424fe3d | 663 | https://github.com/buttercoin/buttercoin/blob/a9ed301e4930199af5b144d6c3e2d482f424fe3d/perf/market_throughput.coffee | 18 | 21 |
buttercoin/buttercoin:perf/market_throughput.coffee:5:raw_corpus | raw_corpus | mixAndMatch = (n) ->
if (n % 10) >= 5
makeRandomOrder()
else
makeMatchingOrder(n)
market = new Market('BTC', 'USD')
count = 100000000000
block_size = 10000
iterations = Math.floor(count/block_size)
console.log "Generating #{block_size} random orders..."
orders = (makeRandomOrder() for _ in [1..block_size... | CoffeeScript | buttercoin/buttercoin | perf/market_throughput.coffee | MIT | a9ed301e4930199af5b144d6c3e2d482f424fe3d | 663 | https://github.com/buttercoin/buttercoin/blob/a9ed301e4930199af5b144d6c3e2d482f424fe3d/perf/market_throughput.coffee | 23 | 41 | ||
buttercoin/buttercoin:perf/market_throughput.coffee:5:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
mixAndMatch = (n) ->
if (n % 10) >= 5
makeRandomOrder()
else
makeMatchingOrder(n)
market = new Market('BTC', 'USD')
count = 100000000000
block_size = 10000
iterations = Math.floor(count/block_size)
console.log "Generating #{block_size} random order... | var _, block_size, count, iterations, market, mixAndMatch, orders, rl;
mixAndMatch = function(n) {
if ((n % 10) >= 5) {
return makeRandomOrder();
} else {
return makeMatchingOrder(n);
}
};
market = new Market('BTC', 'USD');
count = 100000000000;
block_size = 10000;
iterations = Math.floor(count / blo... | CoffeeScript | JavaScript | buttercoin/buttercoin | perf/market_throughput.coffee | MIT | a9ed301e4930199af5b144d6c3e2d482f424fe3d | 663 | https://github.com/buttercoin/buttercoin/blob/a9ed301e4930199af5b144d6c3e2d482f424fe3d/perf/market_throughput.coffee | 23 | 41 |
buttercoin/buttercoin:perf/market_throughput.coffee:5:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
var _, block_size, count, iterations, market, mixAndMatch, orders, rl;
mixAndMatch = function(n) {
if ((n % 10) >= 5) {
return makeRandomOrder();
} else {
return makeMatchingOrder(n);
}
};
market = new Market('BTC', 'USD');
count = 100000000000;
b... | mixAndMatch = (n) ->
if (n % 10) >= 5
makeRandomOrder()
else
makeMatchingOrder(n)
market = new Market('BTC', 'USD')
count = 100000000000
block_size = 10000
iterations = Math.floor(count/block_size)
console.log "Generating #{block_size} random orders..."
orders = (makeRandomOrder() for _ in [1..block_size... | JavaScript | CoffeeScript | buttercoin/buttercoin | perf/market_throughput.coffee | MIT | a9ed301e4930199af5b144d6c3e2d482f424fe3d | 663 | https://github.com/buttercoin/buttercoin/blob/a9ed301e4930199af5b144d6c3e2d482f424fe3d/perf/market_throughput.coffee | 23 | 41 |
buttercoin/buttercoin:perf/market_throughput.coffee:5:completion | completion | mixAndMatch = (n) ->
if (n % 10) >= 5
makeRandomOrder()
else
makeMatchingOrder(n)
market = new Market('BTC', 'USD')
count = 100000000000 | block_size = 10000
iterations = Math.floor(count/block_size)
console.log "Generating #{block_size} random orders..."
orders = (makeRandomOrder() for _ in [1..block_size])
#orders = (makeMatchingOrder(n) for n in [1..block_size])
#orders = (mixAndMatch(n) for n in [1..block_size])
rl = require('readline').createInterf... | CoffeeScript | CoffeeScript | buttercoin/buttercoin | perf/market_throughput.coffee | MIT | a9ed301e4930199af5b144d6c3e2d482f424fe3d | 663 | https://github.com/buttercoin/buttercoin/blob/a9ed301e4930199af5b144d6c3e2d482f424fe3d/perf/market_throughput.coffee | 23 | 41 |
buttercoin/buttercoin:perf/market_throughput.coffee:6:raw_corpus | raw_corpus | rl.clearLine = ->
if process.platform is 'darwin'
@output.write("\u001B[2K\r")
else
@write(null, {ctrl: true, name: 'u'}) | CoffeeScript | buttercoin/buttercoin | perf/market_throughput.coffee | MIT | a9ed301e4930199af5b144d6c3e2d482f424fe3d | 663 | https://github.com/buttercoin/buttercoin/blob/a9ed301e4930199af5b144d6c3e2d482f424fe3d/perf/market_throughput.coffee | 42 | 46 | ||
buttercoin/buttercoin:perf/market_throughput.coffee:6:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
rl.clearLine = ->
if process.platform is 'darwin'
@output.write("\u001B[2K\r")
else
@write(null, {ctrl: true, name: 'u'})
``` | rl.clearLine = function() {
if (process.platform === 'darwin') {
return this.output.write("\u001B[2K\r");
} else {
return this.write(null, {
ctrl: true,
name: 'u'
});
}
}; | CoffeeScript | JavaScript | buttercoin/buttercoin | perf/market_throughput.coffee | MIT | a9ed301e4930199af5b144d6c3e2d482f424fe3d | 663 | https://github.com/buttercoin/buttercoin/blob/a9ed301e4930199af5b144d6c3e2d482f424fe3d/perf/market_throughput.coffee | 42 | 46 |
buttercoin/buttercoin:perf/market_throughput.coffee:6:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
rl.clearLine = function() {
if (process.platform === 'darwin') {
return this.output.write("\u001B[2K\r");
} else {
return this.write(null, {
ctrl: true,
name: 'u'
});
}
};
``` | rl.clearLine = ->
if process.platform is 'darwin'
@output.write("\u001B[2K\r")
else
@write(null, {ctrl: true, name: 'u'}) | JavaScript | CoffeeScript | buttercoin/buttercoin | perf/market_throughput.coffee | MIT | a9ed301e4930199af5b144d6c3e2d482f424fe3d | 663 | https://github.com/buttercoin/buttercoin/blob/a9ed301e4930199af5b144d6c3e2d482f424fe3d/perf/market_throughput.coffee | 42 | 46 |
buttercoin/buttercoin:perf/market_throughput.coffee:6:completion | completion | rl.clearLine = ->
if process.platform is 'darwin' | @output.write("\u001B[2K\r")
else
@write(null, {ctrl: true, name: 'u'}) | CoffeeScript | CoffeeScript | buttercoin/buttercoin | perf/market_throughput.coffee | MIT | a9ed301e4930199af5b144d6c3e2d482f424fe3d | 663 | https://github.com/buttercoin/buttercoin/blob/a9ed301e4930199af5b144d6c3e2d482f424fe3d/perf/market_throughput.coffee | 42 | 46 |
buttercoin/buttercoin:perf/market_throughput.coffee:9:raw_corpus | raw_corpus | rl.clearScreen = ->
@output.write("\u001B[2J")
@output.write("\u001B[H")
rl.on 'SIGINT', -> process.exit(1)
output_events = 0
startTime = process.hrtime()
[1..iterations].forEach (iterN) ->
generation = iterN * block_size
orders.forEach (x, blockIdx) ->
idx = generation + blockIdx
output_events += ma... | CoffeeScript | buttercoin/buttercoin | perf/market_throughput.coffee | MIT | a9ed301e4930199af5b144d6c3e2d482f424fe3d | 663 | https://github.com/buttercoin/buttercoin/blob/a9ed301e4930199af5b144d6c3e2d482f424fe3d/perf/market_throughput.coffee | 54 | 92 | ||
buttercoin/buttercoin:perf/market_throughput.coffee:9:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
rl.clearScreen = ->
@output.write("\u001B[2J")
@output.write("\u001B[H")
rl.on 'SIGINT', -> process.exit(1)
output_events = 0
startTime = process.hrtime()
[1..iterations].forEach (iterN) ->
generation = iterN * block_size
orders.forEach (x, blockIdx) -... | var elapsedTime, output_events, startTime;
rl.clearScreen = function() {
this.output.write("\u001B[2J");
return this.output.write("\u001B[H");
};
rl.on('SIGINT', function() {
return process.exit(1);
});
output_events = 0;
startTime = process.hrtime();
(function() {
var results = [];
for (var i = 1; 1 <= ... | CoffeeScript | JavaScript | buttercoin/buttercoin | perf/market_throughput.coffee | MIT | a9ed301e4930199af5b144d6c3e2d482f424fe3d | 663 | https://github.com/buttercoin/buttercoin/blob/a9ed301e4930199af5b144d6c3e2d482f424fe3d/perf/market_throughput.coffee | 54 | 92 |
buttercoin/buttercoin:perf/market_throughput.coffee:9:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
var elapsedTime, output_events, startTime;
rl.clearScreen = function() {
this.output.write("\u001B[2J");
return this.output.write("\u001B[H");
};
rl.on('SIGINT', function() {
return process.exit(1);
});
output_events = 0;
startTime = process.hrtime();
(f... | rl.clearScreen = ->
@output.write("\u001B[2J")
@output.write("\u001B[H")
rl.on 'SIGINT', -> process.exit(1)
output_events = 0
startTime = process.hrtime()
[1..iterations].forEach (iterN) ->
generation = iterN * block_size
orders.forEach (x, blockIdx) ->
idx = generation + blockIdx
output_events += ma... | JavaScript | CoffeeScript | buttercoin/buttercoin | perf/market_throughput.coffee | MIT | a9ed301e4930199af5b144d6c3e2d482f424fe3d | 663 | https://github.com/buttercoin/buttercoin/blob/a9ed301e4930199af5b144d6c3e2d482f424fe3d/perf/market_throughput.coffee | 54 | 92 |
buttercoin/buttercoin:perf/market_throughput.coffee:9:completion | completion | rl.clearScreen = ->
@output.write("\u001B[2J")
@output.write("\u001B[H")
rl.on 'SIGINT', -> process.exit(1)
output_events = 0
startTime = process.hrtime()
[1..iterations].forEach (iterN) ->
generation = iterN * block_size
orders.forEach (x, blockIdx) ->
idx = generation + blockIdx
output_events += ma... | rl.write("#{(elapsedTime/1000).toFixed(1)} seconds (#{(idx/count*100).toFixed(2)}%)")
rl.down()
rl.clearLine()
rl.write("--> #{(idx/elapsedTime*1000).toFixed(0)} tx/sec")
rl.down()
rl.clearLine()
rl.write("--> #{(output_events/elapsedTime*1000).toFixed(0)} events/sec")
rl.resum... | CoffeeScript | CoffeeScript | buttercoin/buttercoin | perf/market_throughput.coffee | MIT | a9ed301e4930199af5b144d6c3e2d482f424fe3d | 663 | https://github.com/buttercoin/buttercoin/blob/a9ed301e4930199af5b144d6c3e2d482f424fe3d/perf/market_throughput.coffee | 54 | 92 |
buttercoin/buttercoin:perf/market_throughput.coffee:1:raw_corpus | raw_corpus | Market = require('../lib/datastore/market')
Order = require ('../lib/datastore/order')
DQ = require('deque')
randomInt = (lower, upper) ->
Math.floor(Math.random() * (upper - lower + 1)) + lower
randomBool = -> randomInt(0, 1)
acctID = 1
makeRandomOrder = ->
currencies = ['BTC', 'USD']
currencies = currencies... | CoffeeScript | buttercoin/buttercoin | perf/market_throughput.coffee | MIT | 9132b62466965491ac27a0fd16328a4c2ac61eef | 663 | https://github.com/buttercoin/buttercoin/blob/9132b62466965491ac27a0fd16328a4c2ac61eef/perf/market_throughput.coffee | 1 | 50 | ||
buttercoin/buttercoin:perf/market_throughput.coffee:1:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
Market = require('../lib/datastore/market')
Order = require ('../lib/datastore/order')
DQ = require('deque')
randomInt = (lower, upper) ->
Math.floor(Math.random() * (upper - lower + 1)) + lower
randomBool = -> randomInt(0, 1)
acctID = 1
makeRandomOrder = -... | var DQ, Market, Order, _, acctID, block_size, count, iterations, makeRandomOrder, market, orders, output_events, randomBool, randomInt, rl, startTime;
Market = require('../lib/datastore/market');
Order = require('../lib/datastore/order');
DQ = require('deque');
randomInt = function(lower, upper) {
return Math.flo... | CoffeeScript | JavaScript | buttercoin/buttercoin | perf/market_throughput.coffee | MIT | 9132b62466965491ac27a0fd16328a4c2ac61eef | 663 | https://github.com/buttercoin/buttercoin/blob/9132b62466965491ac27a0fd16328a4c2ac61eef/perf/market_throughput.coffee | 1 | 50 |
buttercoin/buttercoin:perf/market_throughput.coffee:1:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
var DQ, Market, Order, _, acctID, block_size, count, iterations, makeRandomOrder, market, orders, output_events, randomBool, randomInt, rl, startTime;
Market = require('../lib/datastore/market');
Order = require('../lib/datastore/order');
DQ = require('deque');
... | Market = require('../lib/datastore/market')
Order = require ('../lib/datastore/order')
DQ = require('deque')
randomInt = (lower, upper) ->
Math.floor(Math.random() * (upper - lower + 1)) + lower
randomBool = -> randomInt(0, 1)
acctID = 1
makeRandomOrder = ->
currencies = ['BTC', 'USD']
currencies = currencies... | JavaScript | CoffeeScript | buttercoin/buttercoin | perf/market_throughput.coffee | MIT | 9132b62466965491ac27a0fd16328a4c2ac61eef | 663 | https://github.com/buttercoin/buttercoin/blob/9132b62466965491ac27a0fd16328a4c2ac61eef/perf/market_throughput.coffee | 1 | 50 |
buttercoin/buttercoin:perf/market_throughput.coffee:1:completion | completion | Market = require('../lib/datastore/market')
Order = require ('../lib/datastore/order')
DQ = require('deque')
randomInt = (lower, upper) ->
Math.floor(Math.random() * (upper - lower + 1)) + lower
randomBool = -> randomInt(0, 1)
acctID = 1
makeRandomOrder = ->
currencies = ['BTC', 'USD']
currencies = currencies... | rl = require('readline').createInterface(process.stdin, process.stdout)
rl.setPrompt('', 0)
rl.clearLine = ->
if process.platform is 'darwin'
@output.write("\u001B[2K\r")
else
@write(null, {ctrl: true, name: 'u'})
rl.up = (n=1) ->
@output.write("\u001B[#{n}A")
rl.down = (n=1) ->
@output.write("\u001B[... | CoffeeScript | CoffeeScript | buttercoin/buttercoin | perf/market_throughput.coffee | MIT | 9132b62466965491ac27a0fd16328a4c2ac61eef | 663 | https://github.com/buttercoin/buttercoin/blob/9132b62466965491ac27a0fd16328a4c2ac61eef/perf/market_throughput.coffee | 1 | 50 |
buttercoin/buttercoin:perf/market_throughput.coffee:2:raw_corpus | raw_corpus | orders.forEach (x, blockIdx) ->
idx = generation + blockIdx
output_events += market.add_order(x).length
if (idx % block_size) == 0
elapsedTime = process.hrtime(startTime)
elapsedTime = elapsedTime[0]*1000 + elapsedTime[1] / 1000000
rl.clearScreen()
rl.write("#{(elapsedTime/1000).toF... | CoffeeScript | buttercoin/buttercoin | perf/market_throughput.coffee | MIT | 9132b62466965491ac27a0fd16328a4c2ac61eef | 663 | https://github.com/buttercoin/buttercoin/blob/9132b62466965491ac27a0fd16328a4c2ac61eef/perf/market_throughput.coffee | 51 | 78 | ||
buttercoin/buttercoin:perf/market_throughput.coffee:2:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
orders.forEach (x, blockIdx) ->
idx = generation + blockIdx
output_events += market.add_order(x).length
if (idx % block_size) == 0
elapsedTime = process.hrtime(startTime)
elapsedTime = elapsedTime[0]*1000 + elapsedTime[1] / 1000000
... | var elapsedTime;
orders.forEach(function(x, blockIdx) {
var elapsedTime, idx;
idx = generation + blockIdx;
output_events += market.add_order(x).length;
if ((idx % block_size) === 0) {
elapsedTime = process.hrtime(startTime);
elapsedTime = elapsedTime[0] * 1000 + elapsedTime[1] / 1000000;
rl.clearSc... | CoffeeScript | JavaScript | buttercoin/buttercoin | perf/market_throughput.coffee | MIT | 9132b62466965491ac27a0fd16328a4c2ac61eef | 663 | https://github.com/buttercoin/buttercoin/blob/9132b62466965491ac27a0fd16328a4c2ac61eef/perf/market_throughput.coffee | 51 | 78 |
buttercoin/buttercoin:perf/market_throughput.coffee:2:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
var elapsedTime;
orders.forEach(function(x, blockIdx) {
var elapsedTime, idx;
idx = generation + blockIdx;
output_events += market.add_order(x).length;
if ((idx % block_size) === 0) {
elapsedTime = process.hrtime(startTime);
elapsedTime = elapsedTi... | orders.forEach (x, blockIdx) ->
idx = generation + blockIdx
output_events += market.add_order(x).length
if (idx % block_size) == 0
elapsedTime = process.hrtime(startTime)
elapsedTime = elapsedTime[0]*1000 + elapsedTime[1] / 1000000
rl.clearScreen()
rl.write("#{(elapsedTime/1000).toF... | JavaScript | CoffeeScript | buttercoin/buttercoin | perf/market_throughput.coffee | MIT | 9132b62466965491ac27a0fd16328a4c2ac61eef | 663 | https://github.com/buttercoin/buttercoin/blob/9132b62466965491ac27a0fd16328a4c2ac61eef/perf/market_throughput.coffee | 51 | 78 |
buttercoin/buttercoin:perf/market_throughput.coffee:2:completion | completion | orders.forEach (x, blockIdx) ->
idx = generation + blockIdx
output_events += market.add_order(x).length
if (idx % block_size) == 0
elapsedTime = process.hrtime(startTime)
elapsedTime = elapsedTime[0]*1000 + elapsedTime[1] / 1000000
rl.clearScreen()
rl.write("#{(elapsedTime/1000).toF... | rl.write("--> #{(output_events/elapsedTime*1000).toFixed(0)} events/sec")
rl.resume()
elapsedTime = process.hrtime(startTime)
elapsedTime = elapsedTime[0]*1000 + elapsedTime[1] / 1000000
rl.clearScreen()
rl.resume()
rl.close()
console.log "#{count} transactions in #{elapsedTime.toFixed(3)} ms"
console.log "\t#... | CoffeeScript | CoffeeScript | buttercoin/buttercoin | perf/market_throughput.coffee | MIT | 9132b62466965491ac27a0fd16328a4c2ac61eef | 663 | https://github.com/buttercoin/buttercoin/blob/9132b62466965491ac27a0fd16328a4c2ac61eef/perf/market_throughput.coffee | 51 | 78 |
jianliaoim/talk-os:talk-web/client/app/message-attachment.coffee:1:raw_corpus | raw_corpus | React = require 'react'
Immutable = require 'immutable'
cx = require 'classnames'
recorder = require 'actions-recorder'
PureRenderMixin = require 'react-addons-pure-render-mixin'
query = require '../query'
mixinMessageHandler = require '../mixin/message-handler'
mixinMessageContent = require '../mixin/message-content'... | CoffeeScript | jianliaoim/talk-os | talk-web/client/app/message-attachment.coffee | MIT | 2545c4497865779a55762e03963a39237df9046b | 2,703 | https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-web/client/app/message-attachment.coffee | 1 | 50 | ||
jianliaoim/talk-os:talk-web/client/app/message-attachment.coffee:1:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
React = require 'react'
Immutable = require 'immutable'
cx = require 'classnames'
recorder = require 'actions-recorder'
PureRenderMixin = require 'react-addons-pure-render-mixin'
query = require '../query'
mixinMessageHandler = require '../mixin/message-handler'... | var Immutable, PureRenderMixin, React, RelativeTime, T, UserAlias, cx, div, mixinMessageContent, mixinMessageHandler, query, recorder, span;
React = require('react');
Immutable = require('immutable');
cx = require('classnames');
recorder = require('actions-recorder');
PureRenderMixin = require('react-addons-pure-r... | CoffeeScript | JavaScript | jianliaoim/talk-os | talk-web/client/app/message-attachment.coffee | MIT | 2545c4497865779a55762e03963a39237df9046b | 2,703 | https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-web/client/app/message-attachment.coffee | 1 | 50 |
jianliaoim/talk-os:talk-web/client/app/message-attachment.coffee:1:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
var Immutable, PureRenderMixin, React, RelativeTime, T, UserAlias, cx, div, mixinMessageContent, mixinMessageHandler, query, recorder, span;
React = require('react');
Immutable = require('immutable');
cx = require('classnames');
recorder = require('actions-reco... | React = require 'react'
Immutable = require 'immutable'
cx = require 'classnames'
recorder = require 'actions-recorder'
PureRenderMixin = require 'react-addons-pure-render-mixin'
query = require '../query'
mixinMessageHandler = require '../mixin/message-handler'
mixinMessageContent = require '../mixin/message-content'... | JavaScript | CoffeeScript | jianliaoim/talk-os | talk-web/client/app/message-attachment.coffee | MIT | 2545c4497865779a55762e03963a39237df9046b | 2,703 | https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-web/client/app/message-attachment.coffee | 1 | 50 |
jianliaoim/talk-os:talk-web/client/app/message-attachment.coffee:1:completion | completion | React = require 'react'
Immutable = require 'immutable'
cx = require 'classnames'
recorder = require 'actions-recorder'
PureRenderMixin = require 'react-addons-pure-render-mixin'
query = require '../query'
mixinMessageHandler = require '../mixin/message-handler'
mixinMessageContent = require '../mixin/message-content'... | renderMessageAuthor: ->
return if not @props.message.has('creator')
style =
if @props.message.has('authorAvatarUrl')
backgroundImage: "url(#{ @props.message.get('authorAvatarUrl') })"
else
backgroundImage: "url(#{ @props.message.getIn(['creator', 'avatarUrl']) })"
div
ref... | CoffeeScript | CoffeeScript | jianliaoim/talk-os | talk-web/client/app/message-attachment.coffee | MIT | 2545c4497865779a55762e03963a39237df9046b | 2,703 | https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-web/client/app/message-attachment.coffee | 1 | 50 |
jianliaoim/talk-os:talk-web/client/app/message-attachment.coffee:2:raw_corpus | raw_corpus | div className: 'header flex-horiz line',
span className: 'bold', onClick: @onAuthorClick,
UserAlias _teamId: @props.message.get('_teamId'), _userId: @props.message.get('_creatorId'), defaultName: @getAuthorName()
RelativeTime data: @props.message.get('createdAt'), edited: @props.message.get('updated... | CoffeeScript | jianliaoim/talk-os | talk-web/client/app/message-attachment.coffee | MIT | 2545c4497865779a55762e03963a39237df9046b | 2,703 | https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-web/client/app/message-attachment.coffee | 51 | 76 | ||
jianliaoim/talk-os:talk-web/client/app/message-attachment.coffee:2:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
div className: 'header flex-horiz line',
span className: 'bold', onClick: @onAuthorClick,
UserAlias _teamId: @props.message.get('_teamId'), _userId: @props.message.get('_creatorId'), defaultName: @getAuthorName()
RelativeTime data: @props.mess... | div({
className: 'header flex-horiz line'
}, span({
className: 'bold',
onClick: this.onAuthorClick
}, UserAlias({
_teamId: this.props.message.get('_teamId'),
_userId: this.props.message.get('_creatorId'),
defaultName: this.getAuthorName()
})), RelativeTime({
data: this.props.message.get('createdAt'),
ed... | CoffeeScript | JavaScript | jianliaoim/talk-os | talk-web/client/app/message-attachment.coffee | MIT | 2545c4497865779a55762e03963a39237df9046b | 2,703 | https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-web/client/app/message-attachment.coffee | 51 | 76 |
jianliaoim/talk-os:talk-web/client/app/message-attachment.coffee:2:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
div({
className: 'header flex-horiz line'
}, span({
className: 'bold',
onClick: this.onAuthorClick
}, UserAlias({
_teamId: this.props.message.get('_teamId'),
_userId: this.props.message.get('_creatorId'),
defaultName: this.getAuthorName()
})), RelativeT... | div className: 'header flex-horiz line',
span className: 'bold', onClick: @onAuthorClick,
UserAlias _teamId: @props.message.get('_teamId'), _userId: @props.message.get('_creatorId'), defaultName: @getAuthorName()
RelativeTime data: @props.message.get('createdAt'), edited: @props.message.get('updated... | JavaScript | CoffeeScript | jianliaoim/talk-os | talk-web/client/app/message-attachment.coffee | MIT | 2545c4497865779a55762e03963a39237df9046b | 2,703 | https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-web/client/app/message-attachment.coffee | 51 | 76 |
jianliaoim/talk-os:talk-web/client/app/message-attachment.coffee:2:completion | completion | div className: 'header flex-horiz line',
span className: 'bold', onClick: @onAuthorClick,
UserAlias _teamId: @props.message.get('_teamId'), _userId: @props.message.get('_creatorId'), defaultName: @getAuthorName()
RelativeTime data: @props.message.get('createdAt'), edited: @props.message.get('updated... | classMessage = cx 'message-rich', 'flex-horiz',
'is-duplicated': @props.isDuplicated
'be-mine': @props.message.getIn(['creator', '_id']) is _userId
'is-robot': @props.message.getIn(['creator', 'isRobot'])
'is-selected': @props.selected
'is-local': @props.message.get('isLocal')
div cla... | CoffeeScript | CoffeeScript | jianliaoim/talk-os | talk-web/client/app/message-attachment.coffee | MIT | 2545c4497865779a55762e03963a39237df9046b | 2,703 | https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-web/client/app/message-attachment.coffee | 51 | 76 |
jianliaoim/talk-os:talk-api2x/server/schemas/activity.coffee:1:raw_corpus | raw_corpus | module.exports = ActivitySchema = new Schema
team: type: Schema.Types.ObjectId, ref: 'Team', required: true
target: type: Schema.Types.ObjectId
type: type: String
creator: type: Schema.Types.ObjectId, ref: 'User'
isPublic: type: Boolean, default: false
members: [
type: Schema.Types.ObjectId, ref: 'User'... | CoffeeScript | jianliaoim/talk-os | talk-api2x/server/schemas/activity.coffee | MIT | 2545c4497865779a55762e03963a39237df9046b | 2,703 | https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-api2x/server/schemas/activity.coffee | 12 | 45 | ||
jianliaoim/talk-os:talk-api2x/server/schemas/activity.coffee:1:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
module.exports = ActivitySchema = new Schema
team: type: Schema.Types.ObjectId, ref: 'Team', required: true
target: type: Schema.Types.ObjectId
type: type: String
creator: type: Schema.Types.ObjectId, ref: 'User'
isPublic: type: Boolean, default: false
... | var ActivitySchema;
module.exports = ActivitySchema = new Schema({
team: {
type: Schema.Types.ObjectId,
ref: 'Team',
required: true
},
target: {
type: Schema.Types.ObjectId
},
type: {
type: String
},
creator: {
type: Schema.Types.ObjectId,
ref: 'User'
},
isPublic: {
ty... | CoffeeScript | JavaScript | jianliaoim/talk-os | talk-api2x/server/schemas/activity.coffee | MIT | 2545c4497865779a55762e03963a39237df9046b | 2,703 | https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-api2x/server/schemas/activity.coffee | 12 | 45 |
jianliaoim/talk-os:talk-api2x/server/schemas/activity.coffee:1:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
var ActivitySchema;
module.exports = ActivitySchema = new Schema({
team: {
type: Schema.Types.ObjectId,
ref: 'Team',
required: true
},
target: {
type: Schema.Types.ObjectId
},
type: {
type: String
},
creator: {
type: Schema.Ty... | module.exports = ActivitySchema = new Schema
team: type: Schema.Types.ObjectId, ref: 'Team', required: true
target: type: Schema.Types.ObjectId
type: type: String
creator: type: Schema.Types.ObjectId, ref: 'User'
isPublic: type: Boolean, default: false
members: [
type: Schema.Types.ObjectId, ref: 'User'... | JavaScript | CoffeeScript | jianliaoim/talk-os | talk-api2x/server/schemas/activity.coffee | MIT | 2545c4497865779a55762e03963a39237df9046b | 2,703 | https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-api2x/server/schemas/activity.coffee | 12 | 45 |
jianliaoim/talk-os:talk-api2x/server/schemas/activity.coffee:1:completion | completion | module.exports = ActivitySchema = new Schema
team: type: Schema.Types.ObjectId, ref: 'Team', required: true
target: type: Schema.Types.ObjectId
type: type: String
creator: type: Schema.Types.ObjectId, ref: 'User'
isPublic: type: Boolean, default: false
members: [
type: Schema.Types.ObjectId, ref: 'User'... | toJSON:
virtuals: true
getters: true
ActivitySchema.virtual '_teamId'
.get -> @team?._id or @team
.set (_id) -> @team = _id
ActivitySchema.virtual '_targetId'
.get -> @target?._id or @target
.set (_id) -> @target = _id
ActivitySchema.virtual '_creatorId'
.get -> @creator?._id or @creator
.set (_i... | CoffeeScript | CoffeeScript | jianliaoim/talk-os | talk-api2x/server/schemas/activity.coffee | MIT | 2545c4497865779a55762e03963a39237df9046b | 2,703 | https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-api2x/server/schemas/activity.coffee | 12 | 45 |
jianliaoim/talk-os:talk-api2x/server/schemas/activity.coffee:2:raw_corpus | raw_corpus | ActivitySchema.methods.getPopulated = (callback) ->
activity = this
unless activity.$populating
switch activity.type
when 'room' then modelName = 'Room'
when 'dms' then modelName = 'User'
when 'story' then modelName = 'Story'
else callback null, activity
activity.$populating = Prom... | CoffeeScript | jianliaoim/talk-os | talk-api2x/server/schemas/activity.coffee | MIT | 2545c4497865779a55762e03963a39237df9046b | 2,703 | https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-api2x/server/schemas/activity.coffee | 47 | 73 | ||
jianliaoim/talk-os:talk-api2x/server/schemas/activity.coffee:2:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
ActivitySchema.methods.getPopulated = (callback) ->
activity = this
unless activity.$populating
switch activity.type
when 'room' then modelName = 'Room'
when 'dms' then modelName = 'User'
when 'story' then modelName = 'Story'
els... | ActivitySchema.methods.getPopulated = function(callback) {
var activity, modelName;
activity = this;
if (!activity.$populating) {
switch (activity.type) {
case 'room':
modelName = 'Room';
break;
case 'dms':
modelName = 'User';
break;
case 'story':
mode... | CoffeeScript | JavaScript | jianliaoim/talk-os | talk-api2x/server/schemas/activity.coffee | MIT | 2545c4497865779a55762e03963a39237df9046b | 2,703 | https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-api2x/server/schemas/activity.coffee | 47 | 73 |
jianliaoim/talk-os:talk-api2x/server/schemas/activity.coffee:2:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
ActivitySchema.methods.getPopulated = function(callback) {
var activity, modelName;
activity = this;
if (!activity.$populating) {
switch (activity.type) {
case 'room':
modelName = 'Room';
break;
case 'dms':
modelName = ... | ActivitySchema.methods.getPopulated = (callback) ->
activity = this
unless activity.$populating
switch activity.type
when 'room' then modelName = 'Room'
when 'dms' then modelName = 'User'
when 'story' then modelName = 'Story'
else callback null, activity
activity.$populating = Prom... | JavaScript | CoffeeScript | jianliaoim/talk-os | talk-api2x/server/schemas/activity.coffee | MIT | 2545c4497865779a55762e03963a39237df9046b | 2,703 | https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-api2x/server/schemas/activity.coffee | 47 | 73 |
jianliaoim/talk-os:talk-api2x/server/schemas/activity.coffee:2:completion | completion | ActivitySchema.methods.getPopulated = (callback) ->
activity = this
unless activity.$populating
switch activity.type
when 'room' then modelName = 'Room'
when 'dms' then modelName = 'User'
when 'story' then modelName = 'Story'
else callback null, activity
activity.$populating = Prom... | model: modelName
,
path: 'creator'
]
activity.$populating.nodeify callback
# ============================== Statics ==============================
###*
* Find activities by options
* @param {Object} options - Should contain `team` and `user` params
* @param {Function} callback
### | CoffeeScript | CoffeeScript | jianliaoim/talk-os | talk-api2x/server/schemas/activity.coffee | MIT | 2545c4497865779a55762e03963a39237df9046b | 2,703 | https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-api2x/server/schemas/activity.coffee | 47 | 73 |
jianliaoim/talk-os:talk-api2x/server/schemas/activity.coffee:3:raw_corpus | raw_corpus | ActivitySchema.statics.findByOptions = (options, callback) ->
requiredFields = ['team', 'user']
missingFields = requiredFields.reduce (fields, key) ->
fields.push key unless options[key]
fields
, []
return callback(new Err('PARAMS_MISSING', missingFields)) if missingFields.length
ActivityModel = this... | CoffeeScript | jianliaoim/talk-os | talk-api2x/server/schemas/activity.coffee | MIT | 2545c4497865779a55762e03963a39237df9046b | 2,703 | https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-api2x/server/schemas/activity.coffee | 74 | 104 | ||
jianliaoim/talk-os:talk-api2x/server/schemas/activity.coffee:3:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
ActivitySchema.statics.findByOptions = (options, callback) ->
requiredFields = ['team', 'user']
missingFields = requiredFields.reduce (fields, key) ->
fields.push key unless options[key]
fields
, []
return callback(new Err('PARAMS_MISSING', missin... | ActivitySchema.statics.findByOptions = function(options, callback) {
var $activities, ActivityModel, conditions, missingFields, requiredFields;
requiredFields = ['team', 'user'];
missingFields = requiredFields.reduce(function(fields, key) {
if (!options[key]) {
fields.push(key);
}
return fields;... | CoffeeScript | JavaScript | jianliaoim/talk-os | talk-api2x/server/schemas/activity.coffee | MIT | 2545c4497865779a55762e03963a39237df9046b | 2,703 | https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-api2x/server/schemas/activity.coffee | 74 | 104 |
jianliaoim/talk-os:talk-api2x/server/schemas/activity.coffee:3:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
ActivitySchema.statics.findByOptions = function(options, callback) {
var $activities, ActivityModel, conditions, missingFields, requiredFields;
requiredFields = ['team', 'user'];
missingFields = requiredFields.reduce(function(fields, key) {
if (!options[k... | ActivitySchema.statics.findByOptions = (options, callback) ->
requiredFields = ['team', 'user']
missingFields = requiredFields.reduce (fields, key) ->
fields.push key unless options[key]
fields
, []
return callback(new Err('PARAMS_MISSING', missingFields)) if missingFields.length
ActivityModel = this... | JavaScript | CoffeeScript | jianliaoim/talk-os | talk-api2x/server/schemas/activity.coffee | MIT | 2545c4497865779a55762e03963a39237df9046b | 2,703 | https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-api2x/server/schemas/activity.coffee | 74 | 104 |
jianliaoim/talk-os:talk-api2x/server/schemas/activity.coffee:3:completion | completion | ActivitySchema.statics.findByOptions = (options, callback) ->
requiredFields = ['team', 'user']
missingFields = requiredFields.reduce (fields, key) ->
fields.push key unless options[key]
fields
, []
return callback(new Err('PARAMS_MISSING', missingFields)) if missingFields.length
ActivityModel = this... | members: options.user
]
options.sort = createdAt: -1
if options.maxDate
conditions.createdAt = $lt: options.maxDate
else if options.minDate
conditions.createdAt = $gte: options.minDate
options.sort = createdAt: 1
$activities = @_buildQuery(conditions, options).execAsync()
.map (activity) -... | CoffeeScript | CoffeeScript | jianliaoim/talk-os | talk-api2x/server/schemas/activity.coffee | MIT | 2545c4497865779a55762e03963a39237df9046b | 2,703 | https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-api2x/server/schemas/activity.coffee | 74 | 104 |
Glavin001/atom-beautify:src/beautifiers/sass-convert.coffee:1:raw_corpus | raw_corpus | "use strict"
Beautifier = require('./beautifier')
module.exports = class SassConvert extends Beautifier
name: "SassConvert"
link: "http://sass-lang.com/documentation/file.SASS_REFERENCE.html#syntax"
executables: [
{
name: "SassConvert"
cmd: "sass-convert"
homepage: "http://sass-lang.com/doc... | CoffeeScript | Glavin001/atom-beautify | src/beautifiers/sass-convert.coffee | MIT | 41d5051b399f7fe11efd149504a232df16179d60 | 1,503 | https://github.com/Glavin001/atom-beautify/blob/41d5051b399f7fe11efd149504a232df16179d60/src/beautifiers/sass-convert.coffee | 1 | 33 | ||
Glavin001/atom-beautify:src/beautifiers/sass-convert.coffee:1:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
"use strict"
Beautifier = require('./beautifier')
module.exports = class SassConvert extends Beautifier
name: "SassConvert"
link: "http://sass-lang.com/documentation/file.SASS_REFERENCE.html#syntax"
executables: [
{
name: "SassConvert"
cmd:... | "use strict";
var Beautifier, SassConvert;
Beautifier = require('./beautifier');
module.exports = SassConvert = (function() {
class SassConvert extends Beautifier {
beautify(text, language, options, context) {
var lang;
lang = language.toLowerCase();
return this.exe("sass-convert").run([this.t... | CoffeeScript | JavaScript | Glavin001/atom-beautify | src/beautifiers/sass-convert.coffee | MIT | 41d5051b399f7fe11efd149504a232df16179d60 | 1,503 | https://github.com/Glavin001/atom-beautify/blob/41d5051b399f7fe11efd149504a232df16179d60/src/beautifiers/sass-convert.coffee | 1 | 33 |
Glavin001/atom-beautify:src/beautifiers/sass-convert.coffee:1:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
"use strict";
var Beautifier, SassConvert;
Beautifier = require('./beautifier');
module.exports = SassConvert = (function() {
class SassConvert extends Beautifier {
beautify(text, language, options, context) {
var lang;
lang = language.toLowerCa... | "use strict"
Beautifier = require('./beautifier')
module.exports = class SassConvert extends Beautifier
name: "SassConvert"
link: "http://sass-lang.com/documentation/file.SASS_REFERENCE.html#syntax"
executables: [
{
name: "SassConvert"
cmd: "sass-convert"
homepage: "http://sass-lang.com/doc... | JavaScript | CoffeeScript | Glavin001/atom-beautify | src/beautifiers/sass-convert.coffee | MIT | 41d5051b399f7fe11efd149504a232df16179d60 | 1,503 | https://github.com/Glavin001/atom-beautify/blob/41d5051b399f7fe11efd149504a232df16179d60/src/beautifiers/sass-convert.coffee | 1 | 33 |
Glavin001/atom-beautify:src/beautifiers/sass-convert.coffee:1:completion | completion | "use strict"
Beautifier = require('./beautifier')
module.exports = class SassConvert extends Beautifier
name: "SassConvert"
link: "http://sass-lang.com/documentation/file.SASS_REFERENCE.html#syntax"
executables: [
{
name: "SassConvert"
cmd: "sass-convert"
homepage: "http://sass-lang.com/doc... | image: "unibeautify/sass-convert"
}
}
]
options:
# TODO: Add support for options
CSS: false
Sass: false
SCSS: false
beautify: (text, language, options, context) ->
lang = language.toLowerCase()
@exe("sass-convert").run([
@tempFile("input", text),
"--from", lang, "--... | CoffeeScript | CoffeeScript | Glavin001/atom-beautify | src/beautifiers/sass-convert.coffee | MIT | 41d5051b399f7fe11efd149504a232df16179d60 | 1,503 | https://github.com/Glavin001/atom-beautify/blob/41d5051b399f7fe11efd149504a232df16179d60/src/beautifiers/sass-convert.coffee | 1 | 33 |
Glavin001/atom-beautify:src/beautifiers/sass-convert.coffee:1:raw_corpus | raw_corpus | "use strict"
Beautifier = require('./beautifier')
module.exports = class SassConvert extends Beautifier
name: "SassConvert"
link: "http://sass-lang.com/documentation/file.SASS_REFERENCE.html#syntax"
isPreInstalled: false
options:
# TODO: Add support for options
CSS: false
Sass: false
SCSS: fal... | CoffeeScript | Glavin001/atom-beautify | src/beautifiers/sass-convert.coffee | MIT | ba2198675cbcc1ecd05f18e28e97133cdd2d5319 | 1,503 | https://github.com/Glavin001/atom-beautify/blob/ba2198675cbcc1ecd05f18e28e97133cdd2d5319/src/beautifiers/sass-convert.coffee | 1 | 21 | ||
Glavin001/atom-beautify:src/beautifiers/sass-convert.coffee:1:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
"use strict"
Beautifier = require('./beautifier')
module.exports = class SassConvert extends Beautifier
name: "SassConvert"
link: "http://sass-lang.com/documentation/file.SASS_REFERENCE.html#syntax"
isPreInstalled: false
options:
# TODO: Add support... | "use strict";
var Beautifier, SassConvert;
Beautifier = require('./beautifier');
module.exports = SassConvert = (function() {
class SassConvert extends Beautifier {
beautify(text, language, options, context) {
var lang;
lang = language.toLowerCase();
return this.run("sass-convert", [this.tempF... | CoffeeScript | JavaScript | Glavin001/atom-beautify | src/beautifiers/sass-convert.coffee | MIT | ba2198675cbcc1ecd05f18e28e97133cdd2d5319 | 1,503 | https://github.com/Glavin001/atom-beautify/blob/ba2198675cbcc1ecd05f18e28e97133cdd2d5319/src/beautifiers/sass-convert.coffee | 1 | 21 |
Glavin001/atom-beautify:src/beautifiers/sass-convert.coffee:1:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
"use strict";
var Beautifier, SassConvert;
Beautifier = require('./beautifier');
module.exports = SassConvert = (function() {
class SassConvert extends Beautifier {
beautify(text, language, options, context) {
var lang;
lang = language.toLowerCa... | "use strict"
Beautifier = require('./beautifier')
module.exports = class SassConvert extends Beautifier
name: "SassConvert"
link: "http://sass-lang.com/documentation/file.SASS_REFERENCE.html#syntax"
isPreInstalled: false
options:
# TODO: Add support for options
CSS: false
Sass: false
SCSS: fal... | JavaScript | CoffeeScript | Glavin001/atom-beautify | src/beautifiers/sass-convert.coffee | MIT | ba2198675cbcc1ecd05f18e28e97133cdd2d5319 | 1,503 | https://github.com/Glavin001/atom-beautify/blob/ba2198675cbcc1ecd05f18e28e97133cdd2d5319/src/beautifiers/sass-convert.coffee | 1 | 21 |
Glavin001/atom-beautify:src/beautifiers/sass-convert.coffee:1:completion | completion | "use strict"
Beautifier = require('./beautifier')
module.exports = class SassConvert extends Beautifier
name: "SassConvert"
link: "http://sass-lang.com/documentation/file.SASS_REFERENCE.html#syntax"
isPreInstalled: false
options:
# TODO: Add support for options | CSS: false
Sass: false
SCSS: false
beautify: (text, language, options, context) ->
lang = language.toLowerCase()
@run("sass-convert", [
@tempFile("input", text),
"--from", lang, "--to", lang
]) | CoffeeScript | CoffeeScript | Glavin001/atom-beautify | src/beautifiers/sass-convert.coffee | MIT | ba2198675cbcc1ecd05f18e28e97133cdd2d5319 | 1,503 | https://github.com/Glavin001/atom-beautify/blob/ba2198675cbcc1ecd05f18e28e97133cdd2d5319/src/beautifiers/sass-convert.coffee | 1 | 21 |
Glavin001/atom-beautify:src/beautifiers/sass-convert.coffee:1:raw_corpus | raw_corpus | "use strict"
Beautifier = require('./beautifier')
module.exports = class SassConvert extends Beautifier
name: "SassConvert"
link: "http://sass-lang.com/documentation/file.SASS_REFERENCE.html#syntax"
options:
# TODO: Add support for options
CSS: false
Sass: false
SCSS: false
beautify: (text, l... | CoffeeScript | Glavin001/atom-beautify | src/beautifiers/sass-convert.coffee | MIT | bef88cf4dc31acc72e501c2cdfdd4701746ca86c | 1,503 | https://github.com/Glavin001/atom-beautify/blob/bef88cf4dc31acc72e501c2cdfdd4701746ca86c/src/beautifiers/sass-convert.coffee | 1 | 20 | ||
Glavin001/atom-beautify:src/beautifiers/sass-convert.coffee:1:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
"use strict"
Beautifier = require('./beautifier')
module.exports = class SassConvert extends Beautifier
name: "SassConvert"
link: "http://sass-lang.com/documentation/file.SASS_REFERENCE.html#syntax"
options:
# TODO: Add support for options
CSS: fa... | "use strict";
var Beautifier, SassConvert;
Beautifier = require('./beautifier');
module.exports = SassConvert = (function() {
class SassConvert extends Beautifier {
beautify(text, language, options, context) {
var lang;
lang = language.toLowerCase();
return this.run("sass-convert", [this.tempF... | CoffeeScript | JavaScript | Glavin001/atom-beautify | src/beautifiers/sass-convert.coffee | MIT | bef88cf4dc31acc72e501c2cdfdd4701746ca86c | 1,503 | https://github.com/Glavin001/atom-beautify/blob/bef88cf4dc31acc72e501c2cdfdd4701746ca86c/src/beautifiers/sass-convert.coffee | 1 | 20 |
Glavin001/atom-beautify:src/beautifiers/sass-convert.coffee:1:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
"use strict";
var Beautifier, SassConvert;
Beautifier = require('./beautifier');
module.exports = SassConvert = (function() {
class SassConvert extends Beautifier {
beautify(text, language, options, context) {
var lang;
lang = language.toLowerCa... | "use strict"
Beautifier = require('./beautifier')
module.exports = class SassConvert extends Beautifier
name: "SassConvert"
link: "http://sass-lang.com/documentation/file.SASS_REFERENCE.html#syntax"
options:
# TODO: Add support for options
CSS: false
Sass: false
SCSS: false
beautify: (text, l... | JavaScript | CoffeeScript | Glavin001/atom-beautify | src/beautifiers/sass-convert.coffee | MIT | bef88cf4dc31acc72e501c2cdfdd4701746ca86c | 1,503 | https://github.com/Glavin001/atom-beautify/blob/bef88cf4dc31acc72e501c2cdfdd4701746ca86c/src/beautifiers/sass-convert.coffee | 1 | 20 |
Glavin001/atom-beautify:src/beautifiers/sass-convert.coffee:1:completion | completion | "use strict"
Beautifier = require('./beautifier')
module.exports = class SassConvert extends Beautifier
name: "SassConvert"
link: "http://sass-lang.com/documentation/file.SASS_REFERENCE.html#syntax"
options:
# TODO: Add support for options
CSS: false | Sass: false
SCSS: false
beautify: (text, language, options, context) ->
lang = language.toLowerCase()
@run("sass-convert", [
@tempFile("input", text),
"--from", lang, "--to", lang
]) | CoffeeScript | CoffeeScript | Glavin001/atom-beautify | src/beautifiers/sass-convert.coffee | MIT | bef88cf4dc31acc72e501c2cdfdd4701746ca86c | 1,503 | https://github.com/Glavin001/atom-beautify/blob/bef88cf4dc31acc72e501c2cdfdd4701746ca86c/src/beautifiers/sass-convert.coffee | 1 | 20 |
AriaMinaei/pretty-error:scripts/coffee/test/ParsedError.coffee:1:raw_corpus | raw_corpus | error = (what) ->
if typeof what is 'string'
return error -> throw Error what
else if what instanceof Function
try
do what
return null
catch e
return e
else
throw Error "bad argument for error"
ParsedError = mod 'ParsedError'
describe "constructor()"
it "should accept Error() instances"... | CoffeeScript | AriaMinaei/pretty-error | scripts/coffee/test/ParsedError.coffee | MIT | 72e1e5204885254abba53cb434abc0fb58da1cec | 1,524 | https://github.com/AriaMinaei/pretty-error/blob/72e1e5204885254abba53cb434abc0fb58da1cec/scripts/coffee/test/ParsedError.coffee | 5 | 54 | ||
AriaMinaei/pretty-error:scripts/coffee/test/ParsedError.coffee:1:completion | completion | error = (what) ->
if typeof what is 'string'
return error -> throw Error what
else if what instanceof Function
try
do what
return null
catch e
return e
else
throw Error "bad argument for error"
ParsedError = mod 'ParsedError' | describe "constructor()"
it "should accept Error() instances", ->
(->
e = new ParsedError error ->
throw Error "some message"
).should.not.throw()
it "should accept ReferenceError() and other derivatives of Error()", ->
(->
e = new ParsedError error ->
throw ReferenceError "some message"
).shoul... | CoffeeScript | CoffeeScript | AriaMinaei/pretty-error | scripts/coffee/test/ParsedError.coffee | MIT | 72e1e5204885254abba53cb434abc0fb58da1cec | 1,524 | https://github.com/AriaMinaei/pretty-error/blob/72e1e5204885254abba53cb434abc0fb58da1cec/scripts/coffee/test/ParsedError.coffee | 5 | 54 |
AriaMinaei/pretty-error:scripts/coffee/test/ParsedError.coffee:2:raw_corpus | raw_corpus | e = new ParsedError 'some string'
).should.not.throw()
describe "message"
it "should return the original error message", ->
e = new ParsedError error 'a'
e.message.should.equal 'a'
describe "kind"
it "should return 'Error' for normal error", ->
e = new ParsedError error 'a'
e.kind.should.equal 'Error'
it... | CoffeeScript | AriaMinaei/pretty-error | scripts/coffee/test/ParsedError.coffee | MIT | 72e1e5204885254abba53cb434abc0fb58da1cec | 1,524 | https://github.com/AriaMinaei/pretty-error/blob/72e1e5204885254abba53cb434abc0fb58da1cec/scripts/coffee/test/ParsedError.coffee | 55 | 104 | ||
AriaMinaei/pretty-error:scripts/coffee/test/ParsedError.coffee:2:completion | completion | e = new ParsedError 'some string'
).should.not.throw()
describe "message"
it "should return the original error message", ->
e = new ParsedError error 'a'
e.message.should.equal 'a'
describe "kind"
it "should return 'Error' for normal error", ->
e = new ParsedError error 'a'
e.kind.should.equal 'Error'
it... | e.kind.should.equal 'ReferenceError'
describe "type"
it "should return original error type", ->
e = new ParsedError error -> a.b = c
expect(e.type).to.equal 'not_defined'
describe "arguments"
it "should return original error arguments", ->
e = new ParsedError error -> a.b = c
expect(e.arguments).to.be.like ... | CoffeeScript | CoffeeScript | AriaMinaei/pretty-error | scripts/coffee/test/ParsedError.coffee | MIT | 72e1e5204885254abba53cb434abc0fb58da1cec | 1,524 | https://github.com/AriaMinaei/pretty-error/blob/72e1e5204885254abba53cb434abc0fb58da1cec/scripts/coffee/test/ParsedError.coffee | 55 | 104 |
AriaMinaei/pretty-error:scripts/coffee/test/ParsedError.coffee:3:raw_corpus | raw_corpus | describe "trace"
it "should include correct information about each trace item", ->
e = new ParsedError error -> a.b = c
e.trace.should.have.length.above 2
item = e.trace[0]
item.should.include.keys 'original',
'what', 'path', 'addr',
'file', 'dir', 'col',
'line', 'jsCol', 'jsLine'
'packageName', 'shor... | CoffeeScript | AriaMinaei/pretty-error | scripts/coffee/test/ParsedError.coffee | MIT | 72e1e5204885254abba53cb434abc0fb58da1cec | 1,524 | https://github.com/AriaMinaei/pretty-error/blob/72e1e5204885254abba53cb434abc0fb58da1cec/scripts/coffee/test/ParsedError.coffee | 105 | 137 | ||
AriaMinaei/pretty-error:scripts/coffee/test/ParsedError.coffee:3:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
describe "trace"
it "should include correct information about each trace item", ->
e = new ParsedError error -> a.b = c
e.trace.should.have.length.above 2
item = e.trace[0]
item.should.include.keys 'original',
'what', 'path', 'addr',
'file', 'dir', ... | describe("trace");
it("should include correct information about each trace item", function() {
var e, item;
e = new ParsedError(error(function() {
return a.b = c;
}));
e.trace.should.have.length.above(2);
item = e.trace[0];
item.should.include.keys('original', 'what', 'path', 'addr', 'file', 'dir', 'co... | CoffeeScript | JavaScript | AriaMinaei/pretty-error | scripts/coffee/test/ParsedError.coffee | MIT | 72e1e5204885254abba53cb434abc0fb58da1cec | 1,524 | https://github.com/AriaMinaei/pretty-error/blob/72e1e5204885254abba53cb434abc0fb58da1cec/scripts/coffee/test/ParsedError.coffee | 105 | 137 |
AriaMinaei/pretty-error:scripts/coffee/test/ParsedError.coffee:3:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
describe("trace");
it("should include correct information about each trace item", function() {
var e, item;
e = new ParsedError(error(function() {
return a.b = c;
}));
e.trace.should.have.length.above(2);
item = e.trace[0];
item.should.include.keys... | describe "trace"
it "should include correct information about each trace item", ->
e = new ParsedError error -> a.b = c
e.trace.should.have.length.above 2
item = e.trace[0]
item.should.include.keys 'original',
'what', 'path', 'addr',
'file', 'dir', 'col',
'line', 'jsCol', 'jsLine'
'packageName', 'shor... | JavaScript | CoffeeScript | AriaMinaei/pretty-error | scripts/coffee/test/ParsedError.coffee | MIT | 72e1e5204885254abba53cb434abc0fb58da1cec | 1,524 | https://github.com/AriaMinaei/pretty-error/blob/72e1e5204885254abba53cb434abc0fb58da1cec/scripts/coffee/test/ParsedError.coffee | 105 | 137 |
AriaMinaei/pretty-error:scripts/coffee/test/ParsedError.coffee:3:completion | completion | describe "trace"
it "should include correct information about each trace item", ->
e = new ParsedError error -> a.b = c
e.trace.should.have.length.above 2
item = e.trace[0]
item.should.include.keys 'original',
'what', 'path', 'addr',
'file', 'dir', 'col',
'line', 'jsCol', 'jsLine'
'packageName', 'shor... | item.path.should.equal module.filename.replace(/[\\]+/g, '/')
item.line.should.be.a 'number'
item.col.should.be.a 'number'
describe "_rectifyPath()"
it "should work", ->
ParsedError::_rectifyPath(
'F:/a/node_modules/b/node_modules/d/node_modules/e/f.js'
).path.should.equal '[a]/[b]/[d]/[e]/f.js'
it "should r... | CoffeeScript | CoffeeScript | AriaMinaei/pretty-error | scripts/coffee/test/ParsedError.coffee | MIT | 72e1e5204885254abba53cb434abc0fb58da1cec | 1,524 | https://github.com/AriaMinaei/pretty-error/blob/72e1e5204885254abba53cb434abc0fb58da1cec/scripts/coffee/test/ParsedError.coffee | 105 | 137 |
AriaMinaei/pretty-error:scripts/coffee/test/ParsedError.coffee:3:raw_corpus | raw_corpus | describe "trace"
it "should include correct information about each trace item", ->
e = new ParsedError error -> a.b = c
e.trace.should.have.length.above 2
item = e.trace[0]
item.should.include.keys 'original',
'what', 'path', 'addr',
'file', 'dir', 'col',
'line', 'jsCol', 'jsLine'
'modName', 'shortene... | CoffeeScript | AriaMinaei/pretty-error | scripts/coffee/test/ParsedError.coffee | MIT | 267b7ee078d601c3c96a773ce3ce31e65028b570 | 1,524 | https://github.com/AriaMinaei/pretty-error/blob/267b7ee078d601c3c96a773ce3ce31e65028b570/scripts/coffee/test/ParsedError.coffee | 105 | 137 | ||
AriaMinaei/pretty-error:scripts/coffee/test/ParsedError.coffee:3:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
describe "trace"
it "should include correct information about each trace item", ->
e = new ParsedError error -> a.b = c
e.trace.should.have.length.above 2
item = e.trace[0]
item.should.include.keys 'original',
'what', 'path', 'addr',
'file', 'dir', ... | describe("trace");
it("should include correct information about each trace item", function() {
var e, item;
e = new ParsedError(error(function() {
return a.b = c;
}));
e.trace.should.have.length.above(2);
item = e.trace[0];
item.should.include.keys('original', 'what', 'path', 'addr', 'file', 'dir', 'co... | CoffeeScript | JavaScript | AriaMinaei/pretty-error | scripts/coffee/test/ParsedError.coffee | MIT | 267b7ee078d601c3c96a773ce3ce31e65028b570 | 1,524 | https://github.com/AriaMinaei/pretty-error/blob/267b7ee078d601c3c96a773ce3ce31e65028b570/scripts/coffee/test/ParsedError.coffee | 105 | 137 |
AriaMinaei/pretty-error:scripts/coffee/test/ParsedError.coffee:3:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
describe("trace");
it("should include correct information about each trace item", function() {
var e, item;
e = new ParsedError(error(function() {
return a.b = c;
}));
e.trace.should.have.length.above(2);
item = e.trace[0];
item.should.include.keys... | describe "trace"
it "should include correct information about each trace item", ->
e = new ParsedError error -> a.b = c
e.trace.should.have.length.above 2
item = e.trace[0]
item.should.include.keys 'original',
'what', 'path', 'addr',
'file', 'dir', 'col',
'line', 'jsCol', 'jsLine'
'modName', 'shortene... | JavaScript | CoffeeScript | AriaMinaei/pretty-error | scripts/coffee/test/ParsedError.coffee | MIT | 267b7ee078d601c3c96a773ce3ce31e65028b570 | 1,524 | https://github.com/AriaMinaei/pretty-error/blob/267b7ee078d601c3c96a773ce3ce31e65028b570/scripts/coffee/test/ParsedError.coffee | 105 | 137 |
AriaMinaei/pretty-error:scripts/coffee/test/ParsedError.coffee:3:completion | completion | describe "trace"
it "should include correct information about each trace item", ->
e = new ParsedError error -> a.b = c
e.trace.should.have.length.above 2
item = e.trace[0]
item.should.include.keys 'original',
'what', 'path', 'addr',
'file', 'dir', 'col',
'line', 'jsCol', 'jsLine'
'modName', 'shortene... | item.path.should.equal module.filename
item.line.should.be.a 'number'
item.col.should.be.a 'number'
describe "_shortenPath()"
it "should work", ->
ParsedError::_shortenPath(
'F:\\a\\node_modules\\b\\node_modules\\d\\node_modules\\e\\f.js'
).should.equal '[a]/[b]/[d]/[e]/f.js'
it "should return path when `nod... | CoffeeScript | CoffeeScript | AriaMinaei/pretty-error | scripts/coffee/test/ParsedError.coffee | MIT | 267b7ee078d601c3c96a773ce3ce31e65028b570 | 1,524 | https://github.com/AriaMinaei/pretty-error/blob/267b7ee078d601c3c96a773ce3ce31e65028b570/scripts/coffee/test/ParsedError.coffee | 105 | 137 |
AriaMinaei/pretty-error:scripts/coffee/test/ParsedError.coffee:1:raw_corpus | raw_corpus | error = (what) ->
if typeof what is 'string'
return error -> throw Error what
else if what instanceof Function
try
do what
return null
catch e
return e
else
throw Error "bad argument for error"
ParsedError = mod 'ParsedError'
describe "constructor()"
it "should accept Error() instances"... | CoffeeScript | AriaMinaei/pretty-error | scripts/coffee/test/ParsedError.coffee | MIT | fc8c237668e5fd4c5a30adf54285cc829047d7ea | 1,524 | https://github.com/AriaMinaei/pretty-error/blob/fc8c237668e5fd4c5a30adf54285cc829047d7ea/scripts/coffee/test/ParsedError.coffee | 5 | 54 | ||
AriaMinaei/pretty-error:scripts/coffee/test/ParsedError.coffee:1:completion | completion | error = (what) ->
if typeof what is 'string'
return error -> throw Error what
else if what instanceof Function
try
do what
return null
catch e
return e
else
throw Error "bad argument for error"
ParsedError = mod 'ParsedError' | describe "constructor()"
it "should accept Error() instances", ->
(->
e = new ParsedError error ->
throw Error "some message"
).should.not.throw()
it "should accept ReferenceError() and other derivatives of Error()", ->
(->
e = new ParsedError error ->
throw ReferenceError "some message"
).shoul... | CoffeeScript | CoffeeScript | AriaMinaei/pretty-error | scripts/coffee/test/ParsedError.coffee | MIT | fc8c237668e5fd4c5a30adf54285cc829047d7ea | 1,524 | https://github.com/AriaMinaei/pretty-error/blob/fc8c237668e5fd4c5a30adf54285cc829047d7ea/scripts/coffee/test/ParsedError.coffee | 5 | 54 |
AriaMinaei/pretty-error:scripts/coffee/test/ParsedError.coffee:2:raw_corpus | raw_corpus | e = new ParsedError 'some string'
).should.throw()
describe "message"
it "should return the original error message", ->
e = new ParsedError error 'a'
e.message.should.equal 'a'
describe "kind"
it "should return 'Error' for normal error", ->
e = new ParsedError error 'a'
e.kind.should.equal 'Error'
it "sh... | CoffeeScript | AriaMinaei/pretty-error | scripts/coffee/test/ParsedError.coffee | MIT | fc8c237668e5fd4c5a30adf54285cc829047d7ea | 1,524 | https://github.com/AriaMinaei/pretty-error/blob/fc8c237668e5fd4c5a30adf54285cc829047d7ea/scripts/coffee/test/ParsedError.coffee | 55 | 104 | ||
AriaMinaei/pretty-error:scripts/coffee/test/ParsedError.coffee:2:completion | completion | e = new ParsedError 'some string'
).should.throw()
describe "message"
it "should return the original error message", ->
e = new ParsedError error 'a'
e.message.should.equal 'a'
describe "kind"
it "should return 'Error' for normal error", ->
e = new ParsedError error 'a'
e.kind.should.equal 'Error'
it "sh... | e.kind.should.equal 'ReferenceError'
describe "type"
it "should return original error type", ->
e = new ParsedError error -> a.b = c
expect(e.type).to.equal 'not_defined'
describe "arguments"
it "should return original error arguments", ->
e = new ParsedError error -> a.b = c
expect(e.arguments).to.be.like ... | CoffeeScript | CoffeeScript | AriaMinaei/pretty-error | scripts/coffee/test/ParsedError.coffee | MIT | fc8c237668e5fd4c5a30adf54285cc829047d7ea | 1,524 | https://github.com/AriaMinaei/pretty-error/blob/fc8c237668e5fd4c5a30adf54285cc829047d7ea/scripts/coffee/test/ParsedError.coffee | 55 | 104 |
AriaMinaei/pretty-error:scripts/coffee/test/ParsedError.coffee:3:raw_corpus | raw_corpus | describe "trace"
it "should include correct information about each trace item", ->
e = new ParsedError error -> a.b = c
e.trace.should.have.length.above 2
item = e.trace[0]
item.should.include.keys 'original',
'what', 'path', 'addr',
'file', 'dir', 'col',
'line', 'jsCol', 'jsLine'
'modName'
item.pat... | CoffeeScript | AriaMinaei/pretty-error | scripts/coffee/test/ParsedError.coffee | MIT | f4d5dd691ed4f9eaa59ca7589e007dd352406dcd | 1,524 | https://github.com/AriaMinaei/pretty-error/blob/f4d5dd691ed4f9eaa59ca7589e007dd352406dcd/scripts/coffee/test/ParsedError.coffee | 105 | 125 | ||
AriaMinaei/pretty-error:scripts/coffee/test/ParsedError.coffee:3:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
describe "trace"
it "should include correct information about each trace item", ->
e = new ParsedError error -> a.b = c
e.trace.should.have.length.above 2
item = e.trace[0]
item.should.include.keys 'original',
'what', 'path', 'addr',
'file', 'dir', ... | describe("trace");
it("should include correct information about each trace item", function() {
var e, item;
e = new ParsedError(error(function() {
return a.b = c;
}));
e.trace.should.have.length.above(2);
item = e.trace[0];
item.should.include.keys('original', 'what', 'path', 'addr', 'file', 'dir', 'co... | CoffeeScript | JavaScript | AriaMinaei/pretty-error | scripts/coffee/test/ParsedError.coffee | MIT | f4d5dd691ed4f9eaa59ca7589e007dd352406dcd | 1,524 | https://github.com/AriaMinaei/pretty-error/blob/f4d5dd691ed4f9eaa59ca7589e007dd352406dcd/scripts/coffee/test/ParsedError.coffee | 105 | 125 |
AriaMinaei/pretty-error:scripts/coffee/test/ParsedError.coffee:3:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
describe("trace");
it("should include correct information about each trace item", function() {
var e, item;
e = new ParsedError(error(function() {
return a.b = c;
}));
e.trace.should.have.length.above(2);
item = e.trace[0];
item.should.include.keys... | describe "trace"
it "should include correct information about each trace item", ->
e = new ParsedError error -> a.b = c
e.trace.should.have.length.above 2
item = e.trace[0]
item.should.include.keys 'original',
'what', 'path', 'addr',
'file', 'dir', 'col',
'line', 'jsCol', 'jsLine'
'modName'
item.pat... | JavaScript | CoffeeScript | AriaMinaei/pretty-error | scripts/coffee/test/ParsedError.coffee | MIT | f4d5dd691ed4f9eaa59ca7589e007dd352406dcd | 1,524 | https://github.com/AriaMinaei/pretty-error/blob/f4d5dd691ed4f9eaa59ca7589e007dd352406dcd/scripts/coffee/test/ParsedError.coffee | 105 | 125 |
AriaMinaei/pretty-error:scripts/coffee/test/ParsedError.coffee:3:completion | completion | describe "trace"
it "should include correct information about each trace item", ->
e = new ParsedError error -> a.b = c
e.trace.should.have.length.above 2
item = e.trace[0] | item.should.include.keys 'original',
'what', 'path', 'addr',
'file', 'dir', 'col',
'line', 'jsCol', 'jsLine'
'modName'
item.path.should.equal module.filename
item.line.should.be.a 'number'
item.col.should.be.a 'number' | CoffeeScript | CoffeeScript | AriaMinaei/pretty-error | scripts/coffee/test/ParsedError.coffee | MIT | f4d5dd691ed4f9eaa59ca7589e007dd352406dcd | 1,524 | https://github.com/AriaMinaei/pretty-error/blob/f4d5dd691ed4f9eaa59ca7589e007dd352406dcd/scripts/coffee/test/ParsedError.coffee | 105 | 125 |
xhan/qqbot:plugins/version.coffee:1:raw_corpus | raw_corpus | VERSION_INFO = """
v1.0.0 qqbot
http://github.com/xhan/qqbot
"""
module.exports = (robot,message)->
if message.content.trim().match /^VERSION/i
robot.reply_message(message, VERSION_INFO)
return
if message.content.trim().match /^杰杰/
robot.reply_message(message, "你说的是传说中的杰杰大美女吗,没... | CoffeeScript | xhan/qqbot | plugins/version.coffee | MIT | f8011e7be6923cfadd117a54e6cb18126ae4aa13 | 1,435 | https://github.com/xhan/qqbot/blob/f8011e7be6923cfadd117a54e6cb18126ae4aa13/plugins/version.coffee | 1 | 12 | ||
xhan/qqbot:plugins/version.coffee:1:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
VERSION_INFO = """
v1.0.0 qqbot
http://github.com/xhan/qqbot
"""
module.exports = (robot,message)->
if message.content.trim().match /^VERSION/i
robot.reply_message(message, VERSION_INFO)
return
if message.content.trim().match /^杰... | var VERSION_INFO;
VERSION_INFO = `v1.0.0 qqbot
http://github.com/xhan/qqbot`;
module.exports = function(robot, message) {
if (message.content.trim().match(/^VERSION/i)) {
robot.reply_message(message, VERSION_INFO);
return;
}
if (message.content.trim().match(/^杰杰/)) {
return robot.reply_message(messa... | CoffeeScript | JavaScript | xhan/qqbot | plugins/version.coffee | MIT | f8011e7be6923cfadd117a54e6cb18126ae4aa13 | 1,435 | https://github.com/xhan/qqbot/blob/f8011e7be6923cfadd117a54e6cb18126ae4aa13/plugins/version.coffee | 1 | 12 |
xhan/qqbot:plugins/version.coffee:1:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
var VERSION_INFO;
VERSION_INFO = `v1.0.0 qqbot
http://github.com/xhan/qqbot`;
module.exports = function(robot, message) {
if (message.content.trim().match(/^VERSION/i)) {
robot.reply_message(message, VERSION_INFO);
return;
}
if (message.content.trim... | VERSION_INFO = """
v1.0.0 qqbot
http://github.com/xhan/qqbot
"""
module.exports = (robot,message)->
if message.content.trim().match /^VERSION/i
robot.reply_message(message, VERSION_INFO)
return
if message.content.trim().match /^杰杰/
robot.reply_message(message, "你说的是传说中的杰杰大美女吗,没... | JavaScript | CoffeeScript | xhan/qqbot | plugins/version.coffee | MIT | f8011e7be6923cfadd117a54e6cb18126ae4aa13 | 1,435 | https://github.com/xhan/qqbot/blob/f8011e7be6923cfadd117a54e6cb18126ae4aa13/plugins/version.coffee | 1 | 12 |
xhan/qqbot:plugins/version.coffee:1:completion | completion | VERSION_INFO = """
v1.0.0 qqbot
http://github.com/xhan/qqbot
"""
module.exports = (robot,message)-> | if message.content.trim().match /^VERSION/i
robot.reply_message(message, VERSION_INFO)
return
if message.content.trim().match /^杰杰/
robot.reply_message(message, "你说的是传说中的杰杰大美女吗,没错她和你想的一样!") | CoffeeScript | CoffeeScript | xhan/qqbot | plugins/version.coffee | MIT | f8011e7be6923cfadd117a54e6cb18126ae4aa13 | 1,435 | https://github.com/xhan/qqbot/blob/f8011e7be6923cfadd117a54e6cb18126ae4aa13/plugins/version.coffee | 1 | 12 |
dropbox/zxcvbn:src/main.coffee:1:raw_corpus | raw_corpus | matching = require './matching'
scoring = require './scoring'
time_estimates = require './time_estimates'
feedback = require './feedback'
time = -> (new Date()).getTime()
zxcvbn = (password, user_inputs = []) ->
start = time()
# reset the user inputs matcher on a per-request basis to keep things stateless
sanit... | CoffeeScript | dropbox/zxcvbn | src/main.coffee | MIT | 67c4ece9efc40c9d0a1d7d995b2b22a91be500c2 | 15,961 | https://github.com/dropbox/zxcvbn/blob/67c4ece9efc40c9d0a1d7d995b2b22a91be500c2/src/main.coffee | 1 | 25 | ||
dropbox/zxcvbn:src/main.coffee:1:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
matching = require './matching'
scoring = require './scoring'
time_estimates = require './time_estimates'
feedback = require './feedback'
time = -> (new Date()).getTime()
zxcvbn = (password, user_inputs = []) ->
start = time()
# reset the user inputs matche... | var feedback, matching, scoring, time, time_estimates, zxcvbn;
matching = require('./matching');
scoring = require('./scoring');
time_estimates = require('./time_estimates');
feedback = require('./feedback');
time = function() {
return (new Date()).getTime();
};
zxcvbn = function(password, user_inputs = []) {
... | CoffeeScript | JavaScript | dropbox/zxcvbn | src/main.coffee | MIT | 67c4ece9efc40c9d0a1d7d995b2b22a91be500c2 | 15,961 | https://github.com/dropbox/zxcvbn/blob/67c4ece9efc40c9d0a1d7d995b2b22a91be500c2/src/main.coffee | 1 | 25 |
dropbox/zxcvbn:src/main.coffee:1:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
var feedback, matching, scoring, time, time_estimates, zxcvbn;
matching = require('./matching');
scoring = require('./scoring');
time_estimates = require('./time_estimates');
feedback = require('./feedback');
time = function() {
return (new Date()).getTime()... | matching = require './matching'
scoring = require './scoring'
time_estimates = require './time_estimates'
feedback = require './feedback'
time = -> (new Date()).getTime()
zxcvbn = (password, user_inputs = []) ->
start = time()
# reset the user inputs matcher on a per-request basis to keep things stateless
sanit... | JavaScript | CoffeeScript | dropbox/zxcvbn | src/main.coffee | MIT | 67c4ece9efc40c9d0a1d7d995b2b22a91be500c2 | 15,961 | https://github.com/dropbox/zxcvbn/blob/67c4ece9efc40c9d0a1d7d995b2b22a91be500c2/src/main.coffee | 1 | 25 |
dropbox/zxcvbn:src/main.coffee:1:completion | completion | matching = require './matching'
scoring = require './scoring'
time_estimates = require './time_estimates'
feedback = require './feedback'
time = -> (new Date()).getTime()
zxcvbn = (password, user_inputs = []) ->
start = time()
# reset the user inputs matcher on a per-request basis to keep things stateless
sanit... | if typeof arg in ["string", "number", "boolean"]
sanitized_inputs.push arg.toString().toLowerCase()
matching.set_user_input_dictionary sanitized_inputs
matches = matching.omnimatch password
result = scoring.most_guessable_match_sequence password, matches
result.calc_time = time() - start
attack_times = ... | CoffeeScript | CoffeeScript | dropbox/zxcvbn | src/main.coffee | MIT | 67c4ece9efc40c9d0a1d7d995b2b22a91be500c2 | 15,961 | https://github.com/dropbox/zxcvbn/blob/67c4ece9efc40c9d0a1d7d995b2b22a91be500c2/src/main.coffee | 1 | 25 |
dropbox/zxcvbn:src/main.coffee:1:raw_corpus | raw_corpus | matching = require('./matching')
scoring = require('./scoring')
time_estimates = require('./time_estimates')
time = -> (new Date()).getTime()
zxcvbn = (password, user_inputs = []) ->
start = time()
# reset the user inputs matcher on a per-request basis to keep things stateless
sanitized_inputs = []
for arg in... | CoffeeScript | dropbox/zxcvbn | src/main.coffee | MIT | ef101b646f197b8353ed89780af84b724116d91c | 15,961 | https://github.com/dropbox/zxcvbn/blob/ef101b646f197b8353ed89780af84b724116d91c/src/main.coffee | 1 | 23 | ||
dropbox/zxcvbn:src/main.coffee:1:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
matching = require('./matching')
scoring = require('./scoring')
time_estimates = require('./time_estimates')
time = -> (new Date()).getTime()
zxcvbn = (password, user_inputs = []) ->
start = time()
# reset the user inputs matcher on a per-request basis to k... | var matching, scoring, time, time_estimates, zxcvbn;
matching = require('./matching');
scoring = require('./scoring');
time_estimates = require('./time_estimates');
time = function() {
return (new Date()).getTime();
};
zxcvbn = function(password, user_inputs = []) {
var arg, attack_times, i, len, matches, prop... | CoffeeScript | JavaScript | dropbox/zxcvbn | src/main.coffee | MIT | ef101b646f197b8353ed89780af84b724116d91c | 15,961 | https://github.com/dropbox/zxcvbn/blob/ef101b646f197b8353ed89780af84b724116d91c/src/main.coffee | 1 | 23 |
dropbox/zxcvbn:src/main.coffee:1:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
var matching, scoring, time, time_estimates, zxcvbn;
matching = require('./matching');
scoring = require('./scoring');
time_estimates = require('./time_estimates');
time = function() {
return (new Date()).getTime();
};
zxcvbn = function(password, user_inputs... | matching = require('./matching')
scoring = require('./scoring')
time_estimates = require('./time_estimates')
time = -> (new Date()).getTime()
zxcvbn = (password, user_inputs = []) ->
start = time()
# reset the user inputs matcher on a per-request basis to keep things stateless
sanitized_inputs = []
for arg in... | JavaScript | CoffeeScript | dropbox/zxcvbn | src/main.coffee | MIT | ef101b646f197b8353ed89780af84b724116d91c | 15,961 | https://github.com/dropbox/zxcvbn/blob/ef101b646f197b8353ed89780af84b724116d91c/src/main.coffee | 1 | 23 |
dropbox/zxcvbn:src/main.coffee:1:completion | completion | matching = require('./matching')
scoring = require('./scoring')
time_estimates = require('./time_estimates')
time = -> (new Date()).getTime()
zxcvbn = (password, user_inputs = []) ->
start = time()
# reset the user inputs matcher on a per-request basis to keep things stateless
sanitized_inputs = []
for arg in... | if typeof arg in ["string", "number", "boolean"]
sanitized_inputs.push arg.toString().toLowerCase()
matching.set_user_input_dictionary sanitized_inputs
matches = matching.omnimatch password
result = scoring.most_guessable_match_sequence password, matches
result.calc_time = time() - start
attack_times = ... | CoffeeScript | CoffeeScript | dropbox/zxcvbn | src/main.coffee | MIT | ef101b646f197b8353ed89780af84b724116d91c | 15,961 | https://github.com/dropbox/zxcvbn/blob/ef101b646f197b8353ed89780af84b724116d91c/src/main.coffee | 1 | 23 |
dropbox/zxcvbn:src/main.coffee:1:raw_corpus | raw_corpus | matching = require('./matching')
scoring = require('./scoring')
time = -> (new Date()).getTime()
zxcvbn = (password, user_inputs = []) ->
start = time()
# reset the user inputs matcher on a per-request basis to keep things stateless
sanitized_inputs = []
for arg in user_inputs
if typeof arg in ["string", ... | CoffeeScript | dropbox/zxcvbn | src/main.coffee | MIT | a1be663b7533f990d094ae9a4f76ae51491ee0f4 | 15,961 | https://github.com/dropbox/zxcvbn/blob/a1be663b7533f990d094ae9a4f76ae51491ee0f4/src/main.coffee | 1 | 19 | ||
dropbox/zxcvbn:src/main.coffee:1:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
matching = require('./matching')
scoring = require('./scoring')
time = -> (new Date()).getTime()
zxcvbn = (password, user_inputs = []) ->
start = time()
# reset the user inputs matcher on a per-request basis to keep things stateless
sanitized_inputs = []
... | var matching, scoring, time, zxcvbn;
matching = require('./matching');
scoring = require('./scoring');
time = function() {
return (new Date()).getTime();
};
zxcvbn = function(password, user_inputs = []) {
var arg, i, len, matches, ref, result, sanitized_inputs, start;
start = time();
// reset the user input... | CoffeeScript | JavaScript | dropbox/zxcvbn | src/main.coffee | MIT | a1be663b7533f990d094ae9a4f76ae51491ee0f4 | 15,961 | https://github.com/dropbox/zxcvbn/blob/a1be663b7533f990d094ae9a4f76ae51491ee0f4/src/main.coffee | 1 | 19 |
dropbox/zxcvbn:src/main.coffee:1:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
var matching, scoring, time, zxcvbn;
matching = require('./matching');
scoring = require('./scoring');
time = function() {
return (new Date()).getTime();
};
zxcvbn = function(password, user_inputs = []) {
var arg, i, len, matches, ref, result, sanitized_inp... | matching = require('./matching')
scoring = require('./scoring')
time = -> (new Date()).getTime()
zxcvbn = (password, user_inputs = []) ->
start = time()
# reset the user inputs matcher on a per-request basis to keep things stateless
sanitized_inputs = []
for arg in user_inputs
if typeof arg in ["string", ... | JavaScript | CoffeeScript | dropbox/zxcvbn | src/main.coffee | MIT | a1be663b7533f990d094ae9a4f76ae51491ee0f4 | 15,961 | https://github.com/dropbox/zxcvbn/blob/a1be663b7533f990d094ae9a4f76ae51491ee0f4/src/main.coffee | 1 | 19 |
dropbox/zxcvbn:src/main.coffee:1:completion | completion | matching = require('./matching')
scoring = require('./scoring')
time = -> (new Date()).getTime()
zxcvbn = (password, user_inputs = []) ->
start = time()
# reset the user inputs matcher on a per-request basis to keep things stateless
sanitized_inputs = [] | for arg in user_inputs
if typeof arg in ["string", "number", "boolean"]
sanitized_inputs.push arg.toString().toLowerCase()
matching.set_user_input_dictionary sanitized_inputs
matches = matching.omnimatch password
result = scoring.most_guessable_match_sequence password, matches
result.calc_time = time(... | CoffeeScript | CoffeeScript | dropbox/zxcvbn | src/main.coffee | MIT | a1be663b7533f990d094ae9a4f76ae51491ee0f4 | 15,961 | https://github.com/dropbox/zxcvbn/blob/a1be663b7533f990d094ae9a4f76ae51491ee0f4/src/main.coffee | 1 | 19 |
dropbox/zxcvbn:src/main.coffee:1:raw_corpus | raw_corpus | matching = require('./matching')
scoring = require('./scoring')
time = -> (new Date()).getTime()
zxcvbn = (password, user_inputs = []) ->
start = time()
# reset the user inputs matcher on a per-request basis to keep things stateless
sanitized_inputs = []
for arg in user_inputs
if typeof arg in ["string", ... | CoffeeScript | dropbox/zxcvbn | src/main.coffee | MIT | a7299e2fd43c0276885152aac61691db7d9875fc | 15,961 | https://github.com/dropbox/zxcvbn/blob/a7299e2fd43c0276885152aac61691db7d9875fc/src/main.coffee | 1 | 19 | ||
dropbox/zxcvbn:src/main.coffee:1:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
matching = require('./matching')
scoring = require('./scoring')
time = -> (new Date()).getTime()
zxcvbn = (password, user_inputs = []) ->
start = time()
# reset the user inputs matcher on a per-request basis to keep things stateless
sanitized_inputs = []
... | var matching, scoring, time, zxcvbn;
matching = require('./matching');
scoring = require('./scoring');
time = function() {
return (new Date()).getTime();
};
zxcvbn = function(password, user_inputs = []) {
var arg, i, len, matches, ref, result, sanitized_inputs, start;
start = time();
// reset the user input... | CoffeeScript | JavaScript | dropbox/zxcvbn | src/main.coffee | MIT | a7299e2fd43c0276885152aac61691db7d9875fc | 15,961 | https://github.com/dropbox/zxcvbn/blob/a7299e2fd43c0276885152aac61691db7d9875fc/src/main.coffee | 1 | 19 |
dropbox/zxcvbn:src/main.coffee:1:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
var matching, scoring, time, zxcvbn;
matching = require('./matching');
scoring = require('./scoring');
time = function() {
return (new Date()).getTime();
};
zxcvbn = function(password, user_inputs = []) {
var arg, i, len, matches, ref, result, sanitized_inp... | matching = require('./matching')
scoring = require('./scoring')
time = -> (new Date()).getTime()
zxcvbn = (password, user_inputs = []) ->
start = time()
# reset the user inputs matcher on a per-request basis to keep things stateless
sanitized_inputs = []
for arg in user_inputs
if typeof arg in ["string", ... | JavaScript | CoffeeScript | dropbox/zxcvbn | src/main.coffee | MIT | a7299e2fd43c0276885152aac61691db7d9875fc | 15,961 | https://github.com/dropbox/zxcvbn/blob/a7299e2fd43c0276885152aac61691db7d9875fc/src/main.coffee | 1 | 19 |
dropbox/zxcvbn:src/main.coffee:1:completion | completion | matching = require('./matching')
scoring = require('./scoring')
time = -> (new Date()).getTime()
zxcvbn = (password, user_inputs = []) ->
start = time()
# reset the user inputs matcher on a per-request basis to keep things stateless
sanitized_inputs = [] | for arg in user_inputs
if typeof arg in ["string", "number", "boolean"]
sanitized_inputs.push arg.toString().toLowerCase()
matching.set_user_input_dictionary sanitized_inputs
matches = matching.omnimatch password
result = scoring.minimum_entropy_match_sequence password, matches
result.calc_time = time... | CoffeeScript | CoffeeScript | dropbox/zxcvbn | src/main.coffee | MIT | a7299e2fd43c0276885152aac61691db7d9875fc | 15,961 | https://github.com/dropbox/zxcvbn/blob/a7299e2fd43c0276885152aac61691db7d9875fc/src/main.coffee | 1 | 19 |
flosse/sloc:src/sloc.coffee:1:raw_corpus | raw_corpus | getCommentExpressions = (lang) ->
# single line comments
single =
switch lang
when "coffee", "py", "ls", "rb"
/\#/
when "js", "c", "cc", "cpp", "h", "hpp", "hx", "ino", "java", \
"php", "php5", "go", "scss", "less", "styl", "scala"
/\/{2}/
when "lua"
/--/
... | CoffeeScript | flosse/sloc | src/sloc.coffee | MIT | 0ca201cfa0f4b5b511ad8510b0fcc982aa9862e0 | 969 | https://github.com/flosse/sloc/blob/0ca201cfa0f4b5b511ad8510b0fcc982aa9862e0/src/sloc.coffee | 21 | 70 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.