Skip to content

Instantly share code, notes, and snippets.

View alfredgamulo's full-sized avatar
🦄

Alfred Gamulo alfredgamulo

🦄
View GitHub Profile
@alfredgamulo
alfredgamulo / Java CodeJam
Last active August 29, 2015 14:01
Java template for Google CodeJam
import java.util.*;
import java.io.PrintStream;
import java.util.Scanner;
public class A {
Scanner sc = new Scanner(getClass().getResourceAsStream(FILENAME));
static final String FILENAME = "file.in";
PrintStream out = System.out;
@alfredgamulo
alfredgamulo / chef installer
Created May 15, 2014 00:08
Single line dynamic chef cookbook installer
#!/bin/bash
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
APPLICATION="${0##*/}"
USAGE="Cookbook installer
usage: $APPLICATION -c cookbooks
Ensures chef as a dependency and installs cookbooks specified with -c.
THIS MUST BE RUN AS ROOT. This script only works with Redhat Enterprise Linux 5 or Mac OSX.
@alfredgamulo
alfredgamulo / Mumford
Created January 20, 2014 03:10
Schmoocon 2014 last stage blockchain http://www.shmoocon.org/badges/x/hkpzrake/
#!/usr/bin/ruby
def x2s(x)
ret = ""
if x.length > 2
while x.length >= 2
ret += x[0..1].hex.chr.to_s
x = x[2..-1]
end
ret += x[0..1].hex.chr.to_s