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 / 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 {
/**
@ripper234
ripper234 / gist:1916601
Created February 26, 2012 13:06
play deps
# Application dependencies
require:
- play:
exclude:
- org.hibernate -> hibernate-core
- play -> secure
- play -> crud
- play -> less 0.9
# Buggy:
@ripper234
ripper234 / gist:1916593
Created February 26, 2012 13:03
Play Framework crash report
#
# A fatal error has been detected by the Java Runtime Environment:
#
# EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x00000000670406ef, pid=7560, tid=8440
#
# JRE version: 7.0_01-b08
# Java VM: Java HotSpot(TM) 64-Bit Server VM (21.1-b02 mixed mode windows-amd64 compressed oops)
# Problematic frame:
# V [jvm.dll+0x3e06ef]
#
@ripper234
ripper234 / wizard.patch
Created February 26, 2012 08:47
Add page css to form in jquery-form-wizard.
eb31fd63a313757ad25c032248a28944d375959f
.../jquery-ui-wizard/jquery.form.wizard.js | 27 +++++++++++++++++---
1 files changed, 23 insertions(+), 4 deletions(-)
diff --git a/portal/src/public/libraries/jquery-ui-wizard/jquery.form.wizard.js b/portal/src/public/libraries/jquery-ui-wizard/jquery.form.wizard.js
index 39a2397..c5525a9 100644
--- a/portal/src/public/libraries/jquery-ui-wizard/jquery.form.wizard.js
+++ b/portal/src/public/libraries/jquery-ui-wizard/jquery.form.wizard.js
@@ -13,7 +13,7 @@
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 ImageCreator {
private ImageCreator(){}
@ripper234
ripper234 / parse_trello_dump.groovy
Created January 18, 2012 13:35
Parse Trello XML Dump
Sample output, the result of processing this board: Board: https://trello.com/board/coolest-project-ever/4ec946d2772461073dbcce4c
Total number of lists: 6
--------
List: Sprint 5
--------
Fix input form
Fix bug #1315 - user can't login
Add Update User flow
@ripper234
ripper234 / Protocol.txt
Created January 17, 2012 09:21
How to decode messages stored in the Bitcoin blockchain with btcmsg
BTCmsg Protocol v1 (2011-09-18)
===============================
Each message is represented by multiple payment which is calculated by
the following algorithm:
1. Two first chars for message type ('01' for md5, '02' for ascii).
2. Then the message in hex (python binascii.hexlify).
3. Split the long string to groups of 4 hex digits.
4. Each group of 4 hex (e.g. 2 ascii letters from the message) is
represented by a payment in satoshi (maximum 0xffff=65535).
@ripper234
ripper234 / RouteBuilder
Created January 16, 2012 14:52
Fluently build Play! routes
import play.mvc.Controller;
import play.mvc.Router;
import java.util.Map;
import static com.google.common.base.Preconditions.checkArgument;
import static com.google.common.collect.Maps.newHashMap;
public class RouteBuilder {
private final Class<? extends Controller> controller;