Skip to content

Instantly share code, notes, and snippets.

View BrandonBrowning's full-sized avatar
💭
🐔 chicken 🥗 salad, yummy yummy!

Brandon Browning BrandonBrowning

💭
🐔 chicken 🥗 salad, yummy yummy!
View GitHub Profile
@BrandonBrowning
BrandonBrowning / gist:a17ddbaa0a597e169432
Created October 8, 2014 22:27
pkgconf - NuGet package.config fragmentation evaluator
$ErrorActionPreference = "Stop"
$dict_type = "system.collections.generic.dictionary"
$set_type = "system.collections.generic.hashset"
# project -> package id -> version
$projectToPackageVersion = @{}
# package id -> version -> project
// Turns nice amount per time interval phrases to costs per month
// Fully typed and reusable parsers for all parts of the process
// Ex: $5.10 per day -> $155.227850 per month
// Ex: $20.50 per 8 hours -> $1871.865250 per month
module TimeInterval
open System
@BrandonBrowning
BrandonBrowning / gist:935043e4f54942fbba34
Last active August 29, 2015 14:02
pk - Azure Table Storage Log Partition Key Generator
# pk: pk - Azure Table Storage Log Partition Key Generator
# by Brandon Browning
#
# Usage: pk [time-expression]...
# Time expression examples: +5s, -1h15s, 30m
# Examples:
# pk # Gets current time keys
# pk -30s # Gets time keys 30 seconds ago
# pk 0s -1h5s # Gets time keys now, and 1 hour 5 seconds ago
# Example output:
@BrandonBrowning
BrandonBrowning / gist:8482007
Last active January 3, 2016 15:19
Simple throttle and debounce
// Transforms a function to throw away calls that occur within a timeframe after being called.
// ms: number - milliseconds to throw away /result/ calls after calling /f/
// f: function - wrapped with throttling behaivor as /result/
// result: function - throttled version of /f/
function throttle(ms, f) {
return function inner() {
if (!inner.throttle) {
f();
inner.throttle = setTimeout(function() {
@BrandonBrowning
BrandonBrowning / gist:6373772
Last active December 12, 2021 09:01
Simple CSS Parser in F#
// TODO: Fixme
open System
open FParsec
type Css = CssDefinition list
and CssDefinition = CssSelector * CssRule list
and CssSelector = CssSelectorPart list
and CssSelectorPart = CssTag * CssModifier list
@BrandonBrowning
BrandonBrowning / gist:6368168
Last active December 21, 2015 21:29
Simple Json Parser in F# (with FParsec, very lightly tested)
open System
open FParsec
type Json =
| JsonObject of (string * Json) list
| JsonArray of Json list
| JsonNumber of double
| JsonString of string