Skip to content

Instantly share code, notes, and snippets.

View xwmx's full-sized avatar

William Melody xwmx

View GitHub Profile
# http://daringfireball.net/2010/07/improved_regex_for_matching_urls
(?i)\b((?:https?://|www\d{0,3}[.]|[a-z0-9.\-]+[.][a-z]{2,4}/)(?:[^\s()<>]+|\(([^\s()<>]+|(\([^\s()<>]+\)))*\))+(?:\(([^\s()<>]+|(\([^\s()<>]+\)))*\)|[^\s`!()\[\]{};:'".,<>?«»“”‘’]))
defaults: &defaults
adapter: postgresql
encoding: utf8
username: username
password: password
host: localhost
pool: 10
development:
database: application_name_development
Norman Schur's 1000 Most Important Words
This is Norman Schur's list of the 1,000 "most important" words. There are actually 1,019 here because of those that are similarly spelled, opposites of one another, etc. I've gone through and marked with asterisks the ones (*) that I'm somewhat uncomfortable with (177 of these), as in I'd be slightly apprehensive if you challenged me to pinpoint their meaning, and the ones (**) that I'm basically clueless about (26 of these). I feel roughly fluent with the rest.
abashed
*abate
abdicate
aberrant
abominate
abrasive
abrogate
#!/usr/bin/env python
# Name generating code
# Copyright (c) 2010 Ninite.com
#
# Released into the public domain - enjoy!
#
# Story at http://blog.ninite.com/post/620277259/how-ninite-was-named-by-a-computer-program
from datetime import datetime, date
require 'open3'
class RbST
@@executable_path = File.expand_path(File.join(File.dirname(__FILE__), "rst2parts"))
@@executables = {
:html => File.join(@@executable_path, "rst2html.py"),
:latex => File.join(@@executable_path, "rst2latex.py")
}
require 'rubygems'
require 'nokogiri'
include Nokogiri
class PostCallbacks < XML::SAX::Document
def start_element(element, attributes)
puts "start element: #{element}"
puts "attributes: #{attributes.inspect}"
end
@xwmx
xwmx / loc.rb
Created January 17, 2010 04:53
# Library of Congress Main Classes and Subclasses
{
"A" => {
:name => "General Works",
:subclasses => {
"AC" => "Collections; Series; Collected works",
"AE" => "Encyclopedias",
"AG" => "Dictionaries and other general reference works",
"AI" => "Indexes",
"AM" => "Museums. Collectors and collecting",
# http://www.loc.gov/standards/iso639-2/ascii_8bits.html
ISO_639_2 = [
["aar", "", "aa", "Afar", "afar"],
["abk", "", "ab", "Abkhazian", "abkhaze"],
["ace", "", "", "Achinese", "aceh"],
["ach", "", "", "Acoli", "acoli"],
["ada", "", "", "Adangme", "adangme"],
["ady", "", "", "Adyghe; Adygei", "adyghé"],
["afa", "", "", "Afro-Asiatic languages", "afro-asiatiques, langues"],
#!/usr/bin/env ruby
# -*- ruby -*-
require 'rubygems'
require 'daemon-spawn'
RAILS_ROOT = File.expand_path(File.join(File.dirname(__FILE__), '..'))
class DelayedJobWorker < DaemonSpawn::Base
def start(args)
ENV['RAILS_ENV'] ||= args.first || 'development'
# smoother space switching animations for snow leopard
$ sudo defaults write /Library/Preferences/com.apple.windowserver Compositor -dict deferredUpdates 0