Skip to content

Instantly share code, notes, and snippets.

View theand's full-sized avatar

Heesang Chae theand

  • South Korea
View GitHub Profile
@theand
theand / pyconkr-program-select.user.js
Created July 18, 2017 00:47
https://www.pycon.kr/2017/program/schedule/ 프로그램 표 선택 내용을 브라우저에 기억시켜두는 유저스크립트
// ==UserScript==
// @name PyconKR Program Select
// @namespace http://127.0.0.1
// @description User Script for PyconKR Program Select
// @author Heesang Chae
// @include https://www.pycon.kr/2017/program/schedule/*
// @require https://cdn.jsdelivr.net/gh/marcuswestin/[email protected]/dist/store.everything.min.js
// @version 2017.07.17
// @grant none
// ==/UserScript==
@theand
theand / j2_header
Created April 12, 2017 05:51
append jinja2 template header to all file in ansible project.
# {{ ansible_managed }}
@theand
theand / testpg.py
Last active April 12, 2017 05:35
testing pg connection
#!/usr/bin/python
#
import psycopg2
try:
db = psycopg2.connect("dbname='xxx' user='xxx' host='xxx' port='xxx' password='xxx'")
cur = db.cursor()
cur.execute("select current_timestamp")
print cur.fetchone()
except Exception as inst:
print(inst)
@theand
theand / README.md
Created May 29, 2016 09:56 — forked from nicerobot/README.md
Mac OS X uninstall script for packaged install of node.js

To run this, you can try:

curl -ks https://gist.githubusercontent.com/nicerobot/2697848/raw/uninstall-node.sh | bash

I haven't tested this script doing it this way but i run a lot of my Gists like this so maybe this one'll work too.

Alternatively,

curl -ksO https://gist.githubusercontent.com/nicerobot/2697848/raw/uninstall-node.sh

chmod +x ./uninstall-node.sh

#!/bin/bash
for i in *.$1
do
if [ "$i" = "." ] || [ "$i" = ".." ]
then
continue
fi
convert "$i" -morphology Convolve DoG:15,100,0 -negate -normalize -blur 0x1 -channel RBG -level 60%,91%,0.1 "cleaned_$i"
@theand
theand / install script
Last active January 2, 2017 02:43
Boxen
curl -sL https://gist.githubusercontent.com/theand/2b86ae3fc64527cd804e/raw/83bae2705e182186d9f8b30cd1caded6d97ad88f/install_boxen > /tmp/install-boxen; bash /tmp/install-boxen
@theand
theand / vaprobash_halt.bat
Created June 17, 2014 06:08
run vagrant up and halt
C:
cd "C:\devel\works\Vaprobash"
cmd.exe /k vagrant halt
@theand
theand / pageant_load.bat
Created June 17, 2014 06:07
start pageant(from putty package) with default private keys. (it assumes PATH included)
set KEY_1="id_rsa.ppk"
set KEY_2="id_rsa_wireless.ppk"
d:
cd "d:\ssh"
cmd.exe /k start "" pageant %KEY_1% %KEY_2%
@theand
theand / update_composer_all.sh
Created June 6, 2014 02:57
run 'compser update' on all subdirectory
function update_composer_all(){
for DIR in *;
do
echo "Processing : $DIR/"
[[ -d $DIR ]] && [[ -e $DIR/composer.json ]] && cd $DIR && composer update && cd .. ;
done
}
@theand
theand / rename_mp4.py
Created May 14, 2014 03:45
rename a bunch of mp4 files to specified naming pattern.
#!/usr/bin/env python
#-*- coding: utf-8 -*-
import os
import os.path
import shutil
import re
FILENAME = re.compile("^(?P<number>\d\d)_(?P<title>.*)-(?P<name>[a-z]*-[a-z]*)")