Skip to content

Instantly share code, notes, and snippets.

View bitprophet's full-sized avatar
😅
Looking for work in 2024.H2! Hire me?

Jeff Forcier bitprophet

😅
Looking for work in 2024.H2! Hire me?
View GitHub Profile

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:

@bitprophet
bitprophet / test_grok.rb
Created December 16, 2011 20:15
How to quickly test pure-Ruby Grok pattern strings
# Obtain pure-Ruby lib
require 'grok-pure'
# Create grok instance
grok = Grok.new
# Map some regex patterns to pattern names; this sets up %{FOO}
grok.add_pattern("FOO", "[abc]")
# And/or load from file -- highly useful is the patterns/grok-patterns file that ships with Logstash source

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:

@bitprophet
bitprophet / readme.md
Created September 15, 2013 04:12 — forked from coderanger/pycon.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

#!/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|
» python2.6 -c "print 3/2"
1
» python3 -c "print(3/2)"
1.5
» 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'.
  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 December 17, 2015 00:29
The problem with unittest

(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