Skip to content

Instantly share code, notes, and snippets.

using System;
namespace Blah {
[AttributeUsage(AttributeTargets.Parameter, AllowMultiple = true)]
public sealed class ValidatedNotNullAttribute : Attribute
{
}
public static class Guard
@ctolkien
ctolkien / gulpfile.js
Created March 4, 2015 06:16
asp.net 5 gulpfile
var gulp = require('gulp');
var bower = require('gulp-bower');
var less = require('gulp-less');
var sourcemaps = require('gulp-sourcemaps');
var aspnetk = require("gulp-aspnet-k");
var imagemin = require('gulp-imagemin');
var pngquant = require('imagemin-pngquant');
var gutil = require('gulp-util');
var plumber = require('gulp-plumber');
var colors = require('colors');
@fschmied
fschmied / gist:418e38425f83fb81b833
Created January 6, 2015 19:52
Catch-up subscription
public class EventSubscriber : IEventSubscriber
{
private IReadModelPersistence _persistence;
public void CatchUpAndSubscribe (IEventBus eventBus, IEventStore eventStore)
{
CatchUpUntilNow(eventStore);
eventBus.Subscribe (this);
CatchUpUntilNow(eventStore);
}

Rich Hickey on becoming a better developer

Rich Hickey • 3 years ago

Sorry, I have to disagree with the entire premise here.

A wide variety of experiences might lead to well-roundedness, but not to greatness, nor even goodness. By constantly switching from one thing to another you are always reaching above your comfort zone, yes, but doing so by resetting your skill and knowledge level to zero.

Mastery comes from a combination of at least several of the following:

@kolektiv
kolektiv / Snowflake Code Dump
Created December 29, 2014 17:35
Snowflake Generation
module Cells =
// Types
type LifeSpec =
| LifeSpec of GenerationSpec list
and GenerationSpec =
| GenerationSpec of strength: int * liveness: (int -> bool)
@0xabad1dea
0xabad1dea / singularthey.md
Last active June 18, 2022 18:01
Singular They in Technical English

Guidelines for Singular They in Technical English

by 0xabad1dea, December 2014

This document is an RFC of sorts for increasing the adoption rate of Singular They in technical English. This is not an ultimatum; this is not shaming anyone who has done otherwise; and this is definitely not applicable to any other language.

What is Singular They?

@jkonecki
jkonecki / RavenDBTransientErrorDetectionStrategy
Created October 10, 2014 09:30
Transient error detection strategy for RavenDB using Microsoft.Practices.TransientFaultHandling application block
using Microsoft.Practices.TransientFaultHandling;
public class RavenDBTransientErrorDetectionStrategy : ITransientErrorDetectionStrategy
{
public bool IsTransient(Exception ex)
{
dynamic currentException = ex;
while(currentException != null)
{
@rtaibah
rtaibah / gist:0922731c452c6d1ab682
Last active October 10, 2017 19:44
Linux Mint 17 + Xmonad on Macbook Pro Retina 15

Base installations

sudo apt-get install blueman build-essentials calcurse chromium-browser cpufrequtils gnupg2 gparted hfsprogs imagemagick linux-tools-common lxappearance mplayer rtorrent ruby skype ubuntu-restricted-essentials urlview vagrant vim xclip

System Configurations

Lastpass

namespace WebSocket
// Appache 2.0 license
// References:
// [1] Proposed WebSockets Spec December 2011 http://tools.ietf.org/html/rfc6455
// [2] John McCutchan (Google Dart Team Member) http://www.altdevblogaday.com/2012/01/23/writing-your-own-websocket-server/
// [3] A pretty good Python implemenation by mrrrgn https://github.com/mrrrgn/websocket-data-frame-encoder-decoder/blob/master/frame.py
// [4] WebSockets Organising body http://www.websocket.org/echo.html
// [5] AndrewNewcomb's Gist (starting point) https://gist.github.com/AndrewNewcomb/711664
@thefringeninja
thefringeninja / gist:1860325ad6dcf490795b
Created May 27, 2014 16:47
MessagingAcceptanceTests
public interface MessageFormatter
{
byte[] Serialize(object message);
object Deserialize(byte[] data, Type type);
}
public class NetDataContractMessageFormatter : MessageFormatter
{
private readonly NetDataContractSerializer serializer;