This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
,[ | |
>1 --[-->+<] >2 ----- <1 set 122 to 2 <0 | |
>>2 [-<<->>] sub 122 from char <<0 | |
>1 ++++++++++ ++++++++++ ++++++ set 26 cnt <0 | |
>1 [- | |
<0 [->>+>+<<<] dup char 2&3 >1 | |
>>3 [-<<<+>>>] recov char to 0 <<1 | |
1 [->>+>+<<<] dup cnt 3&4 | |
>>>4 [-<<<+>>>] recov cnt <<<1 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// get dec input from 0 to 255 and store it in second cell | |
++++++++++ ++++++++++ ++++++++++ ++++++++++ ++++++++ 48 0 dec | |
[ | |
mul by 10: | |
>1 [-> +++++ +++++ <] >2 [-<+>] <<1 | |
---------- ---------- ---------- ---------- -------- 48 | |
[->+<] add to sum | |
, | |
] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let f = [1, 1]; | |
let sum = 0; | |
while(f[0] < 4e6){ | |
f.push(f[0]+f[1]); | |
let e = f.shift(); | |
sum += e % 2 === 0 ? e : 0; | |
} | |
console.log(sum); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let BitArray = function(size) { | |
let arr = new Uint16Array(size >> 4); | |
let o = new Uint16Array(16); | |
let z = new Uint16Array(16); | |
for (let i = 0; i < 16; ++i) { | |
o[i] = 1 << i; | |
z[i] = o[i] ^ ((1<<16)-1); | |
} | |
return { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var canvas = document.getElementsByTagName("canvas")[0]; | |
var img = canvas.toDataURL("image/png"); | |
document.write('<img src="'+img+'"/>'); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
http://jsfiddle.net/d59h8jpj/112/ | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
pragma solidity ^0.4.8; | |
// kovan: 0x9af4ad4bad67f640a1416ef448640f906209ba0e | |
contract Token { | |
string public name; | |
uint8 public decimals; | |
string public symbol; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const walletBalanceChanged = balance => { | |
const GAS_PRICE = 1e10; | |
const TX_GAS = 40e3; | |
const TX_PRICE = GAS_PRICE * TX_GAS; | |
let txsNum = balance / TX_PRICE; | |
const txsLvls = [2, 10, 20]; | |
if (txsNum <= 2) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// (as: Array[Array[A]]) => Array[A] | |
function flatten (as) { | |
return as.reduce((a, b) => a.concat(b), []) | |
} | |
// (as: Array[A], a: A) => Array[A] | |
function without (as, a) { | |
const bs = as.slice(0) | |
bs.splice(as.indexOf(a), 1) | |
return bs |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
d=new Date | |
d.setMonth(8) | |
d.setDate(1) | |
d.setHours(0) | |
d.setMinutes(0) | |
d.setSeconds(0) | |
console.log(d, (+d*1e-3).toFixed()) |