Skip to content

Instantly share code, notes, and snippets.

View technomancy's full-sized avatar

Phil Hagelberg technomancy

View GitHub Profile
(ns org.log
(:use [org.parsimonygroup.cascading]
[org.parsimonygroup.makemain-utils :only [parseArgs]]
[clojure.contrib.java-utils :only [file]])
(:gen-class))
(defn delete-file-recursively [f]
(let [f (file f)]
(when (.isDirectory f)
(doseq [child (.listFiles f)]
phil@enigma ~ $ sudo gem install sinatra
Building native extensions. This could take a while...
Building native extensions. This could take a while...
ERROR: Error installing sinatra:
rack requires thin (>= 0, development)
phil@enigma ~ $ sudo gem install rack thin
ERROR: Error installing rack:
rack requires thin (>= 0, development)
ERROR: Error installing thin:
thin requires rack (>= 1.0.0, runtime)
~ Failed loading ChefServerSlice (412 "Precondition Failed")
~ Parent pid: 3705
~ Compiling routes...
~ Could not find resource model Node
~ Could not find resource model Role
~ Could not find resource model Search
~ Could not find resource model Cookbook
~ Could not find resource model Registration
~ Could not find resource model Registration
~ Could not find resource model Registration
(defn weird [& b]
(println b)
(when (< (first b) 2)
(recur (inc (first b)))))
(weird 1)
;; the first time you run it, b is an argseq as expected: (1)
;; when you recur, b is bound to 2 rather than (2).
(ns string-fn.core
"Serializable functions! Check it out."
(:refer-clojure :exclude [fn]))
(defmacro ^{:doc (str (:doc (meta #'clojure.core/fn))
"\n\n Oh, but it also allows serialization!!!111eleven")}
fn [& sigs]
`(with-meta (clojure.core/fn ~@sigs)
{:type ::serializable-fn
::source (quote ~&form)}))
@technomancy
technomancy / gist:1573752
Created January 7, 2012 04:06
building ocaml/ocsigen on heroku (doesn't work)
#!/bin/sh
# Run this on an empty Heroku app:
# heroku create -s cedar -a my-ocsigen-test
# heroku -a my-ocsigen-test run bash
OCAML_URL=http://caml.inria.fr/pub/distrib/ocaml-3.12/ocaml-3.12.1.tar.gz
curl $OCAML_URL | tar xzf -
cd ocaml-3.12.1
./configure -prefix /app/ocaml -no-curses -no-tk

Random thoughts as I read through it.

comments inline

README

It'd be nice to have a curl https://raw.github.com/technomancy/leiningen/stable/bin/lein > ~/bin/lein in the README instead of a link that goes somewhere... to the script itself? or to a GitHub page for it? I don't know until I click it.

Some systems have wget in lieu of curl, and not everyone has ~/bin

(ns sketchbook.prize
(:require [clojure.set :as set])
(:use [quil.core]))
(declare prize)
(def names ["Chris" "Robin" "Emmett" "Stan" "Jason" "Phil" "Brian"])
(def uneliminated (atom names))
(def eliminated (atom {}))
* lein2
** new repl
- completion
- readline
- nrepl-backed; common tooling
** profiles
- no more plugins
- dev, user
- with-profiles
** aliases
From d59c58ee9bb96e9c691ec3372b3cd5c79bce6f04 Mon Sep 17 00:00:00 2001
From: Phil Hagelberg <technomancy@gmail.com>
Date: Fri, 24 Aug 2012 13:53:06 -0700
Subject: [PATCH] lurker patch
---
lisp/erc/erc.el | 176 ++++++++++++++++++++++++++++++++++++++++++++++++++++++-
1 files changed, 175 insertions(+), 1 deletions(-)
diff --git a/lisp/erc/erc.el b/lisp/erc/erc.el