This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Based on original by Tobi: https://gist.github.com/617852830394aaaa7160 | |
public class RavenDBDumper | |
{ | |
#region Static Methods | |
private static void Read(JsonReader jsonReader, string arrayName, Action<RavenJToken> process) | |
{ | |
if (jsonReader.Read() == false) | |
return; | |
if (jsonReader.TokenType != JsonToken.PropertyName) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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(); | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Code for review posted here: http://codereview.stackexchange.com/questions/55554/parsing-sections-from-a-log-file-using-f | |
// Here are the "lines" from my "log file". | |
let lines = [1 .. 25] |> List.map (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 | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Get the script's folder | |
function get_script_directory # http://blogs.msdn.com/b/powershell/archive/2007/06/19/get-scriptdirectory.aspx | |
{ | |
$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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Install-Package knockoutjs | |
Install-Package knockout.typescript.DefinitelyTyped | |
Install-Package JasmineTest | |
Install-Package jasmine.typescript.DefinitelyTyped |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Deployment steps for this blog post: | |
http://kearon.blogspot.co.uk/2015/01/installing-service-using-topshelf-with.html |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Use Gists to store code you would like to remember later on | |
console.log(window); // log the "window" object to the console |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function Invoke-Environment { | |
# Source: http://stackoverflow.com/a/4385011/2608 | |
# and https://github.com/nightroman/PowerShelf/blob/master/Invoke-Environment.ps1 | |
param | |
( | |
[Parameter(Mandatory=1)][string]$Command, | |
[switch]$Output, | |
[switch]$Force | |
) | |
$stream = if ($Output) { ($temp = [IO.Path]::GetTempFileName()) } else { 'nul' } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Collections.Generic; | |
using System.Linq; | |
using Marten; | |
using Xunit; | |
namespace marten_test | |
{ | |
public class CreateAndQuery | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
namespace MyNamespace | |
type IMyInterface = | |
abstract GetValue: unit -> string | |
type MyRecord = | |
{ MyField1: int | |
MyField2: string } | |
interface IMyInterface with | |
member x.GetValue() = x.MyField2 |
OlderNewer