Skip to content

Instantly share code, notes, and snippets.

View kumikoda's full-sized avatar
🧎‍♂️
Summoning AI God

Anson Chu kumikoda

🧎‍♂️
Summoning AI God
View GitHub Profile
set nocompatible
set runtimepath+=~/.cache/dein/repos/github.com/Shougo/dein.vim " path to dein.vim
call dein#begin(expand('~/.cache/dein')) " path to plugins dir
call dein#add('Shougo/dein.vim') " the plugin manager itself
call dein#add('Shougo/deoplete.nvim') " autocomplete
call dein#add('scrooloose/nerdtree') " file tree explorer
call dein#add('vim-airline/vim-airline') " status bar
call dein#end()
# a simple two line prompt with color
source ~/git-prompt.sh
GIT_PS1_SHOWCOLORHINTS=1
GIT_PS1_SHOWDIRTYSTATE=1
GIT_PS1_SHOWUNTRACKEDFILES=1
cyan='\e[0;36m'
blue='\e[0;34m'
green='\e[0;32m'
reset="\e[0m"
PS1="${blue}\u@\h ${cyan}\w${green} \$(__git_ps1) ${reset}\n\$ "
@kumikoda
kumikoda / set-timeout.py
Created June 9, 2017 00:19
set timeout in python
import heapq
import time
class runtime:
def __init__(self):
self.heap = []
def setTimeout(self, fn, timeout):
exp = time.time() + timeout
@kumikoda
kumikoda / game-of-life.py
Created June 9, 2017 00:19
game of life in python
from sets import Set
class Game:
def __init__(self, state):
self.state = state
def next(self):
new_state = Set()
for cell in state:
@kumikoda
kumikoda / fifo.py
Created June 9, 2017 00:18
fifo queue in python
class Fifo:
def __init__(self, size):
self.size = size
self.count = 0
self.q = [None] * size
self.head = 0
self.tail = 0
def push(self, elm):
print self.count
@kumikoda
kumikoda / work.go
Last active August 29, 2015 14:26
Using go routines and channels to do some work
package main
import (
"fmt"
"sync"
"time"
)
func main() {
@kumikoda
kumikoda / npm-outdated.sh
Created February 20, 2015 21:52
check yo dependencies outdated
npm outdated --depth=0
@kumikoda
kumikoda / pssh.md
Created February 13, 2015 20:12
pssh cheatsheet

pssh -t 0 -o output -h hosts "echo hello world"

// -t : timeout, 0 for no timeout // -o : name of folder to write output // -h : file with hostnames, one per line

// put the following in your ssh config so you won't be prompted StrictHostKeyChecking no

@kumikoda
kumikoda / ro13.go
Created February 8, 2015 01:33
goland tutorial rot13 reader
package main
import (
"io"
"os"
"strings"
)
type rot13Reader struct {
r io.Reader
better manager positive
fierce leader inspire find things cool (go)
communication, responsiveness, on call awesomeness
interaction with other teams
----------