This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
".vimrc - tommorris.org | |
:set formatoptions=l | |
:set lbr | |
:set wrap | |
:set autoindent | |
:set softtabstop=2 | |
:set hlsearch | |
:colorscheme evening | |
:syntax enable |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oct 24 08:49:53 localhost kernel[0]: npvhash=4095 | |
Oct 24 08:49:48 localhost com.apple.launchctl.System[2]: fsck_hfs: Volume is journaled. No checking performed. | |
Oct 24 08:49:48 localhost com.apple.launchctl.System[2]: fsck_hfs: Use the -f option to force checking. | |
Oct 24 08:49:53 localhost com.apple.launchctl.System[2]: launchctl: Please convert the following to launchd: /etc/mach_init.d/chum.plist | |
Oct 24 08:49:53 localhost com.apple.launchctl.System[2]: launchctl: Please convert the following to launchd: /etc/mach_init.d/dashboardadvisoryd.plist | |
Oct 24 08:49:53 localhost com.apple.launchctl.System[2]: launchctl: Please convert the following to launchd: /etc/mach_init.d/pilotfish.plist | |
Oct 24 08:49:53 localhost com.apple.launchd[1] (com.apple.distccdConfigd): Unknown key: SHAuthorizationRight | |
Oct 24 08:49:53 localhost com.apple.launchd[1] (org.cups.cupsd): Unknown key: SHAuthorizationRight | |
Oct 24 08:49:53 localhost com.apple.launchd[1] (org.ntp.ntpd): Unknown key: SHAuthorizationRight | |
Oct 24 08:49:53 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# resplayer - Ruby Resumable Player | |
# Copyright (c) Tom Morris 2008. | |
# General Public License - http://www.gnu.org/copyleft/gpl.html | |
require 'rubygems' | |
require 'digest/sha1' | |
require 'yaml' | |
require 'mp3info' | |
def construct_time(str) | |
nums = str.scan(/(\d+)/) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'ping' | |
fe_rules = Array.new | |
fe_rules << Proc.new do | |
`wlanconfig ath0 list ap`.split("\n")[1..-1].map {|i| i.split}.each {|net| | |
if net[1] == "00:1c:10:87:57:eb" | |
true | |
elsif net[0] == "GRANGE" | |
[true, "Kensington Square, London"] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import sys | |
from BeautifulSoup import BeautifulSoup, Tag | |
css = "" | |
doc_file = open(sys.argv[1]) | |
doc_string = '\n'.join(doc_file.readlines()) | |
doc = BeautifulSoup(doc_string) | |
for i in doc.findAll("style"): | |
css = css + str("".join(i.contents)) + "\n" | |
i.extract() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* JeniT's RDFa jQuery sample code */ | |
rdf = $('#content p:first').rdf(); | |
rdf | |
.where('?book dc:creator ?author') | |
.where('?author foaf:surname ?surname') | |
.filter('surname', /^A/) | |
.where('?book dc:titiel ?title') | |
.optional('?book dc:identifier ?isbn') | |
.each(function() { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
puts "it's a wednesday or a thursday between 10am and 11pm" if [3,4].member?(Time.now.wday) && (10..22).member?(Time.now.hour) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'rexml/document' | |
# Get command line params | |
filename = ARGV[0] | |
username = `whoami`.strip | |
filename = "/Users/" + username + "/Library/Application\ Support/Cultured\ Code/Things/Database.xml" | |
unless ARGV[1].nil? | |
qry = ARGV[1].strip | |
else | |
qry = nil |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env ruby | |
require 'rubygems' | |
require 'xml' | |
class Tasks | |
end | |
class Things | |
def initialize(filename = "/Users/" + `whoami`.strip + "/Library/Application\ Support/Cultured\ Code/Things/Database.xml") | |
@doc = LibXML::XML::Document.file filename if File.exists? filename |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env ruby | |
# Linux (ALSA) command line alarm clock | |
# written in Ruby, but you can use any language you like. | |
# store original volume and set volume to 100% | |
original_volume = `amixer get Master | grep 'Front Left' | cut -d ' ' -f 6`.chop.to_i | |
`amixer set Master front 65536` | |
# I'm using 'Alarm Clock 2' from http://www.pacdv.com/sounds/domestic_sounds.html |