Skip to content

Instantly share code, notes, and snippets.

View mwotton's full-sized avatar

Mark Wotton mwotton

View GitHub Profile
import qualified Data.ByteString.Char8 as BS
import Data.Ord
import Data.List
import Data.Function
import System
most_anagrams ws = sortBy (flip $ comparing length) $ groupBy (\a b -> fst a == fst b) $ sortBy (comparing fst) $ zip (map BS.sort ws) ws
main = do (arg:_) <- getArgs
d <- BS.readFile arg
# Newbie Programmer
def factorial(x)
if x == 0
return 1
else
return x * factorial(x - 1)
end
end
puts factorial(6)
puts factorial(0)
Cocoa hacker needed
Who are we?
- small team, kicking arse
- good relationship with apple
- flexible but demanding
- 4 days a week, up to 2 days wfh ok
Who are you?
Cocoa hacker needed
We...
- are a small team (3 devs, 1 business guy, 1 jack-of-all-trades), kicking arse
- have a good relationship with Apple
- use git for source control, ghunit for testing, and hudson for continuous integration
- are flexible but demanding
- 4 days a week, up to 2 days wfh is ok
@mwotton
mwotton / gist:709304
Created November 21, 2010 23:51
stubbing new
require 'rspec'
class Bar
def baz
puts "baz called"
end
end
class Foo
def initialize
@mwotton
mwotton / libruby
Created December 28, 2010 02:46
built as x86_64
cc -dynamiclib -undefined suppress -flat_namespace -install_name /Users/mwotton/.rvm/r
ubies/ruby-1.9.1-p378/lib/libruby.dylib -current_version 1.9.1 -compatibility_version
1.9.1 dln.o encoding.o array.o bignum.o class.o compar.o complex.o dir.o enum.o enum
erator.o error.o eval.o load.o proc.o file.o gc.o hash.o inits.o io.o marshal.o math.o
numeric.o object.o pack.o parse.o process.o random.o range.o rational.o re.o regcomp.o regenc.o regerror.o regexec.o regparse.o regsyntax.o ruby.o safe.o signal.o sprintf.
o st.o strftime.o string.o struct.o time.o transcode.o util.o variable.o version.o com
pile.o debug.o iseq.o vm.o vm_dump.o thread.o cont.o ascii.o us_ascii.o unicode.o utf_8.o newline.o prelude.o dmyext.o -o libruby.1.9.1.dylib
w -L 'Init_*' libruby.1.9.1.dylibw: illegal option -- Lusage: w [hi] [user ...]
make: [libruby.1.9.1.dylib] Error 1 (ignored)./miniruby -I./lib -I.ext/common -I./- -r./ext/purelib.rb ./tool/generic_erb.rb -c -o encdb.h ./template/encdb.h.tmpl ./enc enc
encdb.h updatedmak
newRepo2 name = do
req <- parseUrl "https://github.com/api/v2/json/repos/create"
encoded <- urlEncodedBody ["name", name]
res <- withManager $ httpsLbs $ encoded { method = POST }
def guarded(task)
%x{#{task}}.tap { raise "bad exit" if $?.exitstatus!=0 }
rescue => e
yield e if block_given?
end
guarded("git config --global github.token") do |error|
abort "please add your token to ~/.gitconfig with git config --global github.token MYTOKEN"
end
@mwotton
mwotton / gist:945658
Created April 28, 2011 02:09
cabal failing to find headers
➜ HFuse-0.2.3 ls -l /usr/local/include/fuse.h
-rw-r--r-- 1 root wheel 246 20 Dec 2008 /usr/local/include/fuse.h
➜ HFuse-0.2.3 cabal configure
Resolving dependencies...
Configuring HFuse-0.2.3...
cabal: Missing dependency on a foreign library:
* Missing header file: fuse.h
This problem can usually be solved by installing the system package that
provides this library (you may need the "-dev" version). If the library is
already installed but in a non-standard location then you can use the flags
@mwotton
mwotton / gist:962089
Created May 9, 2011 05:14
blog apache conf
<VirtualHost *:80>
ServerName www.shimweasel.com
DocumentRoot /u/apps/www.shimweasel.com/public
<Directory /u/apps/www.shimweasel.com/public>
Allow from all
Options -MultiViews
</Directory>
</VirtualHost>