Skip to content

Instantly share code, notes, and snippets.

View happygiraffe's full-sized avatar
💭
Probably not looking at GitHub…

Dominic Mitchell happygiraffe

💭
Probably not looking at GitHub…
View GitHub Profile
@happygiraffe
happygiraffe / Main.java
Created December 10, 2011 22:14
Encoding test
import java.io.File;
import java.io.FileOutputStream;
import java.io.IOException;
import java.nio.charset.Charset;
public class Main {
public static void main(String[] args) throws IOException {
System.out.println("file.encoding=" + System.getProperty("file.encoding"));
System.out.println("sun.jnu.encoding=" + System.getProperty("sun.jnu.encoding"));
@happygiraffe
happygiraffe / happygiraffe.js
Created September 8, 2011 20:56
snowman critter
/**
* @see https://github.com/asyncjs/Javascript-Jungle/wiki/api
*/
jj.createCreature('happygiraffe-snowman', function (creature) {
'use strict';
// the div element for the creature.
var element = creature.el,
snowman = '☃',
# Upgrade git in mac ports.
# First, bring the ports collection up to date.
# -d for debug output.
sudo port -d sync
# Then, upgrade git.
# -d for debug output.
# -n for not upgrading dependencies
#!/bin/bash
#
# Provides a function that allows you to choose a JDK. Just set the environment
# variable JDKS_ROOT to the directory containing multiple versions of the JDK
# and the function will prompt you to select one. JAVA_HOME and PATH will be cleaned
# up and set appropriately.
# Usage:
# Include in .profile or .bashrc or source at login to get 'pickjdk' command.
# 'pickjdk' alone to bring up a menu of installed JDKs on OS X. Select one.
# die you bastards
git grep -E '\bsub +[A-Za-z0-9_]+ *\([^)]'