Skip to content

Instantly share code, notes, and snippets.

@anismiles
anismiles / jetty
Created May 29, 2013 19:55 — forked from peterc/jetty
#!/usr/bin/env bash
#
# Startup script for jetty under *nix systems (it works under NT/cygwin too).
# To get the service to restart correctly on reboot, uncomment below (3 lines):
# ========================
# chkconfig: 3 99 99
# description: Jetty 7 webserver
# processname: jetty
# ========================
@anismiles
anismiles / jetty
Created May 29, 2013 19:55 — forked from peterc/jetty
#!/usr/bin/env bash
#
# Startup script for jetty under *nix systems (it works under NT/cygwin too).
# To get the service to restart correctly on reboot, uncomment below (3 lines):
# ========================
# chkconfig: 3 99 99
# description: Jetty 7 webserver
# processname: jetty
# ========================
http {
proxy_cache_path /var/cache/nginx levels=1:2 keys_zone=one:8m max_size=3000m inactive=600m;
proxy_temp_path /var/tmp;
include mime.types;
default_type application/octet-stream;
sendfile on;
keepalive_timeout 65;
gzip on;
gzip_comp_level 6;
@anismiles
anismiles / gist:4242073
Created December 8, 2012 21:35 — forked from SriramBms/gist:911144
Code snippet to manipulate the brightness of an image in Android
// It's assumed this function is defined in a class extending 'ImageView'
void addEffectBrightness(){
float brightness = mBrightnessValue;
mCm = new ColorMatrix();
mCm.set(new float[] { 1, 0, 0, 0, brightness,
0, 1, 0, 0,brightness,
0, 0, 1, 0, brightness,
0, 0, 0, 1, 0 });
mPaint = new Paint(Paint.ANTI_ALIAS_FLAG);
@anismiles
anismiles / session.java
Created March 2, 2012 10:54
dummy session bean
package com.strumsoft.api;
import java.io.Serializable;
import java.util.Date;
/**
* @author "Animesh Kumar <[email protected]>"
*
*/
public class Session implements Serializable {