Skip to content

Instantly share code, notes, and snippets.

View ripper234's full-sized avatar
💭
Angel Investor & Advisor

Ron Gross ripper234

💭
Angel Investor & Advisor
View GitHub Profile
@ripper234
ripper234 / MonitorLoad.scala
Created February 25, 2013 20:12
Another attempt at a Play Framework 2.1 scheduled task example
import akka.actor.{Props, Actor}
import concurrent.ExecutionContext
import play.api.Logger
import play.libs.Akka
import scala.concurrent.duration._
import ExecutionContext.Implicits.global
case object Tick
@ripper234
ripper234 / gist:5032788
Created February 25, 2013 20:05
Example of Play Framework 2.1 Akka scheduled tasks
import akka.actor.{Props, Actor}
import concurrent.duration.{Duration, FiniteDuration}
import play.api.{Application, Logger}
import play.libs.Akka
import scala.concurrent.duration._
import java.util.concurrent.TimeUnit
case object Tick
class MonitorLoad extends Actor {
@ripper234
ripper234 / RegexUtils.java
Created July 9, 2012 13:11
Play Framework SMTP appender with exclusions
import org.apache.commons.lang.StringUtils;
import java.util.regex.Pattern;
public class RegexUtils {
private RegexUtils(){}
public static Pattern matchAny(String[] patterns) {
return matchAny(patterns, 0);
}
play start
~ _ _
~ _ __ | | __ _ _ _| |
~ | '_ \| |/ _' | || |_|
~ | __/|_|\____|\__ (_)
~ |_| |__/
~
~ play! 1.2.4 (custom: 1.2.4-mbknor-3), https://github.com/mbknor/play/tree/1.2.4-mbknor-custom-rele
ase
~
@ripper234
ripper234 / gist:2984066
Created June 24, 2012 17:15
Play memcached error on heroku
2012-06-24T17:11:03+00:00 app[web.1]: ~ play! 1.2.4, http://www.playframework.org
2012-06-24T17:11:03+00:00 app[web.1]: ~ framework ID is prod
2012-06-24T17:11:03+00:00 app[web.1]: ~
2012-06-24T17:11:03+00:00 app[web.1]: ~ Ctrl+C to stop
2012-06-24T17:11:03+00:00 app[web.1]: ~
2012-06-24T17:11:03+00:00 app[web.1]: 17:11:03,351 INFO ~ Shut down memcached client
2012-06-24T17:11:04+00:00 app[web.1]: 17:11:04,335 INFO ~ Starting /app
2012-06-24T17:11:04+00:00 app[web.1]: 17:11:04,340 INFO ~ Module rythm is available (/app/modules/r
ythm-1.0.0-RC5)
2012-06-24T17:11:04+00:00 app[web.1]: 17:11:04,340 INFO ~ Module less is available (/app/modules/le
@ripper234
ripper234 / gist:2761101
Created May 21, 2012 08:04
play-LocalvariablesNamesEnhancer-bug-1528 - play deps --sync --verbose
~ Resolving dependencies using C:\work\tmp\play-LocalvariablesNamesEnhancer-bug-1528\conf\dependencies.yml,
~
:: resolving dependencies :: play-application#play-LocalvariablesNamesEnhancer-bug-1528;1.0
confs: [default]
found play#play;1.2.x-84b46a2 in playCore
found antlr#antlr;2.7.7 in playCoreDependencies
found c3p0#c3p0;0.9.1.2 in playCoreDependencies
found cglib#cglib-nodep;2.2 in playCoreDependencies
found com.google.code.gson#gson;2.2 in playCoreDependencies
@ripper234
ripper234 / Output from play-deps --sync
Created May 17, 2012 15:22
Weird play deps issue in 1.2.x-84b46a2
~ Resolving dependencies using C:\work\CS\portal\src\conf\dependencies.yml,
~
~ play->less 0.9 (from playContributedModules)
~ com.google.guava->guava 10.0.1 (from mavenCentral)
~ com.google.code.findbugs->jsr305 1.3.9 (from mavenCentral)
~ com.google.guava->guava-bootstrap 10.0.1 (from mavenCentral)
~ org.hibernate->hibernate-validator 4.1.0.Final (from mavenCentral)
~ javax.validation->validation-api 1.0.0.GA (from mavenCentral)
~ javax.xml.bind->jaxb-api 2.2 (from mavenCentral)
~ com.sun.xml.bind->jaxb-impl 2.1.12 (from mavenCentral)
@ripper234
ripper234 / ResolvedFuture.java
Created April 18, 2012 15:25
Resolved Future
import java.util.concurrent.ExecutionException;
import java.util.concurrent.Future;
import java.util.concurrent.TimeUnit;
import java.util.concurrent.TimeoutException;
/**
* Used when you need to return a Future, but you already have the answer.
*/
public class ResolvedFuture<T> implements Future<T>{
private final T item;
@ripper234
ripper234 / playframework
Created March 13, 2012 16:46 — forked from domdorn/playframework
Upstart Script for the PlayFramework 1.x
# Upstart script for a play application that binds to an unprivileged user.
# put this into a file like /etc/init/playframework
# you can then start/stop it using either initctl or start/stop/restart
# e.g.
# start playframework
# http://dominikdorn.com
description "Description of your app"
author "Dominik Dorn <dominik@studyguru.eu>"
version "1.0"
@ripper234
ripper234 / Example.java
Created March 4, 2012 14:56
Different graphics output on linux & Windows
import javax.imageio.ImageIO;
import javax.swing.*;
import java.awt.*;
import java.awt.image.BufferedImage;
import java.io.IOException;
import java.nio.file.Path;
import java.nio.file.Paths;
public class Example {
/**