Skip to content

Instantly share code, notes, and snippets.

View mattrobenolt's full-sized avatar
🤠
🤔🤔🤔🤔🤔🤔🤔🤔🤔🤔🤔🤔🤔🤔🤔🤔🤔🤔🤔🤔🤔🤔🤔🤔🤔🤔🤔🤔🤔🤔🤔🤔🤔🤔🤔🤔🤔🤔🤔🤔🤔🤔🤔🤔🤔🤔🤔🤔🤔🤔🤔🤔🤔🤔🤔🤔🤔🤔🤔🤔🤔🤔🤔🤔🤔🤔🤔🤔🤔🤔🤔🤔🤔🤔🤔🤔🤔🤔🤔🤔

Matt Robenolt mattrobenolt

🤠
🤔🤔🤔🤔🤔🤔🤔🤔🤔🤔🤔🤔🤔🤔🤔🤔🤔🤔🤔🤔🤔🤔🤔🤔🤔🤔🤔🤔🤔🤔🤔🤔🤔🤔🤔🤔🤔🤔🤔🤔🤔🤔🤔🤔🤔🤔🤔🤔🤔🤔🤔🤔🤔🤔🤔🤔🤔🤔🤔🤔🤔🤔🤔🤔🤔🤔🤔🤔🤔🤔🤔🤔🤔🤔🤔🤔🤔🤔🤔🤔
View GitHub Profile
@mattrobenolt
mattrobenolt / mongodb.py
Created May 19, 2011 01:16
Wrapper for pymongo to integrate nicer into Django with failover stuff
from pymongo import Connection
from pymongo.collection import Collection
from pymongo.errors import AutoReconnect
from django.conf import settings
from types import FunctionType
import functools
import time
@mattrobenolt
mattrobenolt / cramermath.py
Created February 28, 2013 02:23
David Cramer math
"""
cramermath
~~~~~~~~~~
Usage:
>>> import cramermath
>>> cramermath.log(10)
0.014728067495500818
"""
@mattrobenolt
mattrobenolt / gist:4439597
Created January 3, 2013 00:07
Django middleware to capture X-Forwarded-Port header
class XForwardedPort(object):
def process_request(self, request):
try:
request.META['SERVER_PORT'] = request.META['HTTP_X_FORWARDED_PORT']
except KeyError:
pass
return None
// parseUri 1.2.2
// (c) Steven Levithan <stevenlevithan.com>
// MIT License
function parseUri (str) {
var o = parseUri.options,
m = o.parser[o.strictMode ? "strict" : "loose"].exec(str),
uri = {},
i = 14;

Keybase proof

I hereby claim:

  • I am mattrobenolt on github.
  • I am mattrobenolt (https://keybase.io/mattrobenolt) on keybase.
  • I have a public key whose fingerprint is D874 9766 A66D D714 236A 932C 3B2D 400C E5BB CA60

To claim this, I am signing this object:

@mattrobenolt
mattrobenolt / wtf.py
Last active December 21, 2015 11:59 — forked from anonymous/wtf.py
class A(object):
def hook(self, f):
def intime(*args):
print intime.atime
intime.atime += 1
return f(*args)
intime.atime = 0
return intime
>>> f = A().hook(lambda b: b + 1)
>>> import sourcemap
>>> index = sourcemap.load(open('jquery.min.map')) # Parses the map
>>> index.lookup(line=1, column=3000)) # Search in index for a Token
// jQuery
Raven.plugin({
// the main, base object
object: $,
// the keys within that object to wrap
keys: ['success', 'failure'],
// optionally wrap the arguments to the callbacks, if they are themselves functions
args: true
})
@mattrobenolt
mattrobenolt / gist:4580442
Created January 20, 2013 18:18
lol Python
>>> class Foo(object): pass
...
>>> foo = Foo()
>>> setattr(foo, '☃', 'snowman')
>>> getattr(foo, '☃')
'snowman'
@mattrobenolt
mattrobenolt / README.md
Last active December 11, 2015 04:29
raven-js public beta

Raven.js (public beta)

Raven.js v1.0 and above requires Sentry v5.2 or later. If you're using getsentry.com, you're already up to date!

Migration Guide

First and foremost, "What is different when using Raven 1.0?" The new method is:

Raven.config(...).install()