Skip to content

Instantly share code, notes, and snippets.

@fawkesley
fawkesley / gist:9488524
Created March 11, 2014 15:46
Backdrop logstash format
{
"@fields":{
"relativeCreated":344.9680805206299,
"process":12223,
"args":[
],
"module":"log_handler",
"funcName":"set_up_logging",
"message":"backdrop.read.api logging started",
@rooreynolds
rooreynolds / pivotal_parse.rb
Last active December 31, 2015 05:49
Simple Ruby script to parse Pivotal Tracker CSV export and extract useful data. See comments below for usage. [Revision 5: adds output of total points per sprint]
require 'csv'
require 'sqlite3'
def setupDB(db, csv_file)
db.execute("drop table if exists stories")
db.execute("create table stories(id, labels, iterationend, created, accepted, size, requester, owner, type)")
CSV.foreach(File.path(csv_file), :headers => true) do |col|
db.execute("insert into stories(id, labels, iterationend, created, accepted, size, requester, owner, type) " +
"VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?)",
[col['Id'],
@nvie
nvie / ormtools.py
Created November 29, 2013 08:59
Really useful helper that I use constantly to force myself to write more efficient Django queries.
from contextlib import contextmanager
from django.conf import settings
from django.db import connection
@contextmanager
def no_queries_allowed():
"""This is a helper method that makes it easier during development, by
throwing an exception when any queries are made within its block. Using
@mbostock
mbostock / .block
Last active December 11, 2023 06:50 — forked from hail2u/twitter-bird.svg
Twitter SVG Logo
license: gpl-3.0
@timblair
timblair / gist:942151
Created April 26, 2011 12:09
National Rail really is run by a bunch of monkeys...
$ curl --silent -i http://ojp.nationalrail.co.uk/ | grep 'Powered-By'
X-Powered-By: An infinite number of monkeys