Skip to content

Instantly share code, notes, and snippets.

@melo
melo / bench_crc.pl
Created May 3, 2012 09:11
Digest::CRC vs String::CRC32
#!/usr/bin/env perl
use 5.014;
use warnings;
use Benchmark 'cmpthese';
use Digest::CRC ();
use String::CRC32 ();
my $payload = 'a' x 1024;
@erikh
erikh / hack.sh
Created March 31, 2012 07:02 — forked from DAddYE/hack.sh
OSX For Hackers
#!/usr/bin/env sh
##
# This is script with usefull tips taken from:
# https://github.com/mathiasbynens/dotfiles/blob/master/.osx
#
# install it:
# curl -sL https://raw.github.com/gist/2108403/hack.sh | sh
#
@hrldcpr
hrldcpr / tree.md
Last active June 8, 2024 18:11
one-line tree in python

One-line Tree in Python

Using Python's built-in defaultdict we can easily define a tree data structure:

def tree(): return defaultdict(tree)

That's it!

@melo
melo / .perltidyrc
Created March 4, 2012 09:34
The quest for the perfect .perltidyrc
# My (almost) perfect perl tidy config file
-l=100 # Max line width is 100 cols - We are not on vt100 line terminals anymore
-i=2 # Indent level is 2 cols
-ci=2 # Continuation indent is 2 cols
-se # Errors to STDERR
-vt=2 # Maximal vertical tightness
-cti=0 # No extra indentation for closing brackets
-pt=2 # High parenthesis tightness
-bt=2 # High brace tightness
@alexspurling
alexspurling / git_svn_bash_prompt.sh
Last active August 8, 2018 05:51 — forked from woods/git_svn_bash_prompt.sh
Update of prompt colours and terminal title
#!/bin/bash
#
# DESCRIPTION:
#
# Set the bash prompt according to:
# * the branch/status of the current git repository
# * the branch of the current subversion repository
# * the return value of the previous command
#
# USAGE: