Skip to content

Instantly share code, notes, and snippets.

View gak's full-sized avatar

gak gak

View GitHub Profile
@gak
gak / header
Last active December 11, 2015 07:48 — forked from anonymous/gist:4568544
%DEFAULT includepath pig/include.pig
RUN $includepath;
%DEFAULT time 60
-- for local mode: uncomment the next line and comment the one after that
--%DEFAULT old_snort_conf 'lib/snort-2905/etc/snort.conf'
%DEFAULT old_snort_conf '/mnt/var/lib/snort-2905/etc/snort.conf'
-- for local mode: uncomment the next line and comment the one after that
{
"Version": "2008-10-17",
"Id": "Policy1361081479235",
"Statement": [
{
"Sid": "Stmt1361081441897",
"Effect": "Allow",
"Principal": {
"AWS": "arn:aws:iam::772560792726:user/packetloop-s3"
},
def colourize_node(calls, total_time):
value = float(total_time * 2 + calls) / 3
return '%f %f %f' % (value / 2 + .5, value, 0.9)
def colourize_edge(calls, total_time):
value = float(total_time * 2 + calls) / 3
return '%f %f %f' % (value / 2 + .5, value, 0.7)
@gak
gak / mousetrap-iddqd.js
Last active December 17, 2015 22:39
Example Mousetrap code for the blog post:http://geraldkaszuba.com/red-panda-mini-game/
Mousetrap.bind('space', function(e) { e.preventDefault(); player.shoot(true) }, 'keydown')
Mousetrap.bind('space', function(e) { e.preventDefault(); player.shoot(false) }, 'keyup')
Mousetrap.bind('i d d q d', function() {
console.log("God Mode enabled!")
});
@gak
gak / link-fish-to-google-drive.sh
Last active December 18, 2015 06:09
Linking fish to Google Drive
@gak
gak / fish-colours.sh
Created June 9, 2013 12:36
My custom fish prompt code explained at http://geraldkaszuba.com/tweaking-fish-shell/
set fish_color_error ff8a00
# c0 to c4 progress from dark to bright
# ce is the error colour
set -g c0 (set_color 005284)
set -g c1 (set_color 0075cd)
set -g c2 (set_color 009eff)
set -g c3 (set_color 6dc7ff)
set -g c4 (set_color ffffff)
set -g ce (set_color $fish_color_error)
printf (date "+$c2%H$c0:$c2%M$c0:$c2%S, ")
@gak
gak / fish-time-taken.sh
Created June 10, 2013 06:38
My custom fish prompt code explained at http://geraldkaszuba.com/tweaking-fish-shell/
# Track the last non-empty command. It's a bit of a hack to make sure
# execution time and last command is tracked correctly.
set -l cmd_line (commandline)
if test -n "$cmd_line"
set -g last_cmd_line $cmd_line
set -ge new_prompt
else
set -g new_prompt true
end
# Git branch and dirty files
git_branch
if set -q git_branch
set out $git_branch
if test $git_dirty_count -gt 0
set out "$out$c0:$ce$git_dirty_count"
end
section git $out
end
@gak
gak / fish-python-virtualenv.sh
Last active December 18, 2015 07:29
My custom fish prompt code explained at http://geraldkaszuba.com/tweaking-fish-shell/
# Virtualenv
if set -q VIRTUAL_ENV
section env (basename "$VIRTUAL_ENV")
end