Skip to content

Instantly share code, notes, and snippets.

@irl
irl / .zshrc
Last active November 11, 2021 00:08
My .zshrc file
#!/usr/bin/env zsh
### Fix rxvt to work on machines that don't know about
### the 256color variant
if [ $TERM = "rxvt-unicode-256color" ]; then
export TERM="rxvt-unicode"
fi
### History settings
@irl
irl / gist:4229914
Created December 7, 2012 01:11
Reading SDF Chatter
import urllib2
import re
from xml.dom.minidom import parseString
class GUIDS:
guids = []
def __init__(self):
f = open("/meta/i/irl/.chatterguids")
#define zenburn_fg #dcdccc
#define zenburn_bg_1 #282828
#define zenburn_bg #3f3f3f
#define zenburn_bg_01 #4f4f4f
#define zenburn_bg_02 #5f5f5f
#define zenburn_black #000000
#define zenburn_blue_01 #94bff3
#define zenburn_blue #8cd0d3
#!/bin/ksh
set -e
[ $# -ge 1 ] || (echo "usage: $1 [update|kernel]"; exit 1)
function update {
echo "Updating xenocara..."
(cd /usr/xenocara && cvs up -Pd)
}
@irl
irl / scramble.c
Created October 31, 2019 20:51
file scrambler
#include <stdio.h>
int
main(int argc, char **argv)
{
int c, r;
r = 0;
while ((c = getc(stdin)) != EOF) {
r = (13 * r + 249) & 0xff;
putc(c ^ r, stdout);
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@irl
irl / ab24-plot-temps-machine.r
Created May 2, 2013 06:12
Honours Project Data Analysis in R
library(rrdf)
g <- load.rdf("sparql.rdf")
rs <- sparql.rdf(g, "PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
PREFIX qudt: <http://qudt.org/1.1/schema/qudt#>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
PREFIX ssn: <http://purl.oclc.org/NET/ssnx/ssn#>
PREFIX xsd: <http://www.w3.org/2001/XMLSchema#>
SELECT ?temperature ?time WHERE {
?sensor rdf:type <http://uktemp.net/ont/#WundergroundTemperatureSensingDevice> .
?observation ssn:observedProperty <http://uktemp.net/dataset/temperature/AB24> .
@irl
irl / gist:4280877
Created December 13, 2012 22:56
A shell script written towards the end of the assessment period in the first half of my fourth year of University. I do not recommend using it as your .bashrc file.
# fuckup.sh
#
# (C) Iain R. Learmonth 2012.
#
# This program is free software. It comes without any warranty, to
# the extent permitted by applicable law. You can redistribute it
# and/or modify it under the terms of the Do What The Fuck You Want
# To Public License, Version 2, as published by Sam Hocevar. See
# http://sam.zoy.org/wtfpl/COPYING for more details.
#
@irl
irl / gist:4186207
Created December 2, 2012 00:52
SpaceBarOS/DCPU
;
; SpaceBarOS/DCPU
; (C) Iain R. Learmonth 2012. All rights reserved.
;
; Requires:
; DCPU-16
; LEM1802
;
; Tasks:
; Memory management
[2012-11-09 14:20:21] DEBUG: running gui
[2012-11-09 14:20:21] DEBUG: assigned color pair 1 to (4, 0)
[2012-11-09 14:20:21] DEBUG: assigned color pair 2 to (-1, -1)
[2012-11-09 14:20:21] DEBUG: assigned color pair 3 to (6, 0)
[2012-11-09 14:20:21] DEBUG: assigned color pair 4 to (1, -1)
[2012-11-09 14:20:21] DEBUG: configuring...
[2012-11-09 14:20:21] DEBUG: task version: 2.1.2
[2012-11-09 14:20:21] DEBUG: bind #0: key <ERR> (-1) bound to @(nil) tasklist - (null)(args: 0/(null))
[2012-11-09 14:20:21] DEBUG: bind #1: key <ERR> (-1) bound to @(nil) pager - (null)(args: 0/(null))
[2012-11-09 14:20:21] DEBUG: bind #2: key <resize> (410) bound to @0x407e50 (null)(args: 0/(null))