Skip to content

Instantly share code, notes, and snippets.

@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:
@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
@hrldcpr
hrldcpr / tree.md
Last active May 1, 2024 00: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!

@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
#
@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;
@johntyree
johntyree / getBlockLists.sh
Last active March 9, 2024 12:32
Make one large blocklist from the bluetack lists on iblocklist.com
#!/usr/bin/env sh
# Download lists, unpack and filter, write to stdout
curl -s https://www.iblocklist.com/lists.php \
| sed -n "s/.*value='\(http:.*=bt_.*\)'.*/\1/p" \
| xargs wget -O - \
| gunzip \
| egrep -v '^#'
@piscisaureus
piscisaureus / pr.md
Created August 13, 2012 16:12
Checkout github pull requests locally

Locate the section for your github remote in the .git/config file. It looks like this:

[remote "origin"]
	fetch = +refs/heads/*:refs/remotes/origin/*
	url = git@github.com:joyent/node.git

Now add the line fetch = +refs/pull/*/head:refs/remotes/origin/pr/* to this section. Obviously, change the github url to match your project's URL. It ends up looking like this:

#!/usr/bin/env perl
#
# Filesystem changes trigger
use v5.14;
use FindBin;
use lib "$FindBin::Bin/../lib";
use E1::Setup::Perl;
use Filesys::Notify::Simple;
@Nurdok
Nurdok / python_conversion.md
Last active December 16, 2022 03:45
Python Conversion

Python Number Conversion Chart

From To Expression
@jbenet
jbenet / simple-git-branching-model.md
Last active April 9, 2024 03:31
a simple git branching model

a simple git branching model (written in 2013)

This is a very simple git workflow. It (and variants) is in use by many people. I settled on it after using it very effectively at Athena. GitHub does something similar; Zach Holman mentioned it in this talk.

Update: Woah, thanks for all the attention. Didn't expect this simple rant to get popular.