Skip to content

Instantly share code, notes, and snippets.

View jrobertson's full-sized avatar
🏠
Working from home

James Robertson jrobertson

🏠
Working from home
View GitHub Profile
@jrobertson
jrobertson / setup_etc-network-interfaces_static-ipv6-tunnel-via-sixxs.sh
Created May 25, 2011 23:19 — forked from pklaus/setup_etc-network-interfaces_static-ipv6-tunnel-via-sixxs.sh
SixXS Static 6in4 IPv6 Tunnel on Ubuntu / Debian defined in `/etc/network/interfaces`
#!/bin/bash
# IPv6 Tunnel setup of an sixxs.net tunnel on Linux using the configuration file `/etc/network/interfaces`
# (needs the `ip` tool from the iproute suite, Ubuntu package: <http://packages.ubuntu.com/iproute>)
#
# Run like this:
# ./setup_etc-network-interfaces_static-ipv6-tunnel-via-sixxs.sh
#
# 2011 by Philipp Klaus
# Published on <http://blog.philippklaus.de/2011/05/sixxs-static-6in4-ipv6-tunnel-on-ubuntu-debian/>
@jrobertson
jrobertson / edge_detection.rb
Created April 20, 2011 07:02
Edge detection with the Sobel operator in Ruby
require 'chunky_png'
class ChunkyPNG::Image
def at(x,y)
ChunkyPNG::Color.to_grayscale_bytes(self[x,y]).first
end
end
img = ChunkyPNG::Image.from_file('engine.png')
@jrobertson
jrobertson / gist:759694
Created December 30, 2010 11:39
Software installed on the Sony Vaio VPCEB3F4E/WI Ubuntu 10.04 LTS
acpi-support
acpid
adduser
adium-theme-ubuntu
aisleriot
alacarte
alsa-base
alsa-utils
anacron
app-install-data
@jrobertson
jrobertson / gist:706350
Created November 19, 2010 10:58
Nov2010 Shopping list
j--r.info/gn Bosch WVH 28420 Front Loading Washing Machine *£636 j--r.info/gv [appliancedeals.co.uk] (free delivery)
j--r.info/go BOSCH SMS69L12GB Dishwasher *£476.99 j--r.info/gw [electrical123.com]
j--r.info/gp Bosch KGV36V10GB Fridge Freezer £456.88, *£358.99 #amazon j--r.info/gx [iguanadirect.co.uk]
j--r.info/gs Breville JK147-01 Cordless Jug Kettle £42.00 #amazon
j--r.info/gr Breville VST004 Silver 2 Slice Sandwich Toaster Easy Clean £24.29 #amazon
j--r.info/gq Kenwood JK455 Energy Saving Kettle, Stainless Steel *£44.95 j--r.info/gz [johnlewis.com]
j--r.info/gt Kenwood TTM405 Toaster Polished Steel £56.30 #amazon
* - price from buycentral.co.uk
@jrobertson
jrobertson / rexle_testdata.xml
Created October 28, 2010 21:43
testdata for rexle
<tests>
<summary/>
<records>
<test>
<summary>
<path>1</path>
<description>return the element which matches @colour="red"</description>
</summary>
<records>
<io>
require 'hashcache'
require 'rscript'
require 'rexml/document'
include REXML
@@get_routes = {}; @@post_routes = {}
@@services = {}
@@templates = {}
@content_type = 'text/html'
@rsf_cache = HashCache.new(cache: 5)
# converted from JavaScript; source: http://blog.jgc.org/2010/06/1010-code.html
def calculate_tt(lat, lon)
alphabet = "ABCDEFGHJKMNPQRVWXY0123456789".split(//)
base = alphabet.length
lat += 90.0
lon += 180.0
lat *= 10000.0
puts 'Hello World'