Skip to content

Instantly share code, notes, and snippets.

View gar3thjon3s's full-sized avatar

Gareth Jones gar3thjon3s

  • LONE-WOLF-ENTERPRISES
  • London
View GitHub Profile
#!/usr/bin/env jruby
#-*-ruby-*-
# A script to run ctags on all .rb files in a project. Can be run on
# the current dir, called from a git callback, or install itself as a
# git post-merge and post-commit callback.
CTAGS = '/usr/local/bin/ctags'
HOOKS = %w{ post-merge post-commit post-checkout }
HOOKS_DIR = '.git/hooks'
(ns clojure-scratch.gettysburg
(:require [clojure.contrib.lazy-seqs :as ls]
[clojure.contrib.combinatorics :as comb]))
;; level-one
(def level-one "FourscoreandsevenyearsagoourfaathersbroughtforthonthiscontainentanewnationconceivedinzLibertyanddedicatedtothepropositionthatallmenarecreatedequalNowweareengagedinagreahtcivilwartestingwhetherthatnaptionoranynartionsoconceivedandsodedicatedcanlongendureWeareqmetonagreatbattlefiemldoftzhatwarWehavecometodedicpateaportionofthatfieldasafinalrestingplaceforthosewhoheregavetheirlivesthatthatnationmightliveItisaltogetherfangandproperthatweshoulddothisButinalargersensewecannotdedicatewecannotconsecratewecannothallowthisgroundThebravelmenlivinganddeadwhostruggledherehaveconsecrateditfaraboveourpoorponwertoaddordetractTgheworldadswfilllittlenotlenorlongrememberwhatwesayherebutitcanneverforgetwhattheydidhereItisforusthelivingrathertobededicatedheretotheulnfinishedworkwhichtheywhofoughtherehavethusfarsonoblyadvancedItisratherforustobeherededicatedtothegreattd
@gar3thjon3s
gar3thjon3s / littleschemer.clj
Created September 24, 2011 21:06
Little schemer in clojure
(defn atom? [x]
(not (list? x)))
(def car first)
(def cdr next)
(def add1 inc)
(def sub1 dec)
(defn lat? [lst]
(every? atom? lst))
@gar3thjon3s
gar3thjon3s / reindex synology music
Created March 1, 2014 21:19
A script to scan through mp3s on my synology ds410 NAS and add any missing stuff to the index. Amazing it doesn't do this by default O_O
#!/usr/bin/env python
import sys
import os
import os.path
import time
import re
from datetime import date, timedelta, datetime
from subprocess import check_output