Skip to content

Instantly share code, notes, and snippets.

View znut's full-sized avatar
👋

Nut Sornchumni znut

👋
  • Bangkok, Thailand
  • 12:20 (UTC +07:00)
View GitHub Profile
[alias]
ls = log --pretty=format:'%C(auto)%h%d %C(bold blue)(%ad)%Creset %s %C(green)<%cn>' --date=relative
lg = log --graph --abbrev-commit --decorate --date=relative --format=format:'%C(auto)%h%d %C(bold blue)(%ar)%C(reset) %C(white)%s%C(reset) %C(green)<%cn>'
lp = log -p
lst = log --stat
s = status
ss = status -s
st = stash
stp = stash pop
sta = stash apply
server {
listen 80;
listen [::]:80 ipv6only=on;
server_name abc.xyz;
# redirect all requests to https
return 301 https://$server_name$request_uri;
}
server {
@znut
znut / jp.md
Last active August 23, 2016 16:07
japan trip

TRIP 12/6 ~ 12/13

12/6 BKK-NRT(XJ606) 10:45~19:00

12/12 NRT-BKK(XJ607) 20:15~0:55

TIMELINE

  • 12/6
  • 10:45 Depart
  • 19:00 Arrive @ Narita airport
  • go to hotel [JPY ~1,500]
@znut
znut / 0_reuse_code.js
Created November 29, 2015 06:31
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
@znut
znut / snow-feb.md
Last active August 23, 2016 16:08
mystery

HOKKAIDO 2/20~2/27

FLIGHT

Direct

  • [BKK-CTS] Thai Airways(+20kgs) 22000THB

1 stop

  • [DMK-KIX] Scoot 12000THB (+20kgs 1000THB)
  • [KIX-CTS] Peach 11000JPY(~3300THB)
@znut
znut / .vimrc
Last active November 23, 2016 13:07
min-vimrc
set guioptions=i
colorscheme evening
set columns=120
set hidden
set number
set guifont=Consolas:h9:cANSI
filetype indent on
filetype plugin on
autocmd InsertLeave * if pumvisible() == 0|pclose|endif
set tabstop=4
@znut
znut / test.c
Last active June 19, 2017 14:51
int i = 5; // [5] <- p
^
i
(...) p = &i;
[] = memory block
p = 0x1234 // addr
*p = 5 // value at addr p

init

$ virtualenv --no-site-packages SOME_DIR
$ virtualenv --python=/usr/bin/python3.6 SOME_DIR
$ pip install requirements.txt