Skip to content

Instantly share code, notes, and snippets.

@rjp
rjp / Bufferme.py
Created May 13, 2014 08:26
Bufferme
# -*- coding: utf-8 -*-
#!/usr/bin/env python
# Coded poorly by Brett Kelly
# http://nerdgap.com
# @inkedmn
# -*- coding: utf-8 -*-
import urllib2
import urllib
@rjp
rjp / gist:5583735
Last active December 17, 2015 08:59
#!/usr/bin/perl
use strict;
use warnings;
use LWP::Simple;
use JSON;
use Data::Dumper;
sub get_skillz {
#! /usr/bin/perl
use Data::Dumper;
use CGI;
my $a = new CGI;
print $a->header('text/plain');
print Dumper($a);
print "XX ", $a->http('Host'), "\n";
print "YY ", $ENV{'HTTP_HOST'}, "\n";
print "ZZ ", $a->http('Authorization'), "\n";
@rjp
rjp / RtR.md
Last active December 16, 2015 09:09

rjp's Road To Ruby.

I, rjp, do solemnly offer these my responses to The Road to Ruby Survey:

0. Briefly describe yourself?

Humanoid, halfway through expected lifecycle.

1. When did you first try Ruby seriously?

@rjp
rjp / every20.sh
Created February 5, 2013 05:54
Reliably run snowcam.sh at :00/:20/:40 seconds
boot=$((SECONDS % 20))
time=$(($(date +%s) % 20))
offset=$((20-(time-boot)))
echo "boot=$boot time=$time offset=$offset"
while [ 1 ]; do
while [ $(((SECONDS-offset) % 20)) -lt 18 ]; do sleep 1; done
while [ $(((SECONDS-offset) % 20)) -lt 19 ]; do echo >/dev/null; done
sleep 1
./snowcam.sh || exit
#!/usr/bin/env ruby -wKU
# Paste this code into a TextExpander snippet to have the Shakespeare Insult Kit a keystroke away
# Just set the Content of the TextExpander snippet to 'Shell Script', and give it an abbreviation
# Shakespeare Insult Kit: http://www.pangloss.com/seidel/shake_rule.html
print "Thou " + ["artless","bawdy","beslubbering","bootless","churlish","cockered","clouted","craven","currish","dankish","dissembling","droning","errant","fawning","fobbing","froward","frothy","gleeking","goatish","gorbellied","impertinent","infectious","jarring","loggerheaded","lumpish","mammering","mangled","mewling","paunchy","pribbling","puking","puny","qualling","rank","reeky","roguish","ruttish","saucy","spleeny","spongy","surly","tottering","unmuzzled","vain","venomed","villainous","warped","wayward","weedy","yeasty","cullionly","fusty","caluminous","wimpled","burly-boned","misbegotten","odiferous","poisonous","fishified","Wart-necked"].shuffle.first + " " + ["base-court","bat-fowling","beef-witted","beetle-hea
#!/usr/bin/env ruby
## disconnect
# ./disconnect.rb -u yourusername [-o /your/path] [-p yourhttpproxyserver]
#
# This is a command-line utility for the bulk-downloading of run data from
# the connect.garmin.com web application, which has lackluster export
# capabilities.
#
@rjp
rjp / TSAQuestions.md
Created November 26, 2012 05:48
Questions for @SaveLewishamAE to ask @OfficeTSA at meetings

(Hopefully at least one of these questions is useful.)

Figures and stuff taken from my 2012-11-21 notes at the Greenwich TSA meeting. Might be flawed. Please double-check before quoting!

Also please fork, expand, notate, go wild.

Maternity

  1. What's the geographical distribution of the 5000 expected births? How would that distribute to the remaining 4 units?
  2. How much of the £17M saving would be needed to bring the other 4 units up to capacity for handling the extra births?
@rjp
rjp / hack.sh
Created April 1, 2012 09:30 — forked from erikh/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
#
2011/12/05 17:45:03 [debug] 11136#0: epoll: fd:11 ev:0001 d:0853AB1C
2011/12/05 17:45:03 [debug] 11136#0: post event 08553AF4
2011/12/05 17:45:03 [debug] 11136#0: timer delta: 7457
2011/12/05 17:45:03 [debug] 11136#0: posted event 08553AF4
2011/12/05 17:45:03 [debug] 11136#0: delete posted event 08553AF4
2011/12/05 17:45:03 [debug] 11136#0: accept on 0.0.0.0:8080, ready: 0
2011/12/05 17:45:03 [debug] 11136#0: posix_memalign: 081A5E70:256 @16
2011/12/05 17:45:03 [debug] 11136#0: *1 accept: 206.251.255.197 fd:17
2011/12/05 17:45:03 [debug] 11136#0: *1 event timer add: 17: 60000:257236343
2011/12/05 17:45:03 [debug] 11136#0: *1 epoll add event: fd:17 op:1 ev:80000001