Skip to content

Instantly share code, notes, and snippets.

terrancesnyder / datemathparser.js
Last active Aug 29, 2015
DateMathParser for JavaScript
View datemathparser.js
var DateMathParser = function() {
return {
parse: function(match) {
var dt = new moment();
if (0 == match.length) {
return dt;
var splitter = new RegExp("([^/]*)([/]{0,1})([^\\-\\+]*)(.*)");
var pos = 0;
terrancesnyder / gist:b4ef1acd7494b1b9aa78
Last active Aug 29, 2015
Useful bash for clearing solr index data
View gist:b4ef1acd7494b1b9aa78
shopt -s globstar
find ./consumers_s*/**/data/* -type f -exec rm -rf {} \;
find ./consumers_s*/**/tlog/* -type f -exec rm -rf {} \;
find ./orders_s*/**/data/* -type f -exec rm -rf {} \;
find ./orders_s*/**/tlog/* -type f -exec rm -rf {} \;
find . -name '*.java' ! -type d -exec bash -c 'expand -t 4 "$0" > /tmp/e && mv /tmp/e "$0"' {} \;
terrancesnyder /
Last active Sep 16, 2015
System Developer Startup


  • Download JDK 1.7 (JDK!!!)
  • Install to C:\opt\java\jdk1.7.xx install your JRE to C:\opt\java\jre1.7.xx
  • Update your environment to have JAVA_HOME = C:\opt\java\jdk1.7.xx and update your root to have PATH = ...;%JAVA_HOME%\bin
  • Validate you did it right by going to your shell and typing "java -version" You should get java version info.


  • Download and install the latest maven to C:\opt\maven
terrancesnyder / jmxremote.access
Created May 24, 2011
jmxremote.access - file used to control JMX remote access for tomcat
View jmxremote.access
<youruser> [readonly|readwrite]
terrancesnyder /
Created May 24, 2011 - man page describing the file
NAME - script that will provision a new tomcat instance
SYNOPSIS [create|delete] [port]
The program is useful for creating or deleting instances of a tomcat
on a specific port following SpringSource recommendations.
terrancesnyder / jmxremote.password
Created May 24, 2011
jmxremote.password - password file used to protect JMX exposed by tomcat
View jmxremote.password
<yourusername> <yourpassword>
terrancesnyder /
Created May 27, 2011
./ selenium headless on linux
# Start an ephemeral X server.
# This is useful for when you want to lauch an X server for a specific
# process. When that process exits, the X server will be killed.
terrancesnyder / install-selenium-grid-service.bat
Created May 27, 2011
selenium grid console on windows as service
View install-selenium-grid-service.bat
# create server
cmd /c sc create SeleniumGrid binPath= "cmd /c ant -f \"C:\opt\selenium-grid-1.0.8\build.xml\" launch-hub " DisplayName= "Selenium Grid Server"
# create client
cmd /c sc create SeleniumGridClient binPath= "cmd /c ant -f \"C:\opt\selenium-grid-1.0.8\build.xml\" -Dport=4545 -Denvironment=*chrome launch-remote-control " DisplayName= "Selenium Grid Client"
# This doesn't work, want to create a tc7 server... sigh...
cmd /c sc create Tomcat binPath= "C:\opt\tomcat7\srvany.exe" start= "auto" DisplayName= "Apache Tomcat Server"
# Save this as tomcat-service.reg
#! /bin/sh
# Licensed to the Apache Software Foundation (ASF).
# Provides: selenium-grid
# Required-Start: $network $syslog $remote_fs
# Required-Stop: $network $syslog
# Default-Start:
# Default-Stop:
# Short-Description: Selenium Grid Server