Skip to content

Instantly share code, notes, and snippets.

View paltman's full-sized avatar

Patrick Altman paltman

View GitHub Profile
@paltman
paltman / README.md
Last active August 29, 2015 14:01 — forked from mbostock/.block
Ticket Sales Over Time

This chart should represent ticket sales over time and features a gradient fill as well as tooltips on data points.

It should look like:

Ticket Sales Over Time Mockup

A line chart with mouseover so that you can read the y-value based on the closest x-value. The x-value is found using d3.mouse and scale.invert. The y-value is then found by bisecting the data.

@paltman
paltman / README.md
Created March 18, 2013 00:41 — forked from mbostock/.block

This examples demonstrates how to use D3's brush component to implement focus + context zooming. Click and drag in the small chart below to pan or zoom.

@paltman
paltman / gist:2470362
Created April 23, 2012 11:40
Sample HTML page with Twitter's Bootstrap, Ryan Fait's Sticky Footer, and a full-width footer
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<meta name="author" content="Martin Bean" />
<title>Twitter&rsquo;s Bootstrap with Ryan Fait&rsquo;s Sticky Footer</title>
<link rel="stylesheet" href="https://raw.github.com/twitter/bootstrap/master/docs/assets/css/bootstrap.css" />
<style>
html, body {
height: 100%;
@paltman
paltman / translate.py
Created August 31, 2011 22:52 — forked from rizumu/translate.py
translate
"""A management command for extracting translation messages for the whole project."""
import glob
import os
from django.conf import settings
from django.core.management.base import NoArgsCommand
class Command(NoArgsCommand):
def elem2dict(node):
"""
Convert an lxml.etree node tree into a dict.
"""
d = {}
for e in node.iterchildren():
key = e.tag.split('}')[1] if '}' in e.tag else e.tag
value = e.text if e.text else elem2dict(e)
d[key] = value
return d
#!/usr/bin/env python
"""
A script to query the Amazon Web Services usage reports programmatically.
Ideally this wouldn't exist, and Amazon would provide an API we can use
instead, but hey - that's life.
Basically takes your AWS account username and password, logs into the
website as you, and grabs the data out. Always gets the 'All Usage Types'
Hosting Sphinx docs at GitHub
-----------------------------
Before: Run sphinx-quickstart in docs/
1. Follow "Project Pages" instructions from http://pages.github.com/ to create a gh-pages branch
2. Add Sphinx html build dir as git submodule:
git checkout master
git submodule add -b gh-pages [email protected]:arthurk/django-disqus.git docs/_build/html
@paltman
paltman / pylink.sh
Created February 28, 2010 05:19 — forked from zvoase/pylink.sh