Skip to content

Instantly share code, notes, and snippets.

(defproject tst "0.1.0-SNAPSHOT"
:description "FIXME: write description"
:url "http://example.com/FIXME"
:license {:name "Eclipse Public License"
:url "http://www.eclipse.org/legal/epl-v10.html"}
:dependencies [[org.clojure/clojure "1.5.1"],
[prxml "1.3.1"]],
:main tst.core/foo)
<?xml version="1.0"?>
<project xmlns:ivy="antlib:org.apache.ivy.ant" default="all">
<target name="all" depends="clean,mirror-upstream"/>
<target name="clean">
<delete dir="${basedir}/cache"/>
<delete dir="${basedir}/out"/>
</target>
<target name="mirror-upstream">
<ivy:settings file="ivysettings.xml"/>
<ivy:install organisation="aopalliance" module="aopalliance" revision="1.0.0" from="ibiblio" to="thirdparty-sink-fs"/>
(ns xqj
(:require [clojure.data.xml :as xml]
[clojure.zip :as zip]
[clojure.data.zip :as zf]
[clojure.data.zip.xml :as zx]
[clojure.data.xml])
(:import [clojure.lang Keyword]
[java.util Date]
[javax.xml.namespace QName]
[javax.xml.xquery XQConnection XQDataSource XQDynamicContext XQItemType XQConstants XQSequence]
readarray columns < <(xmlstarlet sel -t -m '//row' -v . -n <<<"$(curl http://sprunge.us/KOGf 2>/dev/null)")
declare -A values
while IFS=' :' read -a words; do
if (( ${#words[@]} < 2 )); then continue; fi
key="${words[0]}"
val="${words[${#words[@]}]}"
values["$key"]="$val"
done < <(curl http://sprunge.us/PCTL 2>/dev/null)
for column in "${columns[@]}"; do
@charles-dyfis-net
charles-dyfis-net / gist:4150725
Created November 26, 2012 21:26
split mixed kw/raw args
(defn split-keyword-args [args]
(loop [remaining-args args
keywords-found {}
args-found []]
(cond
(empty? remaining-args)
[keywords-found args-found]
(keyword? (first remaining-args))
(let [[kw arg & rest] remaining-args]
@charles-dyfis-net
charles-dyfis-net / pom.xml
Created November 15, 2012 00:05
Example minimal pom.xml
<?xml version="1.0" encoding="UTF-8"?>
<project>
<modelVersion>4.0.0</modelVersion>
<groupId>com.example</groupId>
<artifactId>mylib</artifactId>
<version>1.0</version>
</project>
<?xml version="1.0"?>
<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/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>net.dyfis</groupId>
<artifactId>esper-testcase</artifactId>
<packaging>jar</packaging>
<version>0.0.1-SNAPSHOT</version>
<name>Esper bug reproducer</name>
package repro;
import com.espertech.esper.client.*;
import com.espertech.esper.event.map.MapEventBean;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Map;
import java.util.Set;
@charles-dyfis-net
charles-dyfis-net / mvn-compile-output.txt
Created July 3, 2012 21:31
Reproducer for zi compile issue
[INFO] Scanning for projects...
[INFO] ------------------------------------------------------------------------
[INFO] Building zi_issue_repro
[INFO] task-segment: [compile]
[INFO] ------------------------------------------------------------------------
[INFO] [resources:resources {execution: default-resources}]
[WARNING] Using platform encoding (UTF-8 actually) to copy filtered resources, i.e. build is platform dependent!
[INFO] skip non existing resourceDirectory /home/cduffy/VC/zi-issue-repro.gist/src/main/resources
[INFO] [zi:resources {execution: default-resources}]
[INFO] [compiler:compile {execution: default-compile}]
</array>
<key>CFBundleExecutable</key>
<string>firefox</string>
<key>CFBundleGetInfoString</key>
<string>Firefox 13.0</string>
<key>CFBundleIconFile</key>
<string>firefox</string>
<key>CFBundleIdentifier</key>
<string>org.mozilla.firefox</string>
<key>CFBundleInfoDictionaryVersion</key>