Skip to content

Instantly share code, notes, and snippets.

@toburger
toburger / prompt.ps1
Last active March 16, 2019 11:16 — forked from kadet1090/prompt.ps1
PowerLine like prompt for PowerShell
$script:bg = [Console]::BackgroundColor;
$script:first = $true;
$script:last = 0;
function Write-PromptFancyEnd {
Write-Host-NoNewline -ForegroundColor $script:bg
$script:bg = [System.ConsoleColor]::Black
}
@toburger
toburger / idiomaticjsonserialiser.fs
Last active May 9, 2021 00:15 — forked from isaacabraham/idiomaticjsonserialiser.fs
This JSON.Net converter handles F# discriminated unions with more "idiomatic" JSON than what is generated by the current version of JSON .NET. Option types and single case DUs are transparently handled, and tuple-style properties are used rather than array notation.
namespace Newtonsoft.Json.Converters
open Microsoft.FSharp.Reflection
open Newtonsoft.Json
open System
type IdiomaticDuConverter() =
inherit JsonConverter()
[<Literal>]
(*
ParserLibrary.fsx
Final version of a parser library.
Related blog post: http://fsharpforfunandprofit.com/posts/understanding-parser-combinators-3/
*)
module ParserLibrary
(*
JsonParser.fsx
A JSON parser built from scratch using a combinator library.
Related blog post: http://fsharpforfunandprofit.com/posts/understanding-parser-combinators-4/
*)
module JsonParser
void Main()
{
var result =
from g in AllGames()
let _ = Sort(g.Goals)
select new { Team1 = g.Team1, Team2 = g.Team2, Goals = g.Goals };
result.Dump();
}
// Define other methods and classes here
from xy in Pois
where xy.Primarytype == "museen"
from xz in PoiDetails
where xz.PoiId == xy.Id && xz.Lang == "de"
from xw in InfoBoards
where xw.PoiDetailsId == xz.Id
select new
{
SMGId = xy.Id,
SMGPoiname = xy.Nodename,
@toburger
toburger / dabblet.css
Created April 4, 2013 15:59 — forked from anonymous/dabblet.css
Untitled
nav {
width: 100%;
float: left;
}
nav ul {
list-style: none;
padding: 0px;
margin: 0px;
}
nav li {
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
namespace Intranet
{
public static class CustomBreadcrumpCMS
@toburger
toburger / dabblet.css
Created April 4, 2013 09:27 — forked from anonymous/dabblet.css
Simple CSS only flyout menu
/**
* Simple CSS only flyout menu
*/
body {
background: #f06;
background: linear-gradient(45deg, #f06, yellow);
min-height: 100%;
font-family: Arial;
}
@toburger
toburger / dabblet.css
Created April 3, 2013 10:04 — forked from anonymous/dabblet.css
Untitled
nav {
width: 100%;
float: left;
}
nav ul {
list-style: none;
padding: 0px;
margin: 0px;
}
nav li {