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
| [alias] | |
| st = status -sb | |
| me = log --author=Nick | |
| lg = log --pretty=format:'%C(yellow)%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(cyan)<%an>%Creset' --abbrev-commit --date=relative --graph | |
| lgd = log --pretty=format:'%C(yellow)%h%C(reset) - %C(green)%cd %C(reset)%s %C(cyan)<%an>%C(yellow)%d%C(reset)' --abbrev-commit --graph --date=format:'%Y-%m-%d %a %H:%M' | |
| aliases = !git config --get-regexp 'alias.*' | colrm 1 6 | sed 's/[ ]/ = /' | sort |
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
| while read FILE LINE COL; do git blame -L $LINE,$LINE $FILE | sed -re 's/.*\(([^0-9]*) [0-9].*/\1/'; done < <(npx tsc --noEmit | grep -Po '[^: ]+\([0-9]+,[0-9]+\)' | sed -re 's/\(([0-9]+),([0-9]+)\)/ \1 \2/g') | sort | uniq -c | sort -nr |
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
| // cleaner output, but same results without | |
| const Promise = require('bluebird'); | |
| // What is the best way to run async functions | |
| // * in parallel | |
| // * fail fast | |
| // * not have unhandled promises | |
| // * single failure path (try/catch) | |
| // ? |
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
| function sleepReject(time, msg) { | |
| return new Promise((resolve, reject) => { | |
| setTimeout(() => reject(msg || 'reject'), time); | |
| }); | |
| } | |
| async function test() { | |
| try { | |
| let valuePromises1 = [1000, 2000, 3000].map(x => sleepReject(x)); | |
| let valuePromises2 = [4000, 5000].map(x => sleepReject(x)); |
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
| function sleepReject(time, msg) { | |
| return new Promise((resolve, reject) => { | |
| setTimeout(() => reject(msg || 'reject'), time); | |
| }); | |
| } | |
| async function test() { | |
| try { | |
| let valuePromises1 = [1000, 2000, 3000].map(x => sleepReject(x)); |
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
| async function test() { | |
| var p1 = new Promise((resolve, reject) => { | |
| setTimeout(() => reject('one'), 1000); | |
| }); | |
| var p2 = new Promise((resolve, reject) => { | |
| setTimeout(() => reject('two'), 2000); | |
| }); | |
| var p3 = new Promise((resolve, reject) => { | |
| setTimeout(() => reject('three'), 3000); | |
| }); |
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
| #include "FastLED.h" | |
| // DiscoStrobe | |
| // *Flashing* rainbow lights that zoom back and forth to a beat. | |
| // See your doctor before using this code if you have certain neurological conditions. | |
| // | |
| // Mark Kriegsman, July 2015 | |
| #if FASTLED_VERSION < 3001000 |
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
| [4800x0C:07:19nick@nijotz~/.weechat/logs]$ grep -B1 LOLBOW irc.freenode.#infoforcefeed.weechatlog | grep -Ev '(LOLBOW|--)' | awk '{print $3}' | sort | uniq -c | sort -nr | |
| 24 cblgh | |
| 17 nijotz | |
| 17 jnerula | |
| 14 Pilate | |
| 12 trinque | |
| 11 vhost- | |
| 11 uptime | |
| 11 ben_vulpes | |
| 9 lykkin |
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
| import tensorflow as tf | |
| from tensorflow.examples.tutorials.mnist import input_data | |
| mnist = input_data.read_data_sets("MNIST_data/", one_hot=True) | |
| def weight_variable(shape): | |
| initial = tf.truncated_normal(shape, stddev=0.1) | |
| return tf.Variable(initial) | |
| def bias_variable(shape): |
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
| import tensorflow as tf | |
| from tensorflow.examples.tutorials.mnist import input_data | |
| mnist = input_data.read_data_sets("MNIST_data/", one_hot=True) | |
| # 784 pixels (28 x 28 pixel images), 10 possibile outputs | |
| x = tf.placeholder(tf.float32, [None, 784]) # placeholder | |
| W = tf.Variable(tf.zeros([784, 10])) # weights | |
| b = tf.Variable(tf.zeros([10])) # biases |
NewerOlder