def build():
nodes = {}
node['a'] = Node(...)
node['b'] = Node(...)
...
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
# Transcript of chat with tmobile metro support. | |
# Made some newline changes to group related threads and added `***` in places to preserve identities but otherwise unedited | |
Metro: Hi! How can we help you today? | |
Metro: Welcome to METRO by T-MOBILE, You are chatting with **** ID number ****. how can i help you? | |
You: i can't download pdf from the metro website | |
Metro: HI Kevin , oh my that is really kind of a hassle. Have you tried using a different browser to download it? | |
You: yes | |
You: chrome and firefox |
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
# log all history in bash with ctx | |
# format: {time} {cwd} {cmd} | |
# eg: 2018-02-03T23:12:22 /Users/kevinlin/Dropbox/code python | |
export PROMPT_COMMAND='if [ "$(id -u)" -ne 0 ]; then echo "$(date "+%Y-%m-%d.%H:%M:%S") $(pwd) $(history 1)" >> ~/.logs/bash-history-$(date "+%Y-%m-%d").log; fi' | |
# log all history in zsh with ctx | |
# format: {time} {cwd} {cmd} | |
# eg: 2018-02-03T23:12:22 /Users/kevinlin/Dropbox/code python | |
precmd() { | |
if [ "$(id -u)" -ne 0 ]; then echo $(date "+%Y-%m-%dT%H:%M:%S") $(pwd) $(fc -l -1 | awk '{for(i=2;i<=NF;++i)printf("%s ", $i)}') >> ~/.logs/zsh-history-$(date "+%Y-%m-%d").log; fi |
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
def lambda_handler(event, context): | |
""" | |
Main event handler, calls thumbor with received event. | |
""" | |
try: | |
start_time = timeit.default_timer() | |
global log_level | |
log_level = str(os.environ.get('LOG_LEVEL')).upper() | |
if log_level not in [ | |
'DEBUG', 'INFO', |
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
" --- Plugins {{{1 | |
call plug#begin('~/.local/share/nvim/plugged') | |
" --- Essential {{{2 | |
Plug 'scrooloose/nerdtree', { 'on': 'NERDTreeToggle' } | |
Plug 'plasticboy/vim-markdown' | |
Plug 'SirVer/ultisnips' | |
Plug 'xolox/vim-session' | |
" --- UI {{{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
memory | max_idle_in_min | |
---|---|---|
128 | 27 | |
256 | 27 | |
512 | 27 | |
1024 | 27 | |
1152 | 27 | |
1280 | 27 | |
1408 | 27 | |
1536 | 27 | |
1792 | 27 |
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
#!/bin/sh | |
# Some things taken from here | |
# https://github.com/mathiasbynens/dotfiles/blob/master/.osx | |
# Set the colours you can use | |
black='\033[0;30m' | |
white='\033[0;37m' | |
red='\033[0;31m' | |
green='\033[0;32m' |
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
#!/bin/bash | |
DIRS=( /tmp/scifi /tmp/fiction /tmp/math ) | |
DEST=/foo/bar/library | |
for u in ${DIRS[@]} | |
do | |
echo "linking $u into $DEST" | |
ln $u $DEST | |
done |
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
def __init__(self, *args, **kw): | |
super(EditProfileForm, self).__init__(*args, **kw) | |
index = self.fields.keyOrder.index('about') | |
self.fields.keyOrder.remove('majors') | |
self.fields.keyOrder.insert(index, 'majors') |
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
int main(){ | |
<:]{%>; // smile! | |
} |