Skip to content

Instantly share code, notes, and snippets.

View youngsofun's full-sized avatar

Yang Xiufeng youngsofun

View GitHub Profile
@youngsofun
youngsofun / custom_iterator.cpp
Created April 2, 2020 06:47 — forked from jeetsukumaran/custom_iterator.cpp
Sample C++/STL custom iterator
// Sample custom iterator.
// By perfectly.insane (http://www.dreamincode.net/forums/index.php?showuser=76558)
// From: http://www.dreamincode.net/forums/index.php?showtopic=58468
#include <iostream>
#include <vector>
#include <algorithm>
#include <iterator>
#include <cassert>
@youngsofun
youngsofun / Git push deployment in 7 easy steps.md
Created June 25, 2018 04:49 — forked from thomasfr/Git push deployment in 7 easy steps.md
7 easy steps to automated git push deployments. With small and configurable bash only post-receive hook
@youngsofun
youngsofun / insert_guard.vim
Created May 12, 2018 00:40 — forked from yt-siden/insert_guard.vim
Insert UUID-based include guard macro on VIM
" C/C++ insert UUID based include guard
function! s:insert_include_guard()
let s:uuid=system('uuidgen')
let s:uuid=strpart(s:uuid, 0, strlen(s:uuid)-1)
let s:uuid=substitute(s:uuid, '[a-f]', '\u\0', 'g')
let s:uuid=substitute(s:uuid, '\-', '_', 'g')
let s:uuid='UUID_'.s:uuid
call append(0, '#ifndef '.s:uuid)
call append(1, '#define '.s:uuid)
@youngsofun
youngsofun / kill_child_processes.py
Created March 16, 2018 03:02 — forked from jizhilong/kill_child_processes.py
how to kill a process's child processes in python
#!/usr/bin/env python
import multiprocessing
import time
import subprocess, os, signal, sys
def test(s):
while True:
print s
time.sleep(1.5)