Skip to content

Instantly share code, notes, and snippets.

View lancepantz's full-sized avatar

lance bradley lancepantz

  • bird
  • los angeles, ca
View GitHub Profile
(defn parse-vlf [buffer]
(loop [bytes 0, first true, number 0, multiplier 1, byte (.get buffer)]
(let [number (+ number (* (bit-and byte 0x7f)
(int (Math/pow 2 (* bytes 7)))))
[multiplier number] (if (and first (not= 0 (bit-and number 1)))
[-1 (- number 1)]
[1 number])]
(if (= 0 (bit-and 0x80 byte))
[(* (/ number 2) multiplier) buffer]
(recur (+ 1 bytes) false number multiplier (.get buffer))))))
package com.geni.solr;
import java.sql.SQLException;
import java.util.List;
import java.util.Map;
import java.util.HashMap;
import java.util.Iterator;
import org.apache.solr.handler.dataimport.Context;
import org.apache.solr.handler.dataimport.DataImporter;
import org.apache.solr.handler.dataimport.DataSource;
<?xml version="1.0" encoding="UTF-8"?>
<Configure id="geniGedcom" class="org.mortbay.jetty.webapp.WebAppContext">
<Set name="contextPath">/geni-gedcom</Set>
<Set name="war">
<SystemProperty name="jetty.home" default="."/>/webapps/geni-gedcom-0.0.1.war</Set>
</Configure>
d3.json(uri, function(json) {
var myData = data();
force
.nodes(myData.nodes)
.links(myData.links)
.start();
var link = svg.selectAll("line.link")
.data(force.links())
(defn generate-method-block [heading ns methods]
(let [methods (name methods)]
(html [:p.route-type heading]
(anchor ns methods))))
(defn generate-top
"Generate top-level page."
[ns-prefix suffix]
(let [nss (filter (partial re-find (-> ns-prefix str re-pattern))
(map str (all-ns)))]
[core]
repositoryformatversion = 0
filemode = true
bare = false
logallrefupdates = true
ignorecase = true
[remote "origin"]
fetch = +refs/heads/*:refs/remotes/origin/*
url = [email protected]:lancepantz/thylucene.git
[branch "master"]
(ns graph.servlet
(:gen-class :extends javax.servlet.http.HttpServlet :exposes-methods {init initSuper}))
(defn -init [self config]
(debug "init called")
(debug self)
(.initSuper self config))
function e {
if [ "$1" != '' ]; then
touch $1
fi
open -a /Applications/Emacs.app $1
}
(deftask clean
"Remove cake build artifacts."
(ant Delete {:verbose true}
(add-fileset {:dir (file) :includes "*.jar"})
(add-fileset {:dir (file) :includes "*.war"}))
(add-fileset {:dir (file ".cake" "run") :includes "*"})
(doseq [dir ["classes" "build" "test/classes"]]
(clean-dir (file dir)))
(when (= ["deps"] (:clean *opts*))
(defn base-file [& path]
(str (apply file "variants" "base_conf" path)))
(defile "variants/bare/conf/schema.xml" (base-schema))
(defile "variants/bare/conf/data-config.xml" (base-data-config))
(defile "variants/bare/conf/synonyms.txt" #{(base-file "synonyms.txt")}
(cp (base-file "synonyms.txt") *File*))