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
| $ awk '{print $1}' ~/.bash_history_all | sort | uniq -c | sort -nr | head -n20 | |
| 10663 git | |
| 3306 rake | |
| 1804 middleman | |
| 1668 vim | |
| 1664 cd | |
| 1441 ls | |
| 943 cat | |
| 672 ruby | |
| 594 grep |
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
| " Cycle tabbing options | |
| map <leader><tab> :call CycleTabs()<CR> | |
| fun! CycleTabs() | |
| if !&expandtab | |
| echo "4 space tabs" | |
| set shiftwidth=4 | |
| set softtabstop=4 | |
| set tabstop=4 | |
| set expandtab | |
| elseif &expandtab && &shiftwidth == 4 |
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
| sudo rm -rf /dev/null |
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
| declare -a ip_address | |
| for i in {3..1}; do | |
| # bash fails when using ${var: -n} to trim strings if the number is greater | |
| # than the number of characters. So this uses ${#var} to test the length | |
| # huehuehue | |
| last_3=${store_id: ${#store_id}<3?0:-3} | |
| if [ $last_3 -gt 255 ]; then | |
| last_3=${last_3: -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
| 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 |
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
| [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
| #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
| 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
| 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)); |