Skip to content

Instantly share code, notes, and snippets.

@jed
jed / LICENSE.txt
Created May 20, 2011 13:27 — forked from 140bytes/LICENSE.txt
generate random UUIDs
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
Version 2, December 2004
Copyright (C) 2011 Jed Schmidt <http://jed.is>
Everyone is permitted to copy and distribute verbatim or modified
copies of this license document, and changing it is allowed as long
as the name is changed.
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
@gregoryyoung
gregoryyoung / ProbabilityKata
Created June 10, 2011 09:56
Greg Young's Probability Kata
Value objects are an important concept in DDD. This kata is made both to learn value objects and to learn better ways of testing.
Write a probability value object. It should contain the following methods:
Probability CombinedWith(Probability)
Probability InverseOf()
Probability Either(Probability)
if you forget your probability math:
Either:P(A) + P(B) - P(A)P(B)
CombinedWith: P(A)P(B)
@michiel
michiel / cors-nginx.conf
Created July 5, 2011 10:41
Wide-open CORS config for nginx
#
# Wide-open CORS config for nginx
#
location / {
if ($request_method = 'OPTIONS') {
add_header 'Access-Control-Allow-Origin' '*';
#
@tormodfj
tormodfj / gist:1075744
Created July 11, 2011 12:27
Binding log4net's ILog using Ninject
Bind<ILog>().ToMethod(context => LogManager.GetLogger(context.Request.Target.Member.DeclaringType));
@nicolas-brousse
nicolas-brousse / convert_svn_to_git.sh
Last active September 28, 2015 03:07
Convert svn repository to Git repository
#! /bin/sh
#
# Convert svn repository to Git repository
# Author: Nicolas Brousse <[email protected]>
# Date: 2013-10-02 17:28:01 UTC
#
# Thanks to: http://www.mabishu.com/blog/2011/01/13/migrate-subversion-repository-to-git-without-loosing-data/
#
set -e
@steff-mueller
steff-mueller / Tutorial.markdown
Created December 26, 2011 11:24
Authentication and authorization in ServiceStack
@ziadoz
ziadoz / awesome-php.md
Last active May 8, 2025 07:37
Awesome PHP — A curated list of amazingly awesome PHP libraries, resources and shiny things.
@adiel
adiel / CoypuCustomProfile.cs
Created January 27, 2012 11:37
Using a custom firefox profile with Coypu
[Test]
public void CustomProfile()
{
Configuration.Driver = typeof (CustomFirefoxProfileSeleniumWebDriver);
Browser.Session.Visit("https://www.relishapp.com/");
}
public class CustomFirefoxProfileSeleniumWebDriver : SeleniumWebDriver
{
@motowilliams
motowilliams / ServiceStackTextFormatter.cs
Created February 22, 2012 04:03
aspnet web api json MediaTypeFormatter using Servicestack.Text
public class ServiceStackTextFormatter : MediaTypeFormatter
{
public ServiceStackTextFormatter()
{
// Fill out the mediatype and encoding we support
SupportedMediaTypes.Add(new MediaTypeHeaderValue("application/json"));
Encoding = new UTF8Encoding(false, true);
}
protected override Task<object> OnReadFromStreamAsync(Type type, Stream stream, HttpContentHeaders contentHeaders, FormatterContext formatterContext)
@phillip-haydon
phillip-haydon / Blobbed.cs
Created February 28, 2012 23:35
NHibernate Custom User Type for serializing a property to JSON
[Serializable]
public class Blobbed<T> : IUserType where T : class
{
public new bool Equals(object x, object y)
{
if (x == null && y == null)
return true;
if (x == null || y == null)
return false;