Skip to content

Instantly share code, notes, and snippets.

@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>
@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 / 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 / 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
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 / 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
@nicklanng
nicklanng / DarkBlueMediawiki.css
Created December 14, 2015 00:40
A modified version of the Wikipedia - Dark, blue, simple Stylish theme
html {
background: #000 !important;
}
/* main elements */
html > body,
table,
tbody,
tr,
td,
#!/bin/sh
if [ "$TERM" = "linux" ]; then
/bin/echo -e "
\e]P0050304
\e]P1181114
\e]P22d2227
\e]P3493941
\e]P46d5762
\e]P5997b89
\e]P6bdabb3
<html>
<body>
Im an iframe!
<script>
console.log(window.parent.origin)
console.log(window.parent)
</script>
</body>
</html>
@nicklanng
nicklanng / semver.sh
Last active February 18, 2018 21:48
Semver for Travis CI based on Github Releases
if [ -z $TRAVIS_TAG ]; then
lastVersion=$(git tag -l --sort=v:refname *.*.* | tail -1)
if [ -z $lastVersion ]; then
lastVersion=0.0.0
fi
version=$lastVersion-dev
else
version=$TRAVIS_TAG
fi