Skip to content

Instantly share code, notes, and snippets.

(require 'clojure.main)
(defn file-repl [filename]
(let [log (java.io.FileWriter. filename)
logout (fn [#^java.io.Writer out]
(proxy [java.io.Writer] []
(write
([x]
(.write log x)
(.write out x))
(use '(incanter core processing))
;; simple interactive Processing example taken from processingjs.org website:
;; http://processingjs.org/source/basic-example/processingjs_basic-example.html
;; set up variable references to use in the sketch object
(let [radius (ref 50.0)
X (ref nil)
Y (ref nil)
(require 'moz)
;;; Usage
;; Run M-x moz-reload-mode to switch moz-reload on/off in the
;; current buffer.
;; When active, every change in the buffer triggers Firefox
;; to reload its current page.
(define-minor-mode moz-reload-mode
"Moz Reload Minor Mode"
#!/bin/bash
PASTEL='{
"Ansi 0 Color" = {
"Blue Component" = 0.3097887;
"Green Component" = 0.3097887;
"Red Component" = 0.3097887;
};
"Ansi 1 Color" = {
"Blue Component" = 0.3764706;
@kurtharriger
kurtharriger / mavenize-cq5-dependencies
Created April 9, 2011 19:27
This script will download all crxde classpath dependencies and install them in your local maven repository
#! /bin/bash
set -e
trap "exit 1;" INT TERM EXIT
# exec > >(tee $0.log)
# exec 2>&1
[ -z "$CRX_URL" ] && CRX_URL=http://localhost:4502
[ -z "$CRX_CREDENTIALS" ] && CRX_CREDENTIALS=admin:admin
@kurtharriger
kurtharriger / pom.xml
Created June 7, 2011 18:08
gmaven-runtime-1.8 pom file
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>gmaven-example</groupId>
<artifactId>gmaven-example</artifactId>
<version>1.0</version>
@kurtharriger
kurtharriger / pom.xml
Created June 24, 2011 14:53
Spock OSGI Wrapper
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.twcable.atg</groupId>
<artifactId>spock-core</artifactId>
<version>1.0-SNAPSHOT</version>
<name>Spock bundle</name>
<description>Bundled version of Spock Framework</description>
<packaging>bundle</packaging>
@kurtharriger
kurtharriger / base64.js
Created October 24, 2011 21:29 — forked from stubbetje/base64.js
Base64 encode and decode in javascript
var Base64 = {
characters: "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=" ,
encode: function( string )
{
var characters = Base64.characters;
var result = '';
var i = 0;
do {
@kurtharriger
kurtharriger / .tmux.conf
Created January 23, 2012 22:34
My TMUX configuration file -- krainboltgreene
###############################################################################
#
# Prefix is set to ` (backtick).
# Doubling the prefix switches to last window.
#
#######################################
#
# Key bindings
# ============
# Tab down-pane
@kurtharriger
kurtharriger / pom2proj.clj
Created March 28, 2012 17:15 — forked from thickey/pom2proj.clj
Convert Maven pom.xml file to Lein project.clj
(ns pom2proj
(:require [clojure.xml :as xml]
[clojure.zip :as zip]
[clojure.java.io :as io]
[clojure.data.zip.xml :as zx])
(:use [clojure.pprint :only [pprint]]))
(defn- text-attrs
[loc ks]
(map (fn [k]