Skip to content

Instantly share code, notes, and snippets.

Avatar
😩
Focused on features & crit bugfixes, no time for triage rn

Jeff Forcier bitprophet

😩
Focused on features & crit bugfixes, no time for triage rn
View GitHub Profile
View kungfu.md

Kung fu / wuxia / martial arts / etc to watch or rewatch

Key:

  • amz - Amazon Prime
  • amz rental - one-off Amazon streaming rental
  • netflix - Netflix streaming. (Many flicks are available on both Amazon streaming and Netflix DVD, so if you've got Netflix DVD...make sure to check there too)
  • torrented - I definitely did not torrent these but they're typically available via DVD or Bluray only channels

The list:

View keybase.md

Keybase proof

I hereby claim:

  • I am bitprophet on github.
  • I am bitprophet (https://keybase.io/bitprophet) on keybase.
  • I have a public key ASAZCF4Ctfj9SnXf5AvlefRiQZufvRPRV6B8dSb63TgquQo

To claim this, I am signing this object:

View readme.md

1: Application Deployment State of the Onion

An overview of the moving pieces in app deployment currently (ex. chef, puppet, salt, ansible, git, omnibus, compass, less, DB migrations, databases).

Description

Deploying a moderately complex web application has become quite a challenge over the years. As best-practices have evolved, it has become progressively more time-consuming to keep up with what tools exist and how to use them effectively. This talk will provide an overview of the ecosystem and provide pointers for more information about individual components or problems.

Audience

View seek.rb
#!/usr/bin/env ruby
# Parse changelogs per branch
changelogs = {}
# Start at 1.2 because we don't have 1.1.0 in the new format. NBD, 1.1 is old
# as shit anyway.
releases = 2.upto(7).map {|x| "1.#{x}"}
target = /\* :(?<type>feature|bug|support|release):`((?<issue_no>\d+)|(?<release_no>\S+) <[^>]+>)`/
releases.each do |x|
changelogs[x] = `git show origin/#{x}:docs/changelog.rst`.split(/\n/).map do |line|
View gist:6532805
» python2.6 -c "print 3/2"
1
» python3 -c "print(3/2)"
1.5
View gist:6254428
» inv -h test
Usage: inv[oke] [--core-opts] test [--options] [other tasks here ...]
Docstring:
Run a Spec or Nose-powered internal test suite.
Options:
-m STRING, --module=STRING Just runs tests/STRING.py.
-r STRING, --runner=STRING Use STRING to run tests instead of 'spec'.
View why open source django.md
  1. The code will get better. Linus' Law: "given enough eyeballs, all bugs are shallow": we'll be able to get community contributions and bug reports, and thus the code will grow better faster than we can grow it ourselves. Also, Joy's Law - "No matter who you are, most of the smartest people work for someone else": we'll get better code from people who don't work for us than from people who do.

  2. We'll write better code. Wall's 3rd great virtual of a programmer, Hubris: we'll write better code when we don't want other people to say bad things about us. We'll do better with the world watching than with just us.

  3. Increased ability to hire. We're a 19k circ newspaper in a town most people have never heard of. Open source will help put us on the map, make us a place people actually might be interested in working.

  4. When we do hire, we'll be able to hire peop

@bitprophet
bitprophet / wat.md
Last active Dec 17, 2015
The problem with unittest
View wat.md

(Using fabric/fabric as an example of a unittest style project with a complex, nontrivial test suite)

» find tests -type f -maxdepth 1 -mindepth 1 -name "*.py" | wc -l
    18
» find tests -type f -maxdepth 1 -mindepth 1 -name "test_*.py" | wc -l
    13

75% of the files in my tests folder are tests, yet they must be named test_.

» grep -inr "class " tests/test_* | wc -l
@bitprophet
bitprophet / gist:5493982
Last active Dec 16, 2015
Descartes and external data sources
View gist:5493982

Cluster graphing

  • It's frequently useful to graph a metric over a cluster of hosts, e.g. "show me the number of requests/s being handled by all of my load balancers".
  • Doing this in vanilla Graphite is easy - it honors both glob expressions (lb*) and brace expressions ({a,b,c,d}).
  • But how do we generate these for clusters whose hostnames don't glob well, and/or whose members change over time?

Descartes

  • Generally flippin' awesome.
  • Has a database of Metrics, Graphs composing 1+ Metrics, and Dashboards composing 1+ Graphs.