Skip to content

Instantly share code, notes, and snippets.

View ChristopherMacGown's full-sized avatar

Christopher MacGown ChristopherMacGown

View GitHub Profile
class Fun; end
class UnFun
def initialize(*args)
funs = []
ObjectSpace.each_object(Fun) { |fun| funs << fun }
funs[rand(funs.length)].destroy
end
end
map <C-e>r :set filetype=ruby<CR>
au Filetype ruby imap <C-c>c <Esc>b~i<C-o>diwclass <C-r>"<CR><CR>end<Esc><up>i
au Filetype ruby imap <C-c>m <Esc>b~i<C-o>diwmodule <C-r>"<CR><CR>end<Esc><up>i
au Filetype ruby imap <C-c>d <C-o>diw<C-i>def <C-r>"( <Esc>ma<Esc>i)<CR><CR>end<Esc>`ai
au Filetype ruby imap <C-c>i <Esc>$a if
au Filetype ruby imap <C-c>u <Esc>$a unless
au Filetype ruby imap <C-c>b <Esc>$a { \| <Esc>ma<Esc>i\| }<Esc>`ai
au Filetype ruby imap <C-c>if if <Esc>ma<Esc>i<CR><CR><Esc>Diend<Esc>`aa
public abstract class AbstractJMClassFactory
{
public abstract AbstractJMClass CreateHappyJM();
public abstract AbstractJMClass CreateAngryJM();
public abstract AbstractJMClass CreateHungryJM();
}
public class ConcreteJMClassFactory: AbstractJMClassFactory {
public override AbstractJMClass CreateHappyJM()
{
require 'formula'
<<-COMMENTS
This is the Homebrew formula for Python.
Versions
--------
This formula is currently tracking version 2.6.x.
require 'formula'
class Virtualenvwrapper <Formula
url 'http://www.doughellmann.com/downloads/virtualenvwrapper-2.1.1.tar.gz'
homepage 'http://www.doughellmann.com/projects/virtualenvwrapper/'
md5 '1c6543b1dc69574aa8fe973b07f3ec16'
def install
libexec.install ['virtualenvwrapper.sh', 'virtualenvwrapper']
# HACK: Make the wrapper exectuable, so `which` can find it.
Index: numpy/distutils/fcompiler/gnu.py
===================================================================
--- numpy/distutils/fcompiler/gnu.py (revision 8716)
+++ numpy/distutils/fcompiler/gnu.py (working copy)
@@ -254,7 +254,7 @@
if not sys.platform == 'darwin':
return []
arch_flags = []
- for arch in ["ppc", "i686", "x86_64", "ppc64"]:
+ for arch in ["ppc", "i686", "x86_64"]:
chris@christopher-macgowns-macbook-pro:~ $ ls -alh ~/Music/iTunes/iTunes\ Music/Iio/Rapture/Rapture\ \(Armin\ van\ Buuren\ Remix\).mp3
-rw-r--r-- 1 chris staff 12M Feb 1 2010 /Users/chris/Music/iTunes/iTunes Music/Iio/Rapture/Rapture (Armin van Buuren Remix).mp3
>> audio_file = "/Users/chris/Music/iTunes/iTunes Music/Iio/Rapture/Rapture (Armin van Buuren Remix).mp3"
>> (bytes = IO.read(audio_file).unpack("s*")) and nil
>> puts bytes.length
>> t = Time.now().utc
>> puts bytes.each_slice(2).to_a.transpose.length
>> puts Time.now().utc - t
4.148601
function git_rev_head
{
rev_prompt_token=" » "
rev=1
sym=0
declare -a colors
declare -a branches
branches[$rev]=$(git name-rev --name-only head 2> /dev/null)
branches[$sym]=$(git symbolic-ref -q head 2> /dev/null)
>>> from novaclient.v1_1 import client
>>> nova = client.Client("admin", "secrete", "admin", "http://dev2.rcb.me:5000/v2.0/")
>>> nova.servers
<novaclient.v1_1.servers.ServerManager object at 0x1007c41d0>
>>> nova.servers.list()
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "novaclient/v1_1/servers.py", line 222, in list
return self._list("/servers%s%s" % (detail, query_string), "servers")
File "novaclient/v1_1/base.py", line 65, in _list
How to determine if paying geek squad to destroy your computer is better than destroying your computer yourself:
3h(E + L) + P < dG?
h = hourly rate
E = number of hours it will take to learn how to destroy your computer.
L = number of hours it will take to destroy your computer.
P = Cost of the parts it will take to destroy your computer.
dG = Price GeekSquad charges to destroy your computer.