Skip to content

Instantly share code, notes, and snippets.

View xymor's full-sized avatar

Raphael Miranda xymor

View GitHub Profile
@xymor
xymor / gist:661394
Created November 3, 2010 17:26
Java opts g1gc
-XX:+UnlockExperimentalVMOptions
-XX:+UseG1GC
-XX:MaxGCPauseMillis=2000
-XX:GCPauseIntervalMillis=5000
-XX:+G1ParallelRSetUpdatingEnabled
-XX:+G1ParallelRSetScanningEnabled
-XX:+DoEscapeAnalysis
-XX:+AggressiveOpts
-Xms256m
-Xmx768m
@xymor
xymor / Event.groovy
Created May 30, 2011 14:50
Grails Event.groovy
Ant.property (environment:'env')
eventStatusInterrupt = { args ->
println "Caught interruption"
println args
}
//eventStatusUpdate = { msg -> popUpMessage(args) }
eventStatusFinal = { args -> popUpMessage(args) }
@xymor
xymor / gvm
Created January 17, 2012 18:29
simple grails installer and env switcher
#inspired by rvm, npm, etc
# gvm 2.0.0
gvm () {
export PATH=~/.grails/grails-dists/grails-$1/bin:$PATH
export GRAILS_HOME=~/.grails/grails-dists/grails-$1
if [ -d "grails-app" ]; then
grails clean
fi
}
@xymor
xymor / grails-ignore
Created March 8, 2012 22:26
Set a single svn ignore list in all grails projects recursively
#forgive my newb bash skillz
find . -iname grails-app | xargs -I {} readlink -f {} | xargs -I {} dirname {} | xargs -I {} svn propset svn:ignore "$(echo -e "*.iml\n*.ipr\n*.iws\n*.launch\n*.prefs\n*.tmproj\n*Db.log\n*Db.properties\n*Db.script\n.classpath\n.hg\n.hgignore\n.idea\n.project\n.settings\nRuleLogFile.log\nbin\nbin-groovy\ndevDB.*\ndevDb.*\nout\nplugin.xml\nprodDb.*\npromotional.log\nstacktrace.log\ntarget\ntarget-eclipse\ntest-output\ntestDb.*\n")" {}
@xymor
xymor / gist:2897523
Created June 8, 2012 18:42
wait for a service to be available
# install netcat
while ! nc -vz localhost 4444; do sleep 1; done
@xymor
xymor / git-daemon
Created June 25, 2012 19:04
git-daemon start script
#!/bin/sh
#
# From: http://robescriva.com/blog/2009/01/13/git-daemon-init-scripts-on-centos-52/
# Startup/shutdown script for Git Daemon
#
# Linux chkconfig stuff:
#
# chkconfig: 345 56 10
# description: Startup/shutdown script for Git Daemon
@xymor
xymor / mountain-lion-brew-setup.markdown
Created August 4, 2012 17:52 — forked from myobie/mountain-lion-brew-setup.markdown
Get Mountain Lion and Homebrew to Be Happy

Get Mountain Lion and Homebrew to Be Happy

1) Install XCode 4.4 into /Applications

Get it from the App Store.

2) Install Command Line Tools

In XCode's Preferences > Downloads you can install command line tools.

@xymor
xymor / gist:3286394
Created August 7, 2012 15:28
advance a sequence without ddl permissions
-- pardon my noob plsql skills
declare
val number;
begin
for i in 1..100 loop
select B2B_B2W_ADMIN.STOCKDETAIL_SEQ.nextval into val from dual;
end loop;
end;
-- remember to commit
@xymor
xymor / gist:3555170
Created August 31, 2012 16:08
Use libnotify to run tests automaticaly after saving a source
# save it as inotifyrun
--
#!/bin/sh
FORMAT=$(echo -e "\033[1;33m%w%f\033[0m written")
"$@"
while inotifywait -qre close_write --format "$FORMAT" .
do
"$@"
done
--
@xymor
xymor / gist:4549291
Last active May 25, 2018 19:54
Encrypt/decrypt with Blowfish/ECB/NoPadding
import javax.crypto.spec.SecretKeySpec
import javax.crypto.Cipher
import org.apache.commons.codec.binary.Base64
def encrypt(encrypt,en_key) {
if(encrypt.size() % 8 != 0){ //not a multiple of 8
byte[] padded = new byte[encrypt.length + 8 - (encrypt.length % 8)];
//copy the old array into it