Skip to content

Instantly share code, notes, and snippets.

import java.nio.charset.Charset;
import java.nio.file.FileSystems;
import java.nio.file.Files;
import java.util.List;
public class CodeForAmerica {
private static final int NAME = 8;
private static final int LAND_AREA = 11;
private static final int POPULATION = 13;
@plecong
plecong / rhino_dust.java
Created February 9, 2012 22:22 — forked from vybs/rhino_dust.java
Sample code to rendering dust template using Rhino
package com.linkedin.dust.renderer;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.Reader;
import java.io.Writer;
import org.mozilla.javascript.Context;
import org.mozilla.javascript.JavaScriptException;
@plecong
plecong / ketchup-bootstrap.js
Created March 13, 2012 17:58
jQuery Ketchup with Twitter Bootstrap
!function( $ ) {
"use strict"
$.ketchup
.createErrorContainer(function(form, el) {
var g = el.closest('.controls');
if (g) {
import com.github.plecong.hogan.Hogan
def data = [ screenName: 'plecong' ]
def template = Hogan.compile('Follow @{{screenName}}.')
def output = template.render(data)
// prints "Follow @plecong."
println output
####################################
# BASIC REQUIREMENTS
# http://graphite.wikidot.com/installation
# http://geek.michaelgrace.org/2011/09/how-to-install-graphite-on-ubuntu/
# Last tested & updated 10/13/2011
####################################
sudo apt-get update
sudo apt-get upgrade
#!/usr/bin/env bash
#
# Copyright 2012 Zemian Deng
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
let input = """
()(((()))(()()()((((()(((())(()(()((((((()(()(((())))((()(((()))((())(()((()()()()(((())(((((((())))()()(()(()(())((((((
)()()((())(((((()()))))()(())(((())(())((((((())())))(()())))()))))()())()())((()()((()()()()(()((((((((()()())((()()(((
((()(((())((())(()))()((((()((((((((())()((()())(())((()))())((((()())(((((((((((()()(((((()(()))())(((()(()))())((()(()
())())())(()(((())(())())()()(()(()((()))((()))))((((()(((()))))((((()(()(()())())()(((()((((())((((()(((()()(())()()()(
))((()((((((()((()()))()((()))()(()()((())))(((()(((()))((()((()(()))(((()()(()(()()()))))()()(((()(((())())))))((()((((
))()(()(())((()())))((((())))(()(()(()())()((()())))(((()((()(())()()((()((())(()()((())(())()))()))((()(())()))())(((((
((()(()()(()(())())))))))(()((((((())((((())((())())(()()))))()(())(()())()())((())(()))))(()))(()((()))()(()((((((()()(
)()((((((((()(()(())((()()(()()))(())()())()((())))()))()())(((()))(())()(())()))()((()((()(()()())(())()()()((())())))(
(()()(()()((()(())()()())(((()(()()))))(
open System
let input = "
3x11x24
13x5x19
1x9x27
24x8x21
6x8x17
19x18x22
10x9x12
open System
open System.IO
let getHouses directions =
directions
|> Seq.map (fun x ->
match x with
| '>' -> (fun (x: int, y: int) -> (x + 1, y))
| '<' -> (fun (x: int, y: int) -> (x - 1, y))
| '^' -> (fun (x: int, y: int) -> (x, y + 1))
open System;
open System.Linq;
open System.Text;
open System.Security.Cryptography;
let md5 = MD5.Create()
let md5hash (input : string) =
input
|> Encoding.UTF8.GetBytes