Skip to content

Instantly share code, notes, and snippets.

@nicklanng
nicklanng / MapTurtle.lua
Created October 11, 2015 22:52
Mapping turtle
local mapLevel = 110
local flightLevel = 120
-- hook up peripherals and perform preflight checks
-- connect to server
-- set name to be server designation
-- request patrol area
open WebSharper
open WebSharper.Html.Server
type Endpoints =
| [<EndPoint "GET /">] Home
| [<EndPoint "GET /about">] About
let MyApp =
Warp.CreateApplication (fun ctx endpoint ->
match endpoint with
@nicklanng
nicklanng / setup_osx.sh
Last active August 29, 2015 14:23
Bash script for initial setup of new macbook
#!/bin/bash
ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
brew install caskroom/cask/brew-cask
brew tap caskroom/versions
brew install docker
brew install boot2docker
brew install git
@nicklanng
nicklanng / Vector3.coffee
Created January 6, 2015 10:10
CoffeeScript Example
class Vector3
add: (additional) ->
new Vector3 @x + additional.x,
@y + additional.y,
@z + additional.z
subtract: (subtrahend) ->
new Vector3 @x - subtrahend.x,
@y - subtrahend.y,
@z - subtrahend.z
@nicklanng
nicklanng / gist:ccd1a64947ff106b7539
Created November 5, 2014 11:37
Nullable Bools are Dangerous
[TestFixture]
public class NullableBoolsAreDangerous
{
[Test]
public void Test()
{
bool? variable = null;
Assert.IsTrue(variable != true);
Assert.IsFalse(variable == false);
}
@nicklanng
nicklanng / F# SpaceWar Domain
Last active August 29, 2015 14:02
F# Spacewar Exploration
[<Measure>]
type ly;
[<Measure>]
type s;
type Coordinate = {
x: float<ly>
y: float<ly>
z: float<ly>