Skip to content

Instantly share code, notes, and snippets.

@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
printf (date "+$c2%H$c0:$c2%M$c0:$c2%S, ")
@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)
@gak
gak / link-fish-to-google-drive.sh
Last active December 18, 2015 06:09
Linking fish to Google Drive
@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!")
});
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)
{
"Version": "2008-10-17",
"Id": "Policy1361081479235",
"Statement": [
{
"Sid": "Stmt1361081441897",
"Effect": "Allow",
"Principal": {
"AWS": "arn:aws:iam::772560792726:user/packetloop-s3"
},
@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
@gak
gak / robot.js
Created December 6, 2012 04:46
gakbot
//FightCode can only understand your robot
//if its class is called Robot
var Robot = function(robot) {
};
Robot.prototype.onIdle = function(ev) {
var robot = ev.robot;
robot.ahead(100);
@gak
gak / robot.js
Created December 6, 2012 04:46
gakbot
//FightCode can only understand your robot
//if its class is called Robot
var Robot = function(robot) {
this.left = 1;
};
Robot.prototype.onIdle = function(ev) {
var robot = ev.robot;
for (var i = 0; i < 10; i++) {