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 randomWord = (len = 16, up = true, low = true, digits = true, special = '') => { | |
| const chars = [special]; | |
| up && chars.push('ABCDEFGHIJKLMNOPQRSTUVWXYZ'); | |
| low && chars.push('abcdefghijklmnopqrstuvwxyz'); | |
| digits && chars.push('0123456789'); | |
| const str = chars.join``; | |
| const word = []; | |
| for (let i = 0; i < len; ++i) { | |
| word[i] = str[Math.round(Math.random() * str.length) % str.length]; |
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
| // Smallest Common Multiple | |
| // Least common multiple | |
| // Greatest common divisor | |
| function gcd(a, b) { | |
| if (a < 0) a = -a; | |
| if (b < 0) b = -b; | |
| if (b > a) { | |
| [a, b] = [b, a]; | |
| } |
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 actions = [ | |
| () => document.querySelector('button[name=delete]').click(), | |
| () => document.querySelector('button.delete-address').click(), | |
| () => document.querySelector('button.back').click() | |
| ]; | |
| let i = 0; | |
| setInterval(() => actions[(i++)%actions.length](), 1e3); |
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; |