Skip to content

Instantly share code, notes, and snippets.

View hiredman's full-sized avatar

Kevin Downey hiredman

View GitHub Profile
<?php
function dd(&$x){
print "<dd>".$x."</dd>";
}
function next_button(){
print "<dd class=\"next\"><input class=\"next\" value=\"Next\" type=\"submit\" /></dd>";
}
wlans_ath0="wlan0"
ifconfig_wlan0="WPA DHCP"
(declare *fails* *succeeds* *exits*)
(def *horizon* nil)
(defmacro when-hrz [which & forms]
`(do
(when (not *horizon*) (throw (RuntimeException. "Naked Singularity")))
(swap!
~(condp = which :fails '*fails* :succeeds '*succeeds* :exits '*exits*)
conj (fn [] ~@forms))))
rc(){
find /etc/rc.d/"$1" /usr/local/etc/rc.d/"$1" -exec sudo {} `echo "$*"|cut -f 2- -d \ ` \;
}
(ns hiredman.xmpp
(:import (org.jivesoftware.smack XMPPConnection ConnectionConfiguration
RosterListener PrivacyListManager
PacketListener)
(org.jivesoftware.smack.packet IQ IQ$Type Presence Presence$Type)
(org.jivesoftware.smack.filter PacketFilter)
(org.jivesoftware.smackx.packet VCard)
(org.jivesoftware.smackx.filetransfer FileTransferManager)
(java.io File)))
(ns hiredman.alfred
(:gen-class)
(:use hiredman.xmpp)
(:import java.text.SimpleDateFormat))
(def me (ref {:xmpp (agent (connect "drone1@thelastcitadel.com" "xxxxxxx"))}))
(defn listfiles []
(map #(apply str (drop 26 %))
(map str (.listFiles (java.io.File. "/home/hiredman/tmp/alfred")))))
## CLASSPATH
refresh-classpath(){
echo "buidling ~/.jars/classpath"
CLASSPATH=`find ~/.jars/ -type f -name \*.jar -print0|xargs -0|sed "s/ /:/g"`
echo "CLASSPATH=${CLASSPATH}" > ~/.jars/classpath
}
if [ -f ~/.jars/classpath ]; then
source ~/.jars/classpath
else
if [ -d ~/.jars/ ]; then
$y[0]=new Symbol("x");
$y[1]=new Symbol("y");
FFunction::create(new Symbol("+"), new AArray($y), 'return $x+$y;');
$x=RT::read_one("(+ 1 3)");
print FFunction::call($x->first(),$x->rest());
wlan0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> metric 0 mtu 1500
ether 00:1d:7d:78:2a:69
inet6 fe80::21d:7dff:fe78:2a69%wlan0 prefixlen 64 scopeid 0x4
inet 192.168.0.197 netmask 0xffffff00 broadcast 192.168.0.255
media: IEEE 802.11 Wireless Ethernet OFDM/48Mbps mode 11g
status: associated
(defn lines [file]
(with-open [file (-> file File. FileReader.)
csv (CsvListReader. file (CsvPreference/EXCEL_PREFERENCE))]
(concat (sort-by uperson (f (sort-by rank (map #(map latex-escape (into [] %)) (take-while #(> (count %) 0) (rest (map #(%) (cycle [#(.read csv)])))))))) six-dummy-entries)))