Skip to content

Instantly share code, notes, and snippets.

fogus / emagic.clj
Created Jan 7, 2011
how to make your own forms indent properly in emacs with clojure-mode
View emagic.clj
(defn pumpkin [op & args]
(apply op args))
(pumpkin +
;; in emacs do:
;; M-x eval-expression
View callbacksarehard.js
// before"File", function(err, file) {
if(err) throw err;
file.openMenu(function(err, menu) {
if(err) throw err;
menu.item("Open", function(err, item) {
if(err) throw err; {
if(err) throw err;
mainWindow.getChild(type('Window'), function(err, dialog) {
pepijndevos / test.clj
Created Apr 21, 2011
Alternative implementation of clojure.core/seque
View test.clj
(ns test
(:import [java.util.concurrent
(:use clojure.test)
(:refer-clojure :exclude [seque]))
hugoduncan / gist:1033762
Created Jun 19, 2011
Use aether for artifact resolving
View gist:1033762
(ns pallet.aether
"Wrapper for aether resolution
[ :as io]
[clojure.contrib.logging :as logging])
stuartsierra / gist:1188879
Created Sep 2, 2011
XML parsing and
View gist:1188879
;;; XML parsing and
;;; There's got to be a cleaner way to do this.
;;; I have code like this:
(defn jdks-loc [xml-zipper]
(filter #(let [n (zip/node %)]
View gist:1209498
(ns trace
(:use clojure.pprint))
(declare trace-form)
(def *ignore*
'#{def quote var try monitor-enter monitor-exit})
(defmulti trace-special-form (fn [form] (first form)))
nathanmarz / gist:1228302
Created Sep 20, 2011
Example of defining a topology in Clojure
View gist:1228302
(use 'backtype.storm.clojure)
(use 'backtype.storm.config)
(require '[backtype.storm [thrift :as thrift]])
(import 'storm.starter.spout.RandomSentenceSpout)
(import 'backtype.storm.LocalCluster)
(defboltfull suffix-bolt ["word"]
:params [suffix]
:let [conf-state (atom nil)]
:prepare ([conf context collector]
View iuny.lisp
;;; -*- Package: User; Syntax: Common-Lisp; Mode: Lisp; Base: 10 -*-
;;; unify.lisp
(in-package "USER")
;;; ****************************************************************
;;; Unification Algorithm ******************************************
;;; ****************************************************************
;;; Random implementations of unification.
View select-match.lisp
;; SELECT-MATCH macro (and IN macro)
;; Copyright 1990 Stephen Adams
;; You are free to copy, distribute and make derivative works of this
;; source provided that this copyright notice is displayed near the
;; beginning of the file. No liability is accepted for the
;; correctness or performance of the code. If you modify the code
;; please indicate this fact both at the place of modification and in
cemerick / gist:1452640
Created Dec 9, 2011
dependency-tree for Leiningen
View gist:1452640
;; requires [com.cemerick/pomegranate "0.0.2"]
;; i.e.
(use '[cemerick.pomegranate.aether :only (dependency-hierarchy resolve-dependencies)])
=> (pprint
'[[incanter "1.2.3"]]
(resolve-dependencies {:coordinates '[[incanter "1.2.3"]]
:repositories (merge cemerick.pomegranate.aether/maven-central {"clojars" ""})})))