Skip to content

Instantly share code, notes, and snippets.

@wkl
wkl / .bootstrap.sh
Created March 14, 2018 00:44
Setup new workspace
#!/usr/bin/env bash
git clone https://github.com/wkl/dotfiles ~/.dotfiles && ~/.dotfiles/setup.sh
git clone https://github.com/wkl/vimrc ~/.vim && ~/.vim/setup.sh
@wkl
wkl / traverse.py
Last active January 30, 2018 04:03
python subprocess: traverse one level sub-directory and run the command
import os
import sys
import subprocess
for entry in os.scandir(sys.argv[1]):
if entry.is_dir():
print(entry.path)
cmd = "cat 1.txt 2.txt > 3.txt"
subprocess.Popen(cmd, shell=True, cwd=entry.path)
@wkl
wkl / jsoncpp.pc
Created December 4, 2014 07:51
jsoncpp pkg-config file for FreeBSD
prefix=/usr/local
libdir=${prefix}/lib
includedir=${prefix}/include/jsoncpp
version = 0.6.0-rc2
name = jsoncpp
pkgname = libjsoncpp0
Name: ${name}