Skip to content

Instantly share code, notes, and snippets.

open System
open System.IO
open System.Text.RegularExpressions
type Instruction = {
command : string;
start: (int * int);
finish: (int * int)
}
open System.IO
open System.Linq;
type niceness =
| vowel = 0
| double = 1
| naughty = 2
let checkDoubles (p : char * char) =
let x, y = p
open System;
open System.Linq;
open System.Text;
open System.Security.Cryptography;
let md5 = MD5.Create()
let md5hash (input : string) =
input
|> Encoding.UTF8.GetBytes
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
let input = "
3x11x24
13x5x19
1x9x27
24x8x21
6x8x17
19x18x22
10x9x12
let input = """
()(((()))(()()()((((()(((())(()(()((((((()(()(((())))((()(((()))((())(()((()()()()(((())(((((((())))()()(()(()(())((((((
)()()((())(((((()()))))()(())(((())(())((((((())())))(()())))()))))()())()())((()()((()()()()(()((((((((()()())((()()(((
((()(((())((())(()))()((((()((((((((())()((()())(())((()))())((((()())(((((((((((()()(((((()(()))())(((()(()))())((()(()
())())())(()(((())(())())()()(()(()((()))((()))))((((()(((()))))((((()(()(()())())()(((()((((())((((()(((()()(())()()()(
))((()((((((()((()()))()((()))()(()()((())))(((()(((()))((()((()(()))(((()()(()(()()()))))()()(((()(((())())))))((()((((
))()(()(())((()())))((((())))(()(()(()())()((()())))(((()((()(())()()((()((())(()()((())(())()))()))((()(())()))())(((((
((()(()()(()(())())))))))(()((((((())((((())((())())(()()))))()(())(()())()())((())(()))))(()))(()((()))()(()((((((()()(
)()((((((((()(()(())((()()(()()))(())()())()((())))()))()())(((()))(())()(())()))()((()((()(()()())(())()()()((())())))(
(()()(()()((()(())()()())(((()(()()))))(
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 / LessWatcher.groovy
Created December 20, 2012 05:40
Groovy script to watch a directory for LESS files and compile them. Requires Java 7.
@Grab('com.asual.lesscss:lesscss-engine:1.3.0')
import java.nio.file.FileSystems
import java.nio.file.StandardWatchEventKinds
import com.asual.lesscss.LessEngine
import com.asual.lesscss.LessOptions
CliBuilder cli = new CliBuilder()
cli.with {
w longOpt: 'watch', args: 1, argName: 'less file/directory', 'LESS file or directory of LESS files to watch, default: <current directory>'
#!/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
#
####################################
# 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