Skip to content

Instantly share code, notes, and snippets.

@rlm
rlm / classpath_utils.clj
Created January 12, 2011 03:03
export_files.clj
(ns rlm.classpath-utils
(:require [clojure.contrib [duck-streams :as ds]])
(:use [clojure.contrib java-utils]))
(defn classpath []
(get-system-property "java.class.path"))
(defn add-to-classpath [file-name]
@rlm
rlm / rlm_commands.clj
Created December 19, 2010 18:23
automatic reloading of namespaces
(ns rlm.rlm-commands
(:require [clojure.contrib [duck-streams :as ds]])
(:use [clojure.contrib java-utils]))
(defmacro undef
"removes symbol from the current namespace"
[symbol]
`(ns-unmap *ns* (quote ~symbol)))
(defmacro ns-nuke
(defn unuse [ns]
(doseq [[n v] (ns-refers *ns*)]
(if (= (.. v ns name) ns)
(ns-unmap *ns* n))))
(defn reuse [ns]
(unuse ns)
(remove-ns ns)
(use :reload-all ns))
@michalmarczyk
michalmarczyk / clojure-font-lock-setup.el
Created March 19, 2010 06:02
coloured SLIME REPL for Clojure
;;; all code in this function lifted from the clojure-mode function
;;; from clojure-mode.el
(defun clojure-font-lock-setup ()
(interactive)
(set (make-local-variable 'lisp-indent-function)
'clojure-indent-function)
(set (make-local-variable 'lisp-doc-string-elt-property)
'clojure-doc-string-elt)
(set (make-local-variable 'font-lock-multiline) t)
(defun color-theme-dark-bliss ()
""
(interactive)
(color-theme-install
'(color-theme-dark-bliss
((foreground-color . "#eeeeee")
(background-color . "#001122")
(background-mode . dark)
(cursor-color . "#ccffcc"))
(bold ((t (:bold t))))
@vangberg
vangberg / DWM-ON-OS-X.md
Created February 22, 2010 19:24
dwm on os x [work in progress!]

Installing and configuring dwm on OS X

  1. Install XQuartz (http://xquartz.macosforge.org) which is the development version of the X11.app that ships with OS X, which means it is way more up to date. I have had some weird issues with X11.app v. 2.3-something. XQuartz 2.5.0 fixed that.

  2. Install dwm from Homebrew, brew install dwm. This makes a bunch of necessary tweaks to the DWM configuration.

  3. Add the following script to $PATH, name it dwm-launch and chmod 755:

    cd ~
    

while true

@ghoseb
ghoseb / ns-cheatsheet.clj
Last active November 2, 2025 23:29 — forked from alandipert/ns-cheatsheet.clj
Clojure ns syntax cheat-sheet
;;
;; NS CHEATSHEET
;;
;; * :require makes functions available with a namespace prefix
;; and optionally can refer functions to the current ns.
;;
;; * :import refers Java classes to the current namespace.
;;
;; * :refer-clojure affects availability of built-in (clojure.core)
;; functions.
(ns coverager
(:import (com.thoughtworks.selenium DefaultSelenium)
(org.openqa.selenium.server SeleniumServer)
java.util.Date
(java.io FileWriter)
(java.text SimpleDateFormat))
(:use clojure.contrib.zip-filter.xml)
(:require [clojure.zip :as zip]
[clojure.xml :as xml]))