Skip to content

Instantly share code, notes, and snippets.

@aphyr
aphyr / gist:6f0923c508e8741d59a5
Created December 23, 2014 20:53
Riemann hysterisis
(defn hysteresis?
"Returns an event predicate which tests the metric of an event and allows
for hysteresis. Requires two predicates to test metrics: a trigger?
predicate and a hold? predicate. trigger? and hold? should be defined
such that if trigger? is true, then hold? is true (and, conversely, if
hold? is false, then trigger? is false).
If the metric is true for trigger?, hyesteresis? will return true. If
the metric returns false for hold?, hystersis? will return false. If
hold? is true and trigger? is false, hysteresis? will return the value
it returned for the previous invocation of hysteresis?. That is,
@brandonb927
brandonb927 / osx-for-hackers.sh
Last active November 14, 2024 17:18
OSX for Hackers: Yosemite/El Capitan Edition. This script tries not to be *too* opinionated and any major changes to your system require a prompt. You've been warned.
#!/bin/sh
###
# SOME COMMANDS WILL NOT WORK ON macOS (Sierra or newer)
# For Sierra or newer, see https://github.com/mathiasbynens/dotfiles/blob/master/.macos
###
# Alot of these configs have been taken from the various places
# on the web, most from here
# https://github.com/mathiasbynens/dotfiles/blob/5b3c8418ed42d93af2e647dc9d122f25cc034871/.osx