Skip to content

Instantly share code, notes, and snippets.

View jonashw's full-sized avatar

Jon Wilson jonashw

  • Yolo County, California
View GitHub Profile
@jonashw
jonashw / Sample Sum Type
Last active June 20, 2016 18:24
This is typically how I implement a sum type in C# for day-to-day use. At the bottom is the code I wish I could write instead.
//So much boilerplate!
public abstract class UserAccountCreationResult
{
private UserAccountCreationResult() { }
public UserAccountCreationResult AsBaseType() => this;
//Emulate pattern matching
public abstract T Match<T>(
Func<Success, T> success,
Func<WeakPassword, T> weakPassword,
SELECT
p.ProjectID,
p.FourHTitle,
rt.RecordTypeID,
rt.RecordTypeName,
rt.RecordTypeDescription,
( SELECT COUNT(1)
FROM c_RecordTypeConfiguration
WHERE OrganizationID = 25
AND RecordTypeID = rt.RecordTypeID
function extend(destination, source) {
for (var k in source) {
if (source.hasOwnProperty(k)) {
destination[k] = source[k];
}
}
return destination;
}
function getFileServicesHost() {
let mapleader=","
"enable pathogen
filetype off
call pathogen#runtime_append_all_bundles()
call pathogen#helptags()
"git status on statusline
set statusline=%t
set statusline+=%m
set statusline+=\ %{fugitive#statusline()}