Skip to content

Instantly share code, notes, and snippets.

@cwoodcox
cwoodcox / uninstall_homebrew.sh
Created September 15, 2011 05:26 — forked from mxcl/uninstall_homebrew.sh
Uninstall Homebrew
#!/bin/sh
# Just copy and paste the lines below
# MAKE SURE YOU ARE HAPPY WITH WHAT IT DOES FIRST! THERE IS NO WARRANTY!
cd `brew --prefix`
git ls-files -z | pbcopy
rm -rf Cellar
bin/brew prune
pbpaste | xargs -0 rm
rm -r Library/Homebrew Library/Aliases Library/Formula Library/Contributions
chuck@chuck:~/Sites/fastfill → ruby-1.9.2-p290@fastfill → master $ brew install memcached
==> Installing memcached dependency: libevent
==> Downloading http://monkey.org/~provos/libevent-2.0.12-stable.tar.gz
######################################################################## 100.0%
==> ./configure --prefix=/usr/local/Cellar/libevent/2.0.12
==> make install
/usr/local/Cellar/libevent/2.0.12: 47 files, 1.9M, built in 37 seconds
==> Installing memcached
==> Downloading http://memcached.googlecode.com/files/memcached-1.4.6.tar.gz
######################################################################## 100.0%
SELECT
T.DateOpenedUTC
,C.DataContent
,T.subject
FROM st_Tickets T
LEFT JOIN st_CustomDataFieldsInTickets C
ON (T.TicketID = C.TicketID)
LEFT JOIN (
SELECT <fourth column here>, Tin.TicketID
@cwoodcox
cwoodcox / download_all.rb
Created August 19, 2011 08:44
Download'em
#! /usr/bin/ruby
# This little guy will download and save all the URLs it can find from the file it retrieves from a
# given URL. Works awesomely for Apache index pages of lots of image files. Like http://bukk.it
@cwoodcox
cwoodcox / arr_hash_total.rb
Created August 11, 2011 19:40
Array of Hashes Totaling
array = [{:stat1 => 34, :stat2 => 37}, {:stat1 => 45, :stat2 => 78}]
total = {}
array.each do |element|
element.each do |key, val|
total[key] ||= 0
total[key] += val
end
end