Skip to content

Instantly share code, notes, and snippets.

View wallymathieu's full-sized avatar

Oskar Gewalli wallymathieu

View GitHub Profile
@rofr
rofr / 0. Output.txt
Last active January 5, 2017 11:30
OrigoDB simplified - complete engine in 50 lines of code. 2000 writes per second, 3 million reads
Num threads: 10
Start: 2015-08-20 01:42:10
Reads: 133758452
Writes: 66050
Reads/s: 4458615,06666667
Writes/s: 2201,66666666667
Total: 133824502
TPS: 4460816,73333333
Stop time: 2015-08-20 01:42:50
@subfuzion
subfuzion / global-gitignore.md
Last active May 5, 2024 19:34
Global gitignore

There are certain files created by particular editors, IDEs, operating systems, etc., that do not belong in a repository. But adding system-specific files to the repo's .gitignore is considered a poor practice. This file should only exclude files and directories that are a part of the package that should not be versioned (such as the node_modules directory) as well as files that are generated (and regenerated) as artifacts of a build process.

All other files should be in your own global gitignore file:

  • Create a file called .gitignore in your home directory and add any filepath patterns you want to ignore.
  • Tell git where your global gitignore file is.

Note: The specific name and path you choose aren't important as long as you configure git to find it, as shown below. You could substitute .config/git/ignore for .gitignore in your home directory, if you prefer.

@davidfowl
davidfowl / dotnetlayout.md
Last active May 8, 2024 07:49
.NET project structure
$/
  artifacts/
  build/
  docs/
  lib/
  packages/
  samples/
  src/
 tests/
@isaacabraham
isaacabraham / idiomaticjsonserialiser.fs
Created September 7, 2014 21:17
This JSON.Net converter handles F# discriminated unions with more "idiomatic" JSON than what is generated by the current version of JSON .NET. Option types and single case DUs are transparently handled, and tuple-style properties are used rather than array notation.
namespace Newtonsoft.Json.Converters
open Microsoft.FSharp.Reflection
open Newtonsoft.Json
open System
type IdiomaticDuConverter() =
inherit JsonConverter()
[<Literal>]
@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)
@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");
}
}
@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
@AnthonyMastrean
AnthonyMastrean / nuspec.rb
Created September 27, 2012 21:32
Automatic discovery of NuGet dependencies.
def auto_add_dependencies(projects)
projects.each do |project|
each_project_dependency do |dependency|
@dependencies.push dependency
end
end
end
def get_packages_config(project)
return File.join File.dirname project, 'packages.config'
[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");
}
}
@sciolist
sciolist / example.rb
Created August 16, 2012 20:46
Use some simple ngrams to figure out what method you wanted to call!
require './oh_god_why'
class Object
include FigureItOut
end
str = "hello, world."
puts str.make_upper_case # HELLO, WORLD.
this = "this be some text"