Skip to content

Instantly share code, notes, and snippets.

View wjlroe's full-sized avatar
📷

William Roe wjlroe

📷
View GitHub Profile
(setq android-mode-sdk-dir "~/android-sdk-mac_86/")
(require 'android-mode)
(require 'java-mode-indent-annotations)
(setq java-mode-hook
(function (lambda()
(java-mode-indent-annotations-setup))))
@wjlroe
wjlroe / cicada.hs
Created August 1, 2011 08:39
Solution to the Cicada problem
module Cicada where
import Data.List (union, intersect)
broodA = [4,8..]
broodB = [6,12..]
broodC = [7,14..]
currentBroods = broodA `union` broodB `union` broodC
@wjlroe
wjlroe / app.clj
Created August 2, 2011 17:44
failing compile with leiningen
(ns riaktest.app
(:import
[com.basho.riak.client RiakFactory]))
(def client (RiakFactory/pbcClient))
(defn -main []
(println "woot"))
@wjlroe
wjlroe / init.clj
Created August 5, 2011 09:39
SSL options for Leiningen
(defn set-ssl
[task & args]
(do
(System/setProperty "javax.net.ssl.trustStoreProvider" "Apple")
(System/setProperty "javax.net.ssl.trustStoreType" "KeychainStore")
(System/setProperty "javax.net.debug" "all")))
(def settings {:hooks [set-ssl]})
@wjlroe
wjlroe / get-cert.sh
Created August 18, 2011 09:15
Fetch an SSL cert from a host and port
#!/bin/sh
#
# usage: retrieve-cert.sh remote.host.name [port]
#
REMHOST=$1
REMPORT=${2:-443}
echo |\
openssl s_client -connect ${REMHOST}:${REMPORT} 2>&1 |\
sed -ne '/-BEGIN CERTIFICATE-/,/-END CERTIFICATE-/p'
@wjlroe
wjlroe / haskell-pkg-conf-to-register-script.py
Created August 26, 2011 12:48 — forked from anonymous/haskell-pkg-conf-to-register-script.py
Script to take the output of the package.sh script in haskell-platform and generate a single register.sh script for fpm
#!/usr/bin/python
## -*- mode: python; python-indent: 4; -*-
import glob
import os.path
if __name__ == '__main__':
with open('unregister.sh', 'w') as unreg:
with open('register.sh','w') as reg:
[fd.write("#!/bin/sh\n") for fd in reg,unreg]
@wjlroe
wjlroe / gist:1180697
Created August 30, 2011 11:27
error!
src/tyrion.hs:23:29:
No instances for (Read (IO String), Num (IO String))
arising from a use of `get'
Possible fix:
add instance declarations for (Read (IO String), Num (IO String))
In the second argument of `($)', namely `get cp "" "password"'
In a stmt of a 'do' expression:
password <- forceEither $ get cp "" "password"
In the expression:
do { config <- readfile emptyCP fileLoc;
@wjlroe
wjlroe / Procfile
Created September 22, 2011 14:10
test nothing project for no reason
something: top
another: tail -f /var/log/syslog
@wjlroe
wjlroe / Makefile
Created September 23, 2011 12:42 — forked from stevemohapibanks/minecraft.erl
WIP Minecraft client
ERLC=/usr/local/bin/erlc
ERLCFLAGS=-o
SRCDIR=.
BEAMDIR=./ebin
compile:
$(ERLC) $(ERLCFLAGS) $(BEAMDIR) $(SRCDIR)/*.erl ;
run: compile
erl -pa ./ebin/ -boot start_sasl -s minecraft_server
@wjlroe
wjlroe / gist:1451168
Created December 9, 2011 11:24
collectd 5.0.0 brew fails
==> Downloading http://collectd.org/files/collectd-5.0.0.tar.bz2
File already downloaded in /Users/will/Library/Caches/Homebrew
/usr/bin/tar xf /Users/will/Library/Caches/Homebrew/collectd-5.0.0.tar.bz2
==> ./configure --disable-debug --disable-dependency-tracking --with-python=/usr/bin --prefix=/usr/local/Cellar/collectd/5.0.0 --localstatedir=/usr/local/var
./configure --disable-debug --disable-dependency-tracking --with-python=/usr/bin --prefix=/usr/local/Cellar/collectd/5.0.0 --localstatedir=/usr/local/var
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for gawk... no
checking for mawk... no
checking for nawk... no