Skip to content

Instantly share code, notes, and snippets.

View djhaskin987's full-sized avatar

Daniel Jay Haskin djhaskin987

View GitHub Profile
;; Big thanks to Christophe Grand - https://groups.google.com/d/msg/clojure/L1GiqSyQVVg/m-WJogaqU8sJ
(defn scaffold [iface]
(doseq [[iface methods] (->> iface .getMethods
(map #(vector (.getName (.getDeclaringClass %))
(symbol (.getName %))
(count (.getParameterTypes %))))
(group-by first))]
(println (str " " iface))
(doseq [[_ name argcount] methods]
(println
@djhaskin987
djhaskin987 / fpm_jar.sh
Last active August 29, 2015 14:02 — forked from anonymous/gist:5c7c5134ec049b277615
Create an #FPM jar using #JRuby and #Warbler
#!/bin/sh
# Main idea largely taken from http://stackoverflow.com/a/8410010/850326
prefix="${HOME}/Software" # Another viable option: /opt/
wget http://jruby.org.s3.amazonaws.com/downloads/1.7.12/jruby-bin-1.7.12.zip
unzip jruby-bin-1.7.12.zip
mkdir -p "${prefix}"
mv jruby-1.7.12 "${prefix}"
export PATH="${PATH}:${prefix}/jruby-1.17.12"
Tricks to add encrypted private SSH key to .travis.yml file
To encrypt the private SSH key into the "-secure: xxxxx....." lines to place in the .travis.yml file, generate a deploy key then run: (to see what the encrypted data looks like, see an example here: https://github.com/veewee-community/veewee-push/blob/486102e6f508214b04414074c921475e5943f682/.travis.yml#L21
base64 --wrap=0 ~/.ssh/id_rsa > ~/.ssh/id_rsa_base64
ENCRYPTION_FILTER="echo \$(echo \"-\")\$(travis encrypt veewee-community/veewee-push \"\$FILE='\`cat $FILE\`'\" | grep secure:)"
split --bytes=100 --numeric-suffixes --suffix-length=2 --filter="$ENCRYPTION_FILTER" ~/.ssh/id_rsa_base64 id_rsa_
@djhaskin987
djhaskin987 / Masterless RPM or DEB Puppet Module Files List
Last active December 21, 2015 11:58 — forked from jordansissel/site.pp
A suggested layout for an RPM or a DEB package which installs a masterless puppet module named 'foo'.
/usr/share/puppet/modules/foo
/usr/share/puppet/modules/foo/manifests
/usr/share/puppet/modules/foo/manifests/init.pp
/usr/share/puppet/modules/foo/files
/usr/share/puppet/modules/foo/files/hello
/usr/share/puppet/masterless/foo.pp