Skip to content

Instantly share code, notes, and snippets.

View seankearon's full-sized avatar
coding up a storm!


coding up a storm!
View GitHub Profile
seankearon / original-code-for-review.fs
Last active August 29, 2015 14:03
Parsing sections from a log file using F#
View original-code-for-review.fs
// Code for review posted here:
// Here are the "lines" from my "log file".
let lines = [1 .. 25] |> (fun x -> x.ToString())
// For this exercise, section criteria is divisibility by 5.
// val DivisibleByFive : s:string -> bool
let DivisibleByFive (s:string) =
System.Int32.Parse(s) % 5 = 0
seankearon / get-script-folder.ps1
Last active August 29, 2015 14:03
ps: useful snippets
View get-script-folder.ps1
# Get the script's folder
function get_script_directory #
$Invocation = (Get-Variable MyInvocation -Scope 1).Value
Split-Path $Invocation.MyCommand.Path
$scriptpath = get_script_directory
cd $scriptpath
# Pause for user to press a key
seankearon / Typescript Jasmine Knockout Setup
Last active August 29, 2015 14:05
Set up for testing a TypeScript Knockout model in Visual Studio with Jasmine
View Typescript Jasmine Knockout Setup
Install-Package knockoutjs
Install-Package knockout.typescript.DefinitelyTyped
Install-Package JasmineTest
Install-Package jasmine.typescript.DefinitelyTyped
seankearon / 0_reuse_code.js
Last active August 29, 2015 14:15
Here are some things you can do with Gists in GistBox.
View 0_reuse_code.js
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
seankearon / gist:2638423
Created May 8, 2012 18:47
Tobi's Embedded RavenDB Dumper with Attachments
View gist:2638423
// Based on original by Tobi:
public class RavenDBDumper
#region Static Methods
private static void Read(JsonReader jsonReader, string arrayName, Action<RavenJToken> process)
if (jsonReader.Read() == false)
if (jsonReader.TokenType != JsonToken.PropertyName)
View gist:6572130
void Main()
var file = @"C:\Users\Me\Desktop\Certificates.txt";
var a = JObject.Parse(File.ReadAllText(file));
var cert = a["Certificates"][0];
// Get the UIDs for the existing boards and circuits.
var boards = cert["Boards"].Select (x => (Guid)x["UniqueId"]).ToArray();
var circuits = cert["Boards"].SelectMany (x => x["Circuits"]).Select (x => (Guid)x["UniqueId"]).ToArray();
seankearon / CreateAndQuery.cs
Last active September 7, 2016 21:36
Marten Queries
View CreateAndQuery.cs
using System;
using System.Collections.Generic;
using System.Linq;
using Marten;
using Xunit;
namespace marten_test
public class CreateAndQuery
View SB Choco
# PLUS: npm install --global --production windows-build-tools
choco install spotify -y
choco install visualstudiocode -y
choco install microsoftazurestorageexplorer -y
choco install sourcetree --version -y
choco install webstorm -y
choco install jetbrainstoolbox -y
# not updated choco install jetbrains-rider -y
choco install balsamiqmockups3 -y
seankearon / gist:de261ac578de1a735b26f23b0ce78155
Created August 31, 2017 07:29 — forked from robertpi/gist:2964793
F# record implementing an interface
View gist:de261ac578de1a735b26f23b0ce78155
namespace MyNamespace
type IMyInterface =
abstract GetValue: unit -> string
type MyRecord =
{ MyField1: int
MyField2: string }
interface IMyInterface with
member x.GetValue() = x.MyField2
View Installing a Topshelf Service in OctopusDeploy
Deployment steps for this blog post: