Skip to content

Instantly share code, notes, and snippets.

View mzupan's full-sized avatar

Mike Zupan mzupan

View GitHub Profile
#!/usr/bin/env python
d = {
'jets': {
'bad': True
},
}
e = {'paul': 'loves V'}
#!/usr/bin/env python
d = {
'football': {
'jets': {
'bad': True
},
}
}
abstract (1.0.0)
actionmailer (3.0.1)
actionpack (3.0.1)
activemodel (3.0.1)
activerecord (3.0.1)
activeresource (3.0.1)
activesupport (3.0.1)
addressable (2.2.2)
arel (1.0.1)
arrayfields (4.7.4)
from django.template import Library, Node, TemplateSyntaxError, resolve_variable
from operations.models import Graph
register = Library()
class RenderGraphList(Node):
def __init__(self, parser, token, t="instance"):
self.tokens = token.contents.split()
if len(self.tokens) != 5:
http://graphite.sc.domain.net/render/?width=586&height=308&_salt=1323199987.015&from=-1hours&title=Recurly%20App%20Requests%20Per%20Second&target=cactiStyle(group(alias(sumSeries(web*_sc_recurly_net.http_logs.recurly.app.http_2xx)%2C%222xx%22)%2Calias(sumSeries(web*_sc_recurly_net.http_logs.recurly.app.http_3xx)%2C%223xx%22)%2Calias(sumSeries(web*_sc_recurly_net.http_logs.recurly.app.http_4xx)%2C%224xx%22)%2Calias(sumSeries(web*_sc_recurly_net.http_logs.recurly.app.http_5xx)%2C%225xx%22)))
@mzupan
mzupan / index.html
Created December 18, 2011 03:02
d3 playgroun
<!DOCTYPE html>
<html>
<head>
<title>Area Chart</title>
<script type="text/javascript" src="http://mbostock.github.com/d3/d3.js"></script>
<style type="text/css">
body {
font: 10px sans-serif;
}
@mzupan
mzupan / index.html
Created December 22, 2011 02:23
transition not working
<!DOCTYPE html>
<html>
<head>
<script src="https://raw.github.com/mbostock/d3/master/d3.js"></script>
<script src="https://raw.github.com/mbostock/d3/master/d3.time.js"></script>
<style type="text/css">
body {
font: 10px sans-serif;
<!DOCTYPE html>
<html>
<head>
<script src="https://raw.github.com/mbostock/d3/master/d3.js"></script>
<script src="https://raw.github.com/mbostock/d3/master/d3.time.js"></script>
<style type="text/css">
body {
font: 10px sans-serif;
def local_sed(filename, before, after, limit='', use_sudo=False, backup=''):
"""
Run a search-and-replace on ``filename`` with given regex patterns.
Equivalent to ``sed -i<backup> -r -e "/<limit>/ s/<before>/<after>/g
<filename>"``.
For convenience, ``before`` and ``after`` will automatically escape forward
slashes, single quotes and parentheses for you, so you don't need to
specify e.g. ``http:\/\/foo\.com``, instead just using ``http://foo\.com``
@mzupan
mzupan / check_monit.py
Created June 11, 2012 17:46
Nagios check for monit services going unmonitored
#!/usr/bin/env python
import urllib2
import base64
import sys
import optparse
from xml.dom.minidom import parseString