Skip to content

Instantly share code, notes, and snippets.

View dustinschultz's full-sized avatar
😃

Dustin Schultz dustinschultz

😃
View GitHub Profile
@dustinschultz
dustinschultz / db-activity-stream.json
Created September 11, 2020 15:17
Example of a message from AWS Database Activity Stream
{
"type": "DatabaseActivityMonitoringRecord",
"clusterId": "cluster-XXXXXXXXXXXXXXXXXXXXXXXXXX",
"instanceId": "db-XXXXXXXXXXXXXXXXXXXXXXX",
"databaseActivityEventList": [
{
"logTime": "2019-12-26 06:56:09.090054+00",
"statementId": 3731,
"substatementId": 1,
"objectType": "TABLE",
@dustinschultz
dustinschultz / keybase.md
Created January 20, 2020 18:40
keybase.md

Keybase proof

I hereby claim:

  • I am dustinschultz on github.
  • I am dustinschultz (https://keybase.io/dustinschultz) on keybase.
  • I have a public key ASBMLhA58F245YCoTcbUHFGqC4o1u5HOojI5T3ymkl7xzgo

To claim this, I am signing this object:

### Keybase proof
I hereby claim:
* I am dustinschultz on github.
* I am dustinschultz (https://keybase.io/dustinschultz) on keybase.
* I have a public key ASBMLhA58F245YCoTcbUHFGqC4o1u5HOojI5T3ymkl7xzgo
To claim this, I am signing this object:
@dustinschultz
dustinschultz / h2_with_query_statistics.md
Created December 8, 2019 04:14
enable h2 with query statistics

jdbc:h2:mem:database_name;QUERY_STATISTICS=true

@dustinschultz
dustinschultz / osx_developer_clean_install.md
Last active March 26, 2020 16:54
OSX Developer Clean Install

Homebrew

/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"

Hombrew Cask

brew tap caskroom/cask

Software

brew cask install java - installs JDK8, not just Java

brew cask install java7 - installs JDK7

@dustinschultz
dustinschultz / gist:6d731fd880c8c0ac226e
Last active August 29, 2015 14:20
Lucene Fuzzy Query Edit Distance
import java.io.IOException;
import java.io.StringReader;
import org.apache.lucene.analysis.Analyzer;
import org.apache.lucene.analysis.TokenStream;
import org.apache.lucene.analysis.en.EnglishAnalyzer;
import org.apache.lucene.analysis.tokenattributes.CharTermAttribute;
import org.apache.lucene.document.Document;
import org.apache.lucene.document.Field.Store;
import org.apache.lucene.document.TextField;
@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
@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 / 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 / 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>