Skip to content

Instantly share code, notes, and snippets.

@CrBoy
CrBoy / paint_text.py
Created March 25, 2012 04:47 — forked from dannvix/paint_text.py
Paint text on given image with PIL
#!/usr/bin/env python
#-*- encoding: utf8
# sudo easy_install PIL
import Image
import ImageFont
import ImageDraw
import sys
import os
@CrBoy
CrBoy / list_quick_sort.h
Created November 30, 2011 05:04 — forked from baiyanhuang/list_quick_sort.h
quick sort of single linked list
#pragma once
#include <utility>
//
// Quick sort for single linked list
//
// Template arguments:
// T: node's pointer type
// Next: function/functor to get next node
// Compare: functor to compare 2 arguments
//
function _ps1_git(){
local ref cnt branch clean
ref=$(git symbolic-ref HEAD 2> /dev/null)
cnt=$(git branch 2> /dev/null|grep -c -E '*')
branch=$(echo "${ref#refs/heads/}")
if [[ "${branch}" == "" ]]
then
return
fi
#include <cstdio>
#include <cstdlib>
#include <cmath>
#include <ctime>
#include <cstdlib>
#include <vector>
#include <algorithm>
using namespace std;
#include <cstdio> // printf
#include <cstdlib> // NULL
#include <algorithm> // fill
#include <vector>
#include <queue>
using namespace std;
//use constant instead of macro
const int MAXV = 1000; // maximum value of vertex