Skip to content

Instantly share code, notes, and snippets.

View djhaskin987's full-sized avatar

Daniel Jay Haskin djhaskin987

View GitHub Profile
@djhaskin987
djhaskin987 / Testing
Created May 18, 2012 19:18
Gist_Sample.muse
This is a Gist File.
25 years of my life and STILL
@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
@djhaskin987
djhaskin987 / document.tex
Created September 11, 2013 20:55
A sample latex document that can be used as a template for general latex usage.
\documentclass[12pt]{article}
\usepackage{amsmath,amsfonts,amssymb,amsthm}
\usepackage[pdftex]{graphicx}
\setlength{\pdfpagewidth}{8.5in}
\setlength{\pdfpageheight}{11in}
\setlength{\topmargin}{0.0in}
\setlength{\voffset}{0.0in}
\setlength{\headheight}{0.0in}
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 / PFDS_Chapter2.ml
Created December 18, 2013 01:53
Chris Okasaki's "Purely Functional Data Structures", Chapter 2 Excercises
(* Excercise 2.1
* We proceed by induction.
* If 'lst' is an empty list, we simply return lst itself.
* If 'lst' is a non-empty list, we store the pointer to the tail of the list,
* plus any pointers stored by a recursive call to suffixes.
* []
*)
let rec suffixes lst =
match lst with
[] -> lst
@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"
@djhaskin987
djhaskin987 / debian.md
Created August 27, 2014 15:13
debian install scripts explained

Possible first-hack at the debian scripts for install-upgrade-configure: preinst

if [ "${1}" = "install" -a -z "${1}" ]
then
    # "before install" goes here
elif [ "${1}" = "upgrade" -a -n "${2}" ]
then
    upgradeVersion="${2}"
    # "before upgrade" goes here
;; 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 / keybase.md
Created April 15, 2015 15:23
keybase.md

Keybase proof

I hereby claim:

  • I am djhaskin987 on github.
  • I am djhaskin987 (https://keybase.io/djhaskin987) on keybase.
  • I have a public key whose fingerprint is F54C FF73 1E7E 01C3 AE74 9B30 D62D AA3E 080E 17A9

To claim this, I am signing this object: