This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Collections.Generic; | |
using System.Linq; | |
using System.Text; | |
using System.Threading; | |
namespace Paycento.API.Tasks | |
{ | |
public static class Wait | |
{ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env escript | |
%%! -pa ebin | |
main(_) -> | |
{ok, [T]} = file:consult("ebin/mimetypes.app"), | |
{application, mimetypes, PL} = T, | |
DynMods = [mimetypes:dmodule(),mimetypes:mmodule()], | |
BaseModules = proplists:get_value(modules, PL) -- DynMods, | |
Modules = DynMods ++ BaseModules, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
%% INFRASTRUCTURE CRAP | |
load(Events) -> | |
load(#state{},Events). | |
load(State,[]) -> | |
State; | |
load(State,[Event|RemainingEvents]) -> | |
NewState = change(State,Event), | |
load(NewState,RemainingEvents). | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Erlang R13B04 (erts-5.7.5) [smp:8:8] [rq:8] [async-threads:0] | |
Eshell V5.7.5 (abort with ^G) | |
1> cd('/blah/erlang/CQRS'). | |
C:/blah/erlang/CQRS | |
ok | |
2> ls(). | |
item.erl item.hrl | |
ok | |
3> c(item). |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
namespace Spinner | |
{ | |
class Program | |
{ | |
static void Main(string[] args) | |
{ | |
Console.Write("Working... "); | |
int spinIndex = 0; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-module (ring). | |
-export ([start/3, first_proc/3, first_loop/4, proc_start/3, proc_loop/2]). | |
start(MsgCount, ProcCount, Msg) -> | |
spawn(ring, first_proc, [MsgCount, ProcCount, Msg]). | |
first_proc(MsgCount, ProcCount, Msg) -> | |
io:format("First process ~w created, setting up the rest of the ring ...~n", [self()]), | |
NextPid = spawn(ring, proc_start, [self(), self(), ProcCount-1]), | |
LastPid = receive |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
namespace SimpleMessaging | |
{ | |
public class MessageBox | |
{ | |
Func<dynamic,bool?> Handle; | |
public MessageBox() | |
{ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using Microsoft.VisualStudio.TestTools.UnitTesting; | |
using Shouldly; | |
namespace AutoBDD.Specs | |
{ | |
[TestClass] | |
public class Parse_some_specs | |
{ | |
AutoBDD.Runner SUT = new AutoBDD.Runner(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//Add a comment | |
using System; | |
namespace Example | |
{ | |
public static class Guard | |
{ | |
public static void Against(bool assertion, string message) | |
{ | |
if (assertion) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
dynamic fizzbuzz = new Curry() | |
.On<int>() | |
.When(x => x % 15 == 0).Do(x => "fizzbuzz") | |
.When(x => x % 3 == 0).Do(x => "fizz") | |
.When(x => x % 5 == 0).Do(x => "buzz") | |
.Do(x=>x) | |
.On<IEnumerable<int>>() | |
.Do((s, r) => from val in r select s(r)) | |
.On<string>() | |
.When("fizzbuzz").Do(x => "Aha, you found the easter egg!") |