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
| # https://downloads.pwnedpasswords.com/passwords/pwned-passwords-1.0.txt.7z | |
| # https://downloads.pwnedpasswords.com/passwords/pwned-passwords-update-1.txt.7z | |
| import hashlib | |
| def _hash(password): | |
| p = password.encode('utf-8') | |
| m = hashlib.sha1() | |
| m.update(p) | |
| return m.hexdigest().upper() |
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 fs = require('fs'); | |
| const dataFileBuffer = fs.readFileSync('./train-images-idx3-ubyte'); | |
| const labelFileBuffer = fs.readFileSync('./train-labels-idx1-ubyte'); | |
| const pixelValues = []; | |
| for (let image = 0; image <= 59999; image++) { | |
| const pixels = []; | |
| for (let x = 0; x <= 27; x++) { | |
| for (let y = 0; y <= 27; y++) { |
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 dropwhile = (predicate, list) => { | |
| return list.reduce((acc, item) => { | |
| if (acc.drop) { | |
| const drop = predicate(item); | |
| const list = drop ? acc.list : [...acc.list, item]; | |
| return { drop, list }; | |
| } | |
| return {drop: false, list: [...acc.list, item]} | |
| }, {drop: true, list: []}).list; | |
| }; |
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 compose = (...funcs) => { | |
| const noop = (arg) => arg; | |
| return funcs.reduceRight((acc, func) => { | |
| return (arg) => func(acc(arg)); | |
| }, noop); | |
| }; |
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
| export NVM_DIR="/Users/darkruby/.nvm" | |
| [ -s "$NVM_DIR/nvm.sh" ] && . "$NVM_DIR/nvm.sh" # This loads nvm | |
| if [ -f "$(brew --prefix bash-git-prompt)/share/gitprompt.sh" ]; then | |
| GIT_PROMPT_THEME=Default | |
| source "$(brew --prefix bash-git-prompt)/share/gitprompt.sh" | |
| fi | |
| if [ -f $(brew --prefix)/etc/bash_completion ]; then | |
| . $(brew --prefix)/etc/bash_completion |
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 array = [1, 7, 5, 9, 0, 4, 12, -56, 7, 0, -45, 8, 2, 3, 6, 7, 8, 1, 5, 0, 1, 7, 5, 9, 0, 4, 12, -56, 7, 0, -45, 8, 2, 3, 6, 7, 8, 1, 5, 0, 1, 7, 5, 9, 0, 4, 12, -56, 7, 0, -45, 8, 2, 3, 6, 7, 8, 1, 5, 0, 1, 7, 5, 9, 0, 4, 12, -56, 7, 0, -45, 8, 2, 3, 6, 7, 8, 1, 5, 0, 1, 7, 5, 9, 0, 4, 12, -56, 7, 0, -45, 8, 2, 3, 6, 7, 8, 1, 5, 0, 1, 7, 5, 9, 0, 4, 12, -56, 7, 0, -45, 8, 2, 3, 6, 7, 8, 1, 5, 0, 1, 7, 5, 9, 0, 4, 12, -56, 7, 0, -45, 8, 2, 3, 6, 7, 8, 1, 5, 0]; | |
| var getRandomInt = function (min, max) { | |
| return Math.floor(Math.random() * (max - min)) + min; | |
| }; | |
| var quick_sort = function (unsorted) { | |
| if (unsorted.length === 0 || unsorted.length === 1) { | |
| return unsorted; | |
| } |
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 array = [1, 7, 5, 9, 0, 4, 12, -56, 7, 0, -45, 8, 2, 3, 6, 7, 8, 1, 5, 0,1, 7, 5, 9, 0, 4, 12, -56, 7, 0, -45, 8, 2, 3, 6, 7, 8, 1, 5, 0,1, 7, 5, 9, 0, 4, 12, -56, 7, 0, -45, 8, 2, 3, 6, 7, 8, 1, 5, 0,1, 7, 5, 9, 0, 4, 12, -56, 7, 0, -45, 8, 2, 3, 6, 7, 8, 1, 5, 0,1, 7, 5, 9, 0, 4, 12, -56, 7, 0, -45, 8, 2, 3, 6, 7, 8, 1, 5, 0,1, 7, 5, 9, 0, 4, 12, -56, 7, 0, -45, 8, 2, 3, 6, 7, 8, 1, 5, 0,1, 7, 5, 9, 0, 4, 12, -56, 7, 0, -45, 8, 2, 3, 6, 7, 8, 1, 5, 0]; | |
| var merge = function(left, right) { | |
| var ret = []; | |
| var length = left.length>right.length? left.length : right.length; | |
| while(!!left.length || !!right.length) { | |
| var l = left[0]; | |
| var r = right[0]; | |
| if (l === undefined || l > r) { ret.push(right.shift()); continue;} | |
| if (r === undefined || r >= l) { ret.push(left.shift()); continue;} | |
| } |
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 array = [1,7,5,9,0,4,12,56,7,0,45,8,2,3,6,7,8,1,5,0]; | |
| Array.prototype.move = function (old_index, new_index) { | |
| if (new_index >= this.length) { | |
| var k = new_index - this.length; | |
| while ((k--) + 1) { | |
| this.push(undefined); | |
| } | |
| } | |
| this.splice(new_index, 0, this.splice(old_index, 1)[0]); | |
| return this; // for testing purposes |
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
| PS1='\[\033[01;32m\]art\[\033[01;34m\] \w\[\033[31m\]$(__git_ps1 "(%s)") \[\033[01;34m\]$\[\033[00m\] ' |
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 required = function(name) { | |
| name = name.toString(); | |
| return new Promise(function(resolve, reject) { | |
| require([name], function(module) { | |
| resolve(module); | |
| }, | |
| function(err){ | |
| reject(err); | |
| }); | |
| }); |