Skip to content

Instantly share code, notes, and snippets.

ppa:saltstack/salt
ppa:chris-lea/uwsgi
ppa:nginx/stable
ppa:chris-lea/redis-server
-- [[ Implementation of MergeSort --]]
-- merge an array split from p-q, q-r
merge = (A, p, q, r) ->
n1 = q - p + 1
n2 = r - q
left = {}
right = {}
for i = 1, n1
upstream hurl_proxy {
server www.hurl.it;
keepalive 600;
}
server {
listen 80;
server_name hurl.example.com;
access_log /var/log/nginx/hurl_proxy.access.log;
from __future__ import print_function
import dis
def f1():
x = 'a' * 20
y = 'a' * 20
return x is y
# File: test_matplotlib_chinese.py -*- Encoding: utf-8 -*-
import wx
import gettext
import matplotlib
matplotlib.use('WXAgg')
from pylab import *
from matplotlib.backends.backend_wxagg import \
FigureCanvasWxAgg as FigureCanvas
from matplotlib.figure import Figure
#!/usr/bin/env python
# a pygame script to draw random size/color rectangle on the screen.
# It's adapted from http://apress.com/book/view/9781590598726 chapter 4
import pygame
from pygame.locals import *
from random import *
import sys
pygame.init()
screen = pygame.display.set_mode((640, 480), FULLSCREEN, 32)
-- File: exprparser.hs
-- This is from the Parsec documentation with minor modification.
module ExprParser where
import Text.ParserCombinators.Parsec
import Text.ParserCombinators.Parsec.Expr
import qualified Text.ParserCombinators.Parsec.Token as P
import Text.ParserCombinators.Parsec.Language
lexer :: P.TokenParser ()

Mar 16, 2010

(?<user>[^@]+) @ (?<company>[^.]+) \. (?<top_level_domain>\w{2,4})

Mar 19, 2010

perl -pi -e 's/ipodder/juice/g' `git grep ipodder | gawk -F: '{print $1}' | sort | uniq`

Mar 19, 2010

%%
/* match everything except newline */
. ECHO;
/* match newline */
\n ECHO;
%%
int yywrap(void) {
return 1;
}