Skip to content

Instantly share code, notes, and snippets.

@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 <animesh@strumsoft.com>"
*
*/
public class Session implements Serializable {
@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);
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 / 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
# ========================
redis-cli KEYS "prefix:*" | xargs redis-cli DEL
#!/bin/bash
#
# MongoDB Backup Script
# VER. 0.1
# Note, this is a lobotomized port of AutoMySQLBackup
# (http://sourceforge.net/projects/automysqlbackup/) for use with
# MongoDB.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
package com.vast.example
import java.net.InetSocketAddress
import java.util.UUID
import java.util.concurrent.{Executors, TimeUnit}
import com.google.common.base.Splitter
import com.twitter.finagle.http.Http
import com.twitter.finagle.builder.{Server, ServerBuilder}
import com.twitter.finagle.service.TimeoutFilter
import com.twitter.finagle.{Service, SimpleFilter, GlobalRequestTimeoutException}
@anismiles
anismiles / pom.xml
Created February 3, 2014 10:01 — forked from elvanja/pom.xml
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>org.acme.test</groupId>
<artifactId>nodejs-test</artifactId>
<version>0.0.1-SNAPSHOT</version>
<name>nodejs-test</name>
<description>NodeJS Test Project</description>
<packaging>jar</packaging>