Skip to content

Instantly share code, notes, and snippets.

# Usage: $ nix eval "(builtins.attrNames (import (builtins.fetchurl "https://matthewbauer.us/generate-versions.nix") {}).emacs)"
# $ nix run "(import (builtins.fetchurl "https://matthewbauer.us/generate-versions.nix") {}).emacs.\"24.3\"" -u LANG -c emacs
{}:
let
channels = [ "nixos-20.09" "nixos-20.03" "nixos-19.09" "nixpkgs-unstable" ];
getSet = channel: (import (builtins.fetchTarball "channel:${channel}") {inherit (builtins.currentSystem);}).pkgs;
@mausch
mausch / 0_reuse_code.js
Created February 15, 2016 15:28
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
@mausch
mausch / simple_maybe_monad_usage.fs
Created April 1, 2012 15:19 — forked from adinapoli/simple_maybe_monad_usage.fs
A VERY simple application scenario of the Maybe Monad in F#
open FSharpx
/// Type synonyms
type ProductId = string
type Price = float
type Inventory() =
let inv_ = new System.Collections.Generic.Dictionary<ProductId, Price>()
member this.Stock id price =
@mausch
mausch / RegexExtensions.fs
Created January 2, 2012 22:29 — forked from anonymous/RegexExtensions.fs
F# regex active patterns proposal #2 for fsharpx
namespace Extensions
open System.Text.RegularExpressions
///Regex extensions
module Regex =
let replaceWithAcc folder state input (rx: Regex) =
let acc = ref state
let evaluator (m: Match) =
let newState, result = folder !acc m
acc := newState