Skip to content

Instantly share code, notes, and snippets.

View kisom's full-sized avatar

Kyle Isom kisom

View GitHub Profile
@kisom
kisom / gclone.py
Created March 14, 2012 17:24
Expedite cloning github repos.
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# author: Kyle Isom <[email protected]>
# license: ISC / public domain dual-license
"""
Clone github repos.
Usage:
gclone.py [-] [user] repo
@kisom
kisom / hack.sh
Created March 31, 2012 12:03 — forked from erikh/hack.sh
OSX For Hackers
#!/usr/bin/env sh
##
# This is script with usefull tips taken from:
# https://github.com/mathiasbynens/dotfiles/blob/master/.osx
#
# install it:
# curl -sL https://raw.github.com/gist/2108403/hack.sh | sh
#
@kisom
kisom / buildsys.sh
Created April 10, 2012 09:50
OpenBSD build scripts
#!/bin/ksh
ARCH="$(uname -m)"
KERN="$(uname -v)"
KERN="${KERN%\#*}"
echo '[+] building kernel'
echo
cd /usr/src/sys/arch/$ARCH/conf
config $KERN
@kisom
kisom / wordcount.py
Created May 24, 2012 12:35
wordcount
#!/usr/bin/env python
"""
Calculate a number of statistics about a document in English. Includes
the number of words, lexical diversity, and Flesh-Kincaid grade level.
Usage:
wordcount.py <textfile>
"""
@kisom
kisom / update_links.sh
Created May 26, 2012 21:12
port windows shortcuts to *nix
@kisom
kisom / ssh-copy-id.sh
Created May 28, 2012 19:21
copy ssh key to remote host
#!/bin/sh
if [ -z "$1" ]; then
echo "usage: $0 [user@]host [pubkey]"
exit 1;
fi
if [ -z "$2" ]; then
PUBKEY="$(cat ${HOME}/.ssh/id_rsa.pub)"
else
#!/bin/sh
# script to change the sleep mode of an OS X machine
usage () {
echo "supported sleep modes:"
echo " sleep"
echo " safesleep"
echo " hibernate"
echo " secure"
echo " insecure"
@kisom
kisom / clj-deploy.sh
Created June 30, 2012 03:27
Simple deployments for clojure projects.
#!/bin/sh
# simple deploy script for Clojure projects.
# very rough
echo "[+] generating standalone jar."
lein uberjar
target="[email protected]"
jarfile="$(ls -1 *standalone*)"
timestamp=$(date +'%s')
#!/bin/sh
# cd code && find . -type d -maxdepth 1 -exec repo-status '{}' \;
if [ ! -z "$1" ]; then
CWD="$(pwd)"
cd $1
fi
if [ -d .git ]; then
if git status -uno --porcelain | grep "^[[:space:]]M[[:space:]]" >/dev/null ; then
@kisom
kisom / gist:3140167
Created July 19, 2012 01:28
Undefined symbol errors in Lisp

The other day, I got a strange error while writing a macro (actually, deftest from Peter Seibel's Practical Common Lisp. My defmacro looked like this:

(defmacro deftest (name parameters &body body)
  `(defun ,name ,parameters
     (let ((*test-name* ,name))
       ,@body)))

At first glance, it looks fine. So, I defined a few tests with it (check is another macro for reporting test results):