Skip to content

Instantly share code, notes, and snippets.

🏠
Working from home

James Robertson jrobertson

🏠
Working from home
Block or report user

Report or block jrobertson

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@jrobertson
jrobertson / setup_etc-network-interfaces_static-ipv6-tunnel-via-sixxs.sh SixXS Static 6in4 IPv6 Tunnel on Ubuntu / Debian defined in `/etc/network/interfaces`
View setup_etc-network-interfaces_static-ipv6-tunnel-via-sixxs.sh
#!/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 Apr 20, 2011
Edge detection with the Sobel operator in Ruby
View edge_detection.rb
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 Dec 30, 2010
Software installed on the Sony Vaio VPCEB3F4E/WI Ubuntu 10.04 LTS
View gist:759694
acpi-support
acpid
adduser
adium-theme-ubuntu
aisleriot
alacarte
alsa-base
alsa-utils
anacron
app-install-data
@jrobertson
jrobertson / gist:706350
Created Nov 19, 2010
Nov2010 Shopping list
View gist:706350
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
View rexle_testdata.xml
<tests>
<summary/>
<records>
<test>
<summary>
<path>1</path>
<description>return the element which matches @colour="red"</description>
</summary>
<records>
<io>
View S-rscript boot-up script
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)
View calculate_tt
# 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
You can’t perform that action at this time.