Skip to content

Instantly share code, notes, and snippets.

View dustinschultz's full-sized avatar
😃

Dustin Schultz dustinschultz

😃
View GitHub Profile
@dustinschultz
dustinschultz / git-slim.py
Created August 7, 2012 22:14 — forked from afternoon/git-slim.py
Remove large objects from a git repository
#!/usr/bin/python
#
# git-slim
#
# Remove big files from git repo history.
#
# Requires GitPython (https://github.com/gitpython-developers/GitPython)
#
# References:
# - http://help.github.com/remove-sensitive-data/
Happens on a fresh startup (empty data dir) with local bundles installed that depend on Spring AOP and are a part of features include in the featuresBoot. If I restart, everything works fine.
Happens more often than not but does not happen on every startup.
ghost:~ dustin$ java -version
java version "1.7.0_13"
Java(TM) SE Runtime Environment (build 1.7.0_13-b20)
Java HotSpot(TM) 64-Bit Server VM (build 23.7-b01, mixed mode)
Apache ServiceMix (4.4.2)
xquery version "1.0";
let $message := 'Hello World!'
return
<results>
<message>{fn:trace($message, '$message is: ')}</message>
</results>
@dustinschultz
dustinschultz / gist:5718281
Created June 5, 2013 23:52
Comments after XML declaration cause XQQueryException
/**
* Copyright (C) [2013] [The FURTHeR Project]
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
@dustinschultz
dustinschultz / gist:5731418
Created June 7, 2013 18:40
&quot; throws SAXParseException, other special entities are parsed correctly.
/**
* Copyright (C) [2013] [The FURTHeR Project]
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
@dustinschultz
dustinschultz / gist:5786101
Created June 14, 2013 23:42
On JDK 1.7_21 results in NPE - JDK 1.6_45 does not throw exception
import java.io.FileReader;
import javax.xml.stream.XMLInputFactory;
import javax.xml.stream.XMLStreamConstants;
import javax.xml.stream.XMLStreamReader;
import javax.xml.transform.Transformer;
import javax.xml.transform.TransformerFactory;
import javax.xml.transform.dom.DOMResult;
import javax.xml.transform.stax.StAXSource;
@dustinschultz
dustinschultz / gist:5786108
Created June 14, 2013 23:44
Test XML document without XML declaration
<catalog>
<book id="bk101">
<author>Gambardella, Matthew</author>
<title>XML Developer's Guide</title>
<genre>Computer</genre>
<price>44.95</price>
<publish_date>2000-10-01</publish_date>
<description>An in-depth look at creating applications
with XML.</description>
</book>
@dustinschultz
dustinschultz / gist:5959657
Created July 9, 2013 18:02
Read a URL using a Scanner instead of the tedious BufferedReader
public static void main(final String[] args) {
Scanner out = null;
try {
out = new Scanner(new URL( "http://demo.further.utah.edu:9000/dts/rest/translate/5102/Code%20in%20Source/"
+ "41759-2/32868/Local%20Code?view=HUMAN").openStream(), "UTF-8")
.useDelimiter("\\A");
final String result = out.next();
if (result.indexOf("propertyValue") == -1) {
@dustinschultz
dustinschultz / dblatex.rb
Created September 12, 2013 21:51
Homebrew dblatex patched
require 'formula'
class Dblatex < Formula
env :userpaths
url 'http://downloads.sourceforge.net/project/dblatex/dblatex/dblatex-0.3.4/dblatex-0.3.4.tar.bz2'
homepage 'http://dblatex.sourceforge.net'
md5 'a511a2eaa55757b341e4c46353c5c681'
def install
system "python", "setup.py", "install", "--prefix=#{prefix}", "--install-scripts=#{bin}"
@dustinschultz
dustinschultz / install_asciidoc_osx
Created September 13, 2013 18:09
Install AsciiDoc on Mac OS X
Install Homebrew - ruby -e "$(curl -fsSL https://raw.github.com/mxcl/homebrew/go)"
Install MacTex - http://tug.org/mactex/
brew install asciidoc
brew edit dblatex
copy and paste content here https://gist.github.com/dustinschultz/6544364
brew install dblatex