Skip to content

Instantly share code, notes, and snippets.

View kevinslin's full-sized avatar

Kevin Lin kevinslin

View GitHub Profile
@kevinslin
kevinslin / tmobile support conversation
Last active July 23, 2019 23:20
tmobile metro support conversation
# 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
@kevinslin
kevinslin / shell.rc
Created June 24, 2019 16:51
history file
# 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
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',
@kevinslin
kevinslin / .vimrc.plugins
Created May 17, 2019 17:20
vim plugin and options
" --- 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
memory max_idle_in_min
128 27
256 27
512 27
1024 27
1152 27
1280 27
1408 27
1536 27
1792 27

Node syntax

=== Syntax 1

def build():
  nodes = {}
  node['a'] = Node(...)
  node['b'] = Node(...)
 ...
#!/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'
@kevinslin
kevinslin / reoder_fields.py
Created May 4, 2013 13:23
#django #form #cookbook Reorder fields on django form
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')