This file contains 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
# fromhex A52A2A | |
# fromhex "#A52A2A" | |
# BLUE_VIOLET=$(fromhex "#8A2BE2") | |
# http://unix.stackexchange.com/a/269085/67282 | |
function fromhex() { | |
hex=$1 | |
if [[ $hex == "#"* ]]; then | |
hex=$(echo $1 | awk '{print substr($0,2)}') | |
fi | |
r=$(printf '0x%0.2s' "$hex") |
This file contains 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
def processor1(obj): | |
"""Require: text; yield firstchar""" | |
obj['firstchar'] = obj.text[:1] | |
return obj | |
def processor2(obj): | |
"""Require: firstchar, text2; yield concat""" | |
obj['concat'] = obj.firstchar + obj.text2 | |
return obj |
This file contains 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
# bash commands | |
# lists all of your conda env | |
conda env list | |
# Create a conda env w/ python3.5 | |
# -n sets the name for your new env. I call it neovim here | |
conda create -n neovim python=3.5 | |
# add neovim for python3 to the env | |
# specify version you want here, 0.1.13 up to date ver atm |
This file contains 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
rm -rf ~/.zprezto ~/.zlogin ~/.zlogout ~/.zpreztorc ~/.zprofile ~/.zshenv ~/.zshrc |
If you use atom... download & install the following packages:
based on https://www.reddit.com/r/vim/comments/24g8r8/italics_in_terminal_vim_and_tmux/
- Check if italic font is supported:
$ echo -e "\e[3mitalic\e[23m"
- Also check:
$ infocmp $TERM | grep sitm
sgr0=\E(B\E[m, sitm=\E[3m, smacs=\E(0, smam=\E[?7h,
This file contains 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
// knockout 2.2.1 | |
ko.utils.arrayFilter = function (array, predicate) { /* .. */ } | |
ko.utils.arrayFirst = function (array, predicate, predicateOwner) { /* .. */ } | |
ko.utils.arrayForEach = function (array, action) { /* .. */ } | |
ko.utils.arrayGetDistinctValues = function (array) { /* .. */ } |
This file contains 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
Latency Comparison Numbers | |
-------------------------- | |
L1 cache reference 0.5 ns | |
Branch mispredict 5 ns | |
L2 cache reference 7 ns 14x L1 cache | |
Mutex lock/unlock 25 ns | |
Main memory reference 100 ns 20x L2 cache, 200x L1 cache | |
Compress 1K bytes with Zippy 3,000 ns 3 us | |
Send 1K bytes over 1 Gbps network 10,000 ns 10 us | |
Read 4K randomly from SSD* 150,000 ns 150 us ~1GB/sec SSD |
NewerOlder