Skip to content

Instantly share code, notes, and snippets.

View jestan's full-sized avatar

Jestan Nirojan jestan

View GitHub Profile
@jestan
jestan / gist:1526502
Created December 28, 2011 05:24
Sbt Exclude Dependancy
//Ivy Style
override def ivyXML =
<dependencies>
<exclude org="org.slf4j" name="slf4j-simple"/>
</dependencies>
//SBT 11 inline syle
"org.xyz" %% "xyz-lib" % "0.1.0" exclude("org.slf4j", "slf4j-simple")
@jestan
jestan / .gitignore
Created December 28, 2011 05:11
My Git Ignore
# Compiled source #
###################
*.class
*.exe
*.so
# Idea Project Files #
######################
*.iml
*.iws
@jestan
jestan / wrapper.conf
Created December 19, 2011 12:41
Java Service Wrapper Properties
#wrapper.java.additional.1=-Xdebug
#wrapper.java.additional.2=-Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=5005
#wrapper.java.additional.1=-XX:+UseConcMarkSweepGC
#wrapper.java.additional.2=-Xloggc:logs/gclog
#wrapper.java.additional.3=-XX:MaxDirectMemorySize=256M
#wrapper.java.additional.4=-XX:NewRatio=1
@jestan
jestan / gist:1450770
Created December 9, 2011 08:43
sctp issue
private boolean scheduleWriteIfNecessary(final SctpChannelImpl channel) {
final Thread currentThread = Thread.currentThread();
final Thread workerThread = thread;
if (currentThread != workerThread) {
if (channel.writeTaskInTaskQueue.compareAndSet(false, true)) {
boolean offered = writeTaskQueue.offer(channel.writeTask);
assert offered;
}
if (!(channel instanceof SctpAcceptedChannel) ||
@jestan
jestan / gist:1444598
Created December 7, 2011 20:53
My Scala Notes
# Compiler switches for optimization
-optimise
# Detailed Scala Collection Doc
http://www.scala-lang.org/docu/files/collections-api/collections.html
# @specialized (full performance for generic code)
# Scala Performance Optimization
@jestan
jestan / gist:1431109
Created December 4, 2011 19:49
Netty JVM Opts
-server -Xms2048m -Xmx2048m -XX:+UseParallelGC -XX:+AggressiveOpts -XX:+UseFastAccessorMethods
@jestan
jestan / gist:1344257
Created November 7, 2011 05:46
Lift Hacks
# Lift Run modes
"test", "staging", "production", "pilot", "profile", or blank
-Drun.mode=production
# Snippets
snippets are in the xxx.snippet package or LiftRules.addToPackages("xyz")
@jestan
jestan / gist:1330861
Created November 1, 2011 15:42
Faban Load Test Script
fhb -J -server -J -Xmx512m -J -Xms512m -c 1 -D test-results -s -S -W 20000 -r360/720/360 -p data.json http://localhost:8080/xyz-service
@jestan
jestan / gist:1326942
Created October 31, 2011 05:05
Dispatch Http Caching
#Http Caching
trait HttpCache extends Http {
override def make_client: org.apache.http.client.HttpClient = {
val config = new CacheConfig
config.setMaxCacheEntries(500)
config.setMaxObjectSizeBytes(50000)
new CachingHttpClient(super.make_client, config)
}
}
@jestan
jestan / gist:1324980
Created October 29, 2011 19:43
Kill a process by opened port
#!/bin/sh
kill $(lsof -t -i :8080)