Skip to content

Instantly share code, notes, and snippets.

View bbangert's full-sized avatar
🦊
Numb Numb

Ben Bangert bbangert

🦊
Numb Numb
View GitHub Profile
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>ofCode</title>
<meta name="google-site-verification" content="mNd96hqqJrfLl0D_QwRfLby5MWWqxHS1pZqqr92aJSQ" /
<!--[if IE]>
<script src="http://assets1.ofcode.org/javascripts/html5.js"></script>
<![endif]-->
% if c.sub_domain == 'paste':
@bbangert
bbangert / rub_before.py
Created October 28, 2010 01:44
Late night boredom
import inspect
import re
class run_before(object):
"""Takes a function, and returns a class/method decorator"""
def __init__(self, func, name_descriminator=r'[^_]+'):
"""Initialize the run_before decorator
Takes a func that will be called every time before any of the
classes methods (or a function itself if directly decorated).
@bbangert
bbangert / fiddle.css
Created October 10, 2011 04:53 — forked from paulrouget/fiddle.css
Firefox HTML Tree Panel
html {
background-color: -moz-dialog;
}
body {
margin: 0;
overflow: auto;
font-family: Lucida Grande, sans-serif;
font-size: 11px;
border-top: 1px solid #BBB9BA;
@bbangert
bbangert / gist:2200435
Created March 25, 2012 22:32
multiple view_configs
@view_config(context=Page, name="edit", route_name="pages", permission="admin")
@view_config(context=Page, name="edit", route_name="pages_by_url", permission="admin")
def view_page_edit(context, request):
return Response("edit '%s'" % context.title)
# would be nice if...
@view_config(context=Page, name="edit", route_name="*", permission="admin")
def view_page_edit(context, request):
return Response("edit '%s'" % context.title)
{-# LANGUAGE QuasiQuotes #-}
{-# LANGUAGE TemplateHaskell #-}
{-# LANGUAGE TypeFamilies #-}
module Main
(
main
) where
import Conduit
Configuring hashable-1.2.2.0...
Building hashable-1.2.2.0...
Preprocessing library hashable-1.2.2.0...
[1 of 3] Compiling Data.Hashable.Class ( Data/Hashable/Class.hs, dist/dist-sandbox-921acbd0/build/Data/Hashable/Class.o )
Data/Hashable/Class.hs:201:11: Warning:
In the use of ‘bitSize’ (imported from Data.Bits):
Deprecated: "Use 'bitSizeMaybe' or 'finiteBitSize' instead"
Data/Hashable/Class.hs:224:11: Warning:
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE ScopedTypeVariables #-}
module Main
(
main
) where
import Control.Concurrent
import qualified Control.Exception as E
@bbangert
bbangert / dashboard.json
Created November 14, 2014 00:02
pushgo grafana dashboard json
{
"id": null,
"title": "Grafana",
"originalTitle": "Grafana",
"tags": [],
"style": "dark",
"timezone": "browser",
"editable": true,
"hideControls": false,
"rows": [
First, checkout the code:
$ git clone https://github.com/mozilla-services/autopush.git
$ git clone https://github.com/mozilla-services/simplepush_test.git
Setup the tester (assumes virtualenv is on the path):
$ cd simplepush_test
(simplepush_test/) $ make
Setup the autopush app: