Skip to content

Instantly share code, notes, and snippets.

@stilist
stilist / LICENSE
Created February 3, 2017 01:06
Uninstall all non-default Ruby gems
Copyright (c) 2017 Jordan Cole
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR O
@stilist
stilist / monitoring.md
Last active October 27, 2020 05:36
Notes on site reliability

Monitoring

Alerting

  • base rate fallacy: given 1% false positive, 1% false negative, and 99.9% uptime: 9.1% chance positive predictive value (true positive)
  • sensitivity (% true positives) vs specificity (% not false positive)
  • ‘Alert liberally; page judiciously. Page on symptoms, rather than causes.’
  • ‘An alert should communicate something specific about your systems in plain language: “Two Cassandra nodes are down” or “90% of all web requests are taking more than 0.5s to process and respond.”’
  • ‘Not all alerts carry the same degree of urgency.’
  • ‘Many alerts will not be associated with a service problem, so a human may never even need to be aware of them. […] should generate a low-urgency alert that is recorded in your monitoring system for future reference or investigation but does not interrupt anyone’s work.’
@stilist
stilist / .ruby-version
Last active February 29, 2016 18:11
MultiJSON vs standard library JSON (derived from http://gist.github.com/eirc/1300627)
2.3.0
@stilist
stilist / LICENSE
Created January 9, 2016 23:53
Simple clock that uses quipu numbering
Copyright (c) 2016 Jordan Cole
Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in
the Software without restriction, including without limitation the rights to
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
of the Software, and to permit persons to whom the Software is furnished to do
so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
@stilist
stilist / LICENSE
Last active May 3, 2016 15:27
RFC 3966 regex
Copyright (c) 2016 Jordan Cole
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR O
@stilist
stilist / conrec.js
Last active August 29, 2015 14:24
US wind speed
/**
* Copyright (c) 2010, Jason Davies.
*
* All rights reserved. This code is based on Bradley White's Java version,
* which is in turn based on Nicholas Yue's C++ version, which in turn is based
* on Paul D. Bourke's original Fortran version. See below for the respective
* copyright notices.
*
* See http://local.wasp.uwa.edu.au/~pbourke/papers/conrec/ for the original
* paper by Paul D. Bourke.
@stilist
stilist / index.html
Last active August 29, 2015 14:24
US air quality
<!doctype html>
<meta charset='utf-8'>
<style>
.data-datapoint {fill:transparent; stroke-width:1px;}
.aqi1 {stroke:#00e400;}
.aqi2 {stroke:#ffff00;}
.aqi3 {stroke:#ff7e00;}
.aqi4 {stroke:#ff0000;}
.aqi5 {stroke:#99004c;}
@stilist
stilist / index.html
Last active April 19, 2016 06:33
Aurora map
<!doctype html>
<meta charset='utf-8'>
<style>
.n0 {fill:#f7fcf5;}
.n1 {fill:#e5f5e0;}
.n2 {fill:#c7e9c0;}
.n3 {fill:#a1d99b;}
.n4 {fill:#74c476;}
.n5 {fill:#41ab5d;}
.n6 {fill:#238b45;}
@stilist
stilist / clear_build_target_test.js
Created November 12, 2014 02:17
Unusable test for clear-broccoli-build-target
'use strict'
var Builder = require('broccoli').Builder,
// see https://github.com/stilist/clear-broccoli-build-target
clearBuildTarget = require('../lib/clear-build-target'),
fs = require('fs-extra'),
test = require('tap').test
test('clear build target', function (t) {
var test_dir = 'tmp_test'
@stilist
stilist / .bash_profile
Created September 2, 2014 17:32
line count change for current git branch
function parse_git_branch () {
local git_status="`git status -unormal 2>&1`"
# http://toucware.blogspot.com/2012/05/partial-string-matching-in-bash.html
#
# TODO Catch case when repo is initialized but not committed.
if [[ "$git_status" == fatal* ]] ; then
echo ""
else
# http://stackoverflow.com/a/11958481/672403