Skip to content

Instantly share code, notes, and snippets.

View efvincent's full-sized avatar

Eric Vincent efvincent

View GitHub Profile
@swlaschin
swlaschin / effective-fsharp.md
Last active September 17, 2025 06:47
Effective F#, tips and tricks

Architecture

  • Use Onion architecture

    • Dependencies go inwards. That is, the Core domain doesn't know about outside layers
  • Use pipeline model to implement workflows/use-cases/stories

    • Business logic makes decisions
    • IO does storage with minimal logic
    • Keep Business logic and IO separate
  • Keep IO at edges

##
# Creates an alias called "git hist" that outputs a nicely formatted git log.
# Usage is just like "git log"
# Examples:
# git hist
# git hist -5
# git hist <branch_name>
# git hist <tag_name> -10
##
git config --global alias.hist "log --pretty=format:'%C(yellow)[%ad]%C(reset) %C(green)[%h]%C(reset) | %C(red)%s %C(bold red){{%an}}%C(reset) %C(blue)%d%C(reset)' --graph --date=short"
@lperrin
lperrin / gist:5934098
Created July 5, 2013 12:04
A quick example of circular dependency with node.js. This code will crash unexpectedly because module A is only partially loaded by C.
// a.js
var moduleB = require('./b');
function ModuleA() {
}
ModuleA.hello = function () {
console.log('hello!');
};
@connor
connor / .jshintrc.js
Created January 11, 2012 22:20
jshintrc example
// NOTE: I added the .js extension to this gist so it would have syntax highlighting. This file should have NO file extension
{
// Settings
"passfail" : false, // Stop on first error.
"maxerr" : 100, // Maximum error before stopping.
// Predefined globals whom JSHint will ignore.
"browser" : true, // Standard browser globals e.g. `window`, `document`.