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 / decrypt.js
Created February 22, 2013 21:23
Password checker for encrypted JSON from blockchain.info (My Wallet) bitcoin wallet
// To run this:
// 1. Install node.js
// 2. Fill in encrypted & password below
// 3. node decrypt.js
var encrypted = ''; // copy paste encrypted json here
var password = ''; // your password goes here
(typeof Crypto == "undefined" || !Crypto.util) && function () {
var a = Crypto = {}, b = a.util = {
@ripper234
ripper234 / gist:3231276
Created August 1, 2012 22:30
Hello PGP World
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
FYI World, I now have an official public key.
It is availble here: http://pgp.mit.edu:11371/pks/lookup?search=ron+gross&op=index
Specifically, it is this one: http://pgp.mit.edu:11371/pks/lookup?op=get&search=0x6016B419893E4632
I've been meaning to generate a public key for some time, and finally I had an actualy need for this.
(A company I'm doing business with asked me to verify my identity and communications via PGP)
@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 / MobileUADetector
Created May 31, 2012 09:46
Detect mobile user agent in Java
import java.util.regex.Pattern;
/**
* Detect mobile User Agent
*
* Adpated from http://detectmobilebrowsers.com/download/cs on 31/05/2012
*/
public class MobileUADetector {
private final static Pattern mobile_b = Pattern.compile("android.+mobile|avantgo|bada\\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\\/|plucker|pocket|psp|symbian|treo|up\\.(browser|link)|vodafone|wap|windows (ce|phone)|xda|xiino", Pattern.CASE_INSENSITIVE | Pattern.MULTILINE);
@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)