Skip to content

Instantly share code, notes, and snippets.

View sledorze's full-sized avatar

Stéphane Le Dorze sledorze

View GitHub Profile
@sledorze
sledorze / GuidGenerator.cs
Created January 29, 2018 11:04 — forked from jageall/GuidGenerator.cs
Guid from name
public class GuidGenerator
{
public static Guid CreateGuidFromName(Guid @namespace, string name)
{
return CreateGuidFromName(@namespace, name, 5);
}
//Implements rfc 4122
public static Guid CreateGuidFromName(Guid @namespace, string name, int version)
{

Advanced Functional Programming with Scala - Notes

Copyright © 2017 Fantasyland Institute of Learning. All rights reserved.

1. Mastering Functions

A function is a mapping from one set, called a domain, to another set, called the codomain. A function associates every element in the domain with exactly one element in the codomain. In Scala, both domain and codomain are types.

val square : Int => Int = x => x * x
@sledorze
sledorze / abstractions.md
Created December 9, 2015 21:40 — forked from arobson/abstractions.md
Rabbit.MQ + Node.js Notes

Abstraction Suggestions

Summary: use good/established messaging patterns like Enterprise Integration Patterns. Don't make up your own. Don't expose transport implementation details to your application.

Broker

As much as possible, I prefer to hide Rabbit's implementation details from my application. In .Net we have a Broker abstraction that can communicate through a lot of different transports (rabbit just happens to be our preferred one). The broker allows us to expose a very simple API which is basically:

  • publish
  • request
  • start/stop subscription
####################################
# BASIC REQUIREMENTS
# http://graphite.wikidot.com/installation
# http://geek.michaelgrace.org/2011/09/how-to-install-graphite-on-ubuntu/
# Last tested & updated 10/13/2011
####################################
sudo apt-get update
####################################
package Vect
import scala.language.higherKinds
sealed trait Nat
sealed trait Z extends Nat
sealed trait S[N <: Nat] extends Nat
trait Exists[A, +B[_ <: A]] {
type fst <: A
@sledorze
sledorze / VerEx.hx
Created August 6, 2013 12:53 — forked from dpeek/VerEx.hx
class VerEx
{
public static function main()
{
var test = new VerEx()
.startOfLine()
.then("http")
.maybe("s")
.then("://")
.maybe("www.")
@sledorze
sledorze / 960gs.less
Created September 21, 2011 19:48 — forked from Aeon/960gs.less
LessCSS and 960gs don't play well together normally. Here's the definitions for 960gs to let LessCSS work with it. Looks like we can pull all grid data out of the HTML.
/**
* A LessCSS version of the 960 Grid System
*
* http://lesscss.org/
* http://960.gs/
*/
/*********************************************************************
* Settings *
*********************************************************************/