Skip to content

Instantly share code, notes, and snippets.

View ryantenney's full-sized avatar

Ryan Tenney ryantenney

View GitHub Profile
@ryantenney
ryantenney / gist:1225140
Created September 18, 2011 14:53
Yoga mat for sale. Used once.
Yoga mat for sale. Used once at lunch hour class in December 2009. Usage timeline as follows:
11:45a
Register for hot yoga class. Infinite wisdom tells me to commit to 5 class package and purchase a yoga mat. I pay $89.74. Money well spent, I smugly confirm to myself.
11:55a
Open door to yoga room. A gush of hot dry air rushes through and past me. It smells of breath, sweat and hot. Take spot on floor in back of room next to cute blonde. We will date.
11:57a
I feel the need to be as near to naked as possible. This is a problem because of the hot blonde to my left and our pending courtship. She will not be pleased to learn that I need to lose 30 pounds before I propose to her.
@ryantenney
ryantenney / module.js
Created October 6, 2011 23:24 — forked from WebReflection/module.js
implicit require
var module = (function create(
namespace, handler, module
) {
// ------------------------------------
// (C) WebReflection - MitStyle License
// ------------------------------------
// @dependency npm install node-proxy
// ------------------------------------
// var sys = module.sys;
// sys.print("it works!");
import java.util.*;
import java.lang.*;
class Main {
public static void main (String[] args) throws java.lang.Exception {
int size = 65536;
Map m;
long starttime, endtime;
package us.t4y.scratch;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
/**
* Adapted from Twitter's Snowflake
* http://github.com/twitter/snowflake
*/
public class Snowflake {
import com.yammer.metrics.annotation.Timed;
import javax.ws.rs.GET;
import javax.ws.rs.Path;
import javax.ws.rs.Produces;
import javax.ws.rs.core.Response;
@Path("/healthcheck")
public interface HealthCheck
{
@ryantenney
ryantenney / gist:2553228
Created April 29, 2012 20:56
Export PuTTY Saved Sessions
regedit /e "%userprofile%\desktop\putty-registry.reg" HKEY_CURRENT_USER\Software\Simontatham
@ryantenney
ryantenney / xkcd-calendar.hs
Created May 28, 2012 15:29 — forked from clockfort/xkcd-calendar.hs
xkcd calendar calculator
import Data.Numbers.Primes
second = 1
minute = 60*second
hour = 60*minute
day = 1444*minute
month = 30*day
year = 12*month
daysPerXKCDYear = 30*12
@ryantenney
ryantenney / parseIpAddress.java
Created July 23, 2012 15:48
Parsing an IP Address in Java
public static InetAddress parseIpAddress(String ip) throws IllegalArgumentException {
StringTokenizer tok = new StringTokenizer(ip, ".");
if (tok.countTokens() != 4) {
throw new IllegalArgumentException("IP address must be in the format 'xxx.xxx.xxx.xxx'");
}
byte[] data = new byte[4];
int i = 0;
while (tok.hasMoreTokens()) {
@ryantenney
ryantenney / mosh-cygwin.md
Created August 25, 2012 17:38 — forked from eerohele/mosh-cygwin.md
Compiling Mosh (http://mosh.mit.edu/) under Cygwin
  1. Download Cygwin.

  2. Run setup.exe and install the following packages in addition to the default ones:

    • make
    • boost
    • libncurses-devel
    • pkg-config
    • perl
  3. Download and compile Protocol Buffers (make sure there are no spaces in the working directory when compiling Protocol Buffers, make will fail if there are):

@ryantenney
ryantenney / gist:3582019
Created September 1, 2012 18:08
White House Beer Recipes

White House Beer Recipes

White House Honey Porter

Ingredients

  • 2 (3.3 lb) cans light unhopped malt extract
  • 3/4 lb Munich Malt (cracked)
  • 1 lb crystal 20 malt (cracked)
  • 6 oz black malt (cracked)