Skip to content

Instantly share code, notes, and snippets.

View dsturnbull's full-sized avatar

David Turnbull dsturnbull

View GitHub Profile
potential_tag = ARGV[0]
if potential_tag =~ /^refs\/tags\/(.*)$/
tag = $1
tag_data = `git describe --tags #{tag}^`.strip
tag_data =~ /(.*?)-([0-9]+)-([0-9a-g]{8,8})$/
old_tag = $1
commit_count = $2
g_plus_hash = $3
log = `git log --pretty=format:"<%s> by %an, committed by %cn on %ci (%h)" #{tag}~#{commit_count}^..#{tag}`
support_development=# EXPLAIN ANALYZE SELECT * FROM "slugs" WHERE ("slugs".sluggable_id = NULL AND "slugs".sluggable_type = 'BlogCategory' AND ("slugs"."scope" IS NULL AND "slugs"."name" = 'thing11242705956')) ORDER BY id DESC;
QUERY PLAN
----------------------------------------------------------------------------------------------------------------------------------------------------------
Sort (cost=8.29..8.29 rows=1 width=149) (actual time=0.016..0.016 rows=0 loops=1)
Sort Key: id
Sort Method: quicksort Memory: 17kB
-> Result (cost=0.00..8.28 rows=1 width=149) (actual time=0.001..0.001 rows=0 loops=1)
One-Time Filter: NULL::boolean
-> Index Scan using index_slugs_on_name_and_sluggable_type_and_scope_and_sequence on slugs (cost=0.00..8.28 rows=1 width=149) (never executed)
Index Cond: (((name)::text = 'thing112427059
sha: mining herb
| |
| |
| |
war: inscription | alchemy
| | |
| | |
| | |
rog: ench jc |
| |
_| _|
_|_|_|_| _|_|_| _|_|
_| _| _| _|_|_|_|
_| _| _| _|
_|_| _| _| _|_|_|
_|_| _| _| _|
! .vimrc|
+-- 4 lines: colours--------------------------------------------------------
+-- 25 lines: options--------------------------------------------------------
+-- 3 lines: use c-a in command mode----------------------------------------
+-- 3 lines: git blame - \a on a visual block-------------------------------
+-- 3 lines: sudo writes----------------------------------------------------
+-- 5 lines: ?--------------------------------------------------------------
+-- 6 lines: move windows easily--------------------------------------------
+-- 4 lines: taglist bindings-----------------------------------------------
+-- 10 lines: slide text around----------------------------------------------
mul (i:is) (j:js)
| j > i = mul (i:is) js
| otherwise = (i * j) : mul (i:is) js
mul (i:is) [] = mul is (i:is)
mul [] _ = []
network
-------
shed ____. [darkstar] ._____ # gateway, debian i386
/____. [fleet] | # file server, opensolaris
switch*_____. [vmonster] | # vm server, debian amd64
| |
| [ADSL2+ TPG]
|
switch*_____. [coretoy] # mac mini
THREADS = []
class Fixnum ## add seconds/minutes/hours/days to integers
def seconds
self
end
alias_method :second, :seconds
def minutes
require 'rubygems'
require 'nokogiri'
require 'open-uri'
url = "http://sydney.craigslist.com.au/"
doc = Nokogiri::HTML(open(url))
threads = []
doc.search('.cats li a').each do |cat|
threads << Thread.new do
import System.IO.UTF8
import System.Posix.Env
import XMonad
import XMonad.Actions.FindEmptyWorkspace
import XMonad.Hooks.DynamicLog
import XMonad.Hooks.ManageDocks
import XMonad.Layout.LayoutHints
import XMonad.Layout.Maximize
import XMonad.Layout.NoBorders
import XMonad.Layout.ResizableTile