Skip to content

Instantly share code, notes, and snippets.

View wallymathieu's full-sized avatar

Oskar Gewalli wallymathieu

View GitHub Profile
[AttributeUsage(System.AttributeTargets.All, AllowMultiple = true, Inherited = true)]
public class ಠ_ಠAttribute : Attribute
{
public ILog Log { get; set; }
public ಠ_ಠAttribute()
{
Log.Info("This code is bad and you should feel bad");
}
}
@mat-mcloughlin
mat-mcloughlin / ಠ_ಠAttribute.cs
Created December 11, 2013 16:33
This code is bad and you should feel bad
[AttributeUsage(System.AttributeTargets.All, AllowMultiple = true, Inherited = true)]
public class ಠ_ಠAttribute : Attribute
{
public ILog Log { get; set; }
public ಠ_ಠAttribute()
{
Log.Info("This code is bad and you should feel bad");
}
}
@ecampidoglio
ecampidoglio / git-cpr-alias.md
Created October 30, 2019 12:19
Checkout Pull Request

Checkout Pull Request

A Git alias to quickly check out a Pull Request branch in a single move. ⚡

git config --global alias.cpr '!f() { git fetch --quiet ${GIT_DEFAULT_REMOTE-origin} pull/$1/head:pulls/$1 && git checkout pulls/$1; }; f'

Usage

@henrik
henrik / personnummer.rb
Created January 29, 2009 11:53
Generate valid Swedish personnummer.
# Generator for valid Swedish personnummer: http://en.wikipedia.org/wiki/Personal_identity_number_(Sweden)
# By Henrik Nyh <http://henrik.nyh.se> 2009-01-29 under the MIT license.
require 'date'
module Personnummer
def self.generate(date=nil, serial=nil)
date ||= Date.new(1900+rand(100), 1+rand(12), 1+rand(28))
serial = serial ? serial.to_s : format("%03d", 1+rand(999)) # 001-999
@mrkgnao
mrkgnao / Liege.hs
Last active August 27, 2019 18:11
Servant handled using free monads of coproducts of functors :)
{-# LANGUAGE ApplicativeDo #-}
{-# LANGUAGE ConstrainedClassMethods #-}
{-# LANGUAGE ConstraintKinds #-}
{-# LANGUAGE DataKinds #-}
{-# LANGUAGE DeriveFunctor #-}
{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE FlexibleContexts #-}
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE IncoherentInstances #-}
{-# LANGUAGE InstanceSigs #-}
+--------------------+--------------------+-------------------------+--------------------+
|Operation           | F#+ / F#           |F#+ Haskell Compatibility|Haskell             |
+====================+====================+=========================+====================+
|List.append         | @                  |                         | ++                 |
+--------------------+--------------------+-------------------------+--------------------+
|Function composition| f << g             | f . (g)                 | f . g              |
+--------------------+--------------------+-------------------------+--------------------+
|                    | <|                 | $                       | $                  |
+--------------------+--------------------+-------------------------+--------------------+
@jimeh
jimeh / com.rabbitmq.rabbitmq-server.plist
Created March 24, 2011 10:47
Mac OS X launchctl plist for Homebrew-based RabbitMQ installations. Place in: ~/Library/LaunchAgents
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>KeepAlive</key>
<true/>
<key>Label</key>
<string>com.rabbitmq.rabbitmq-server</string>
<key>Program</key>
<string>/usr/local/sbin/rabbitmq-server</string>
@mausch
mausch / gist:4260932
Created December 11, 2012 18:40
Lenses as category in F#
#r @"bin\debug\FsControl.Core.dll" // from https://github.com/gmpl/FsControl
open System
open FsControl.Core.Abstractions
// generic composition operators for all categories
let inline (>>) g f = Inline.instance (Category.Comp, f) g
let inline (<<) f g = Inline.instance (Category.Comp, f) g
// Lens definition
@ShalokShalom
ShalokShalom / compabilitylistforhaskell.md
Last active March 7, 2018 12:26 — forked from gusty/fsharpplus_haskell_compatibility.md
Haskell operator compatibility layer for F-Sharp
+----------------------+--------------------+--------------------+--------------------+
|      Operation       |      F-Sharp       |     Compability    |      Haskell       |
+======================+====================+====================+====================+
| List.append          |         @          |                    |        ++          |
+----------------------+--------------------+--------------------+--------------------+
| Function composition |       f << g       |       f . (g)      |       f . g        |
+----------------------+--------------------+--------------------+--------------------+
|                      |         =          |        ==          |        ==          |
+----------------------+--------------------+--------------------+--------------------+
@rofr
rofr / Executor.cs
Last active January 5, 2017 11:30
Spiking an async origodb engine using akka.net and EventStore v3
public class Executor : ReceiveActor
{
readonly Kernel _kernel;
public Executor(Kernel kernel)
{
_kernel = kernel;
Receive<Tuple<Command,ActorRef>[]>(ExecuteCommands);
}
private bool ExecuteCommands(Tuple<Command,ActorRef>[] tuples)