Skip to content

Instantly share code, notes, and snippets.

View timbertson's full-sized avatar

Tim Cuthbertson timbertson

View GitHub Profile
#!/bin/bash
set -eu
output="/tmp/$$.log"
idx=0
touch "$output"
NTH_LINE="${NTH_LINE:-100}"
ERROR_LINES="${ERROR_LINES:-200}"
function cleanup () {
rm -f "$output"

Keybase proof

I hereby claim:

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

To claim this, I am signing this object:

#!/usr/bin/env bash
# usage:
# bash <(curl -sS https://gist.githubusercontent.com/timbertson/f643b8ae3a175ba8da7f/raw/travis-nix-bootstrap.sh)
# source $HOME/.nix-profile/etc/profile.d/nix.sh
_() {
set -eu
export NIX_CURL_FLAGS=-sS
if [ ! -e /nix ]; then
if [ "${CI:-null}" != "true" ]; then
@timbertson
timbertson / etcd-ca-disable-p224.patch
Created August 28, 2014 00:10
etcd-ca-disable-p224.patch
diff --git a/pkcs10.go b/pkcs10.go
index a257e20..6550702 100644
--- a/pkcs10.go
+++ b/pkcs10.go
@@ -169,9 +169,9 @@ func CreateCertificateSigningRequest(rand io.Reader, template *CertificateSignin
publicKeyAlgorithm.Algorithm = oidPublicKeyRSA
case *ecdsa.PrivateKey:
switch priv.Curve {
- case elliptic.P224(), elliptic.P256():
- hashFunc = crypto.SHA256
var makeDomNode = (function() {
/* convert an arbitrary HTML string -> dom node.
* This function adapted from JQuery code (src/manipulation.js),
* which is distributed under the MIT licence, and is
* Copyright 2013 jQuery Foundation and other contributors
* http://jquery.com/
*/
var rtagName = /<([\w:]+)/;
var wrapMap = {
// Support: IE 9
@timbertson
timbertson / python-distribute.xml
Created March 17, 2012 01:17
python-distribute 0install feed
<?xml version="1.0"?>
<?xml-stylesheet type='text/xsl' href='interface.xsl'?>
<interface xmlns="http://zero-install.sourceforge.net/2004/injector/interface" xmlns:compile="http://zero-install.sourceforge.net/2006/namespaces/0compile" uri="http://gfxmonk.net/dist/0install/python-distribute.xml">
<name>python-distribute</name>
<summary>python packaging tool</summary>
<publish xmlns="http://gfxmonk.net/dist/0install" mode="third-party"/>
<description>
python packaging tool, a fork of setuptools</description>
<homepage>http://packages.python.org/distribute/</homepage>
<package-implementation package="python-distribute"/>
@timbertson
timbertson / rake.log
Created February 19, 2012 04:13
build-couchdb issue #25 info
This file has been truncated, but you can view the full file.
STDOUT Build CouchDB commit: 106ba9ded5ae939fe03d806d302c664ae7499466
STDERR mkdir -p /home/tim/dev/web/couchdb/build-couchdb/head/build/bin
STDERR /home/tim/dev/web/couchdb/build-couchdb/head/dependencies/autoconf-2.59/configure --prefix=/home/tim/dev/web/couchdb/build-couchdb/head/build --program-suffix=2.59
STDOUT checking for a BSD-compatible install... /usr/bin/install -c
STDOUT checking whether build environment is sane... yes
STDOUT checking for gawk... gawk
STDOUT checking whether make sets $(MAKE)... yes
STDOUT checking for expr... /usr/bin/expr
STDOUT checking for gm4... no
STDOUT checking for gnum4... no
@timbertson
timbertson / makeshift_cucumber.py
Created January 26, 2011 06:49
This is just a quick hack, I hope to make it a proper library soon.
import unittest
class StepCollection(object):
def __setattr__(self, attr, val):
if hasattr(self, attr):
raise RuntimeError("step %s is already declared!" % (attr,))
return super(StepCollection, self).__setattr__(attr, val)
class Object(object): pass
class World(unittest.TestCase):
def __init__(self):
diff --git a/src/watchdog/observers/inotify.py b/src/watchdog/observers/inotify.py
index 4ea8004..ac6136f 100644
--- a/src/watchdog/observers/inotify.py
+++ b/src/watchdog/observers/inotify.py
@@ -688,6 +688,7 @@ if platform.is_linux():
EventEmitter.__init__(self, event_queue, watch, timeout)
self._lock = threading.Lock()
self._inotify = Inotify(watch.path, watch.is_recursive)
+ self._moved_from_events = dict()
require 'spec/runner/formatter/specdoc_formatter'
#monkey-patch the specdoc formatter to immediately print failure messages (and continue)
module Spec
module Runner
module Formatter
class SpecdocFormatter
alias :example_failed_without_immediate_feedback :example_failed
def example_failed(example, counter, failure)
example_failed_without_immediate_feedback(example, counter, failure)