Skip to content

Instantly share code, notes, and snippets.

Avatar
🤠
🤔🤔🤔🤔🤔🤔🤔🤔🤔🤔🤔🤔🤔🤔🤔🤔🤔🤔🤔🤔🤔🤔🤔🤔🤔🤔🤔🤔🤔🤔🤔🤔🤔🤔🤔🤔🤔🤔🤔🤔🤔🤔🤔🤔🤔🤔🤔🤔🤔🤔🤔🤔🤔🤔🤔🤔🤔🤔🤔🤔🤔🤔🤔🤔🤔🤔🤔🤔🤔🤔🤔🤔🤔🤔🤔🤔🤔🤔🤔🤔

Matt Robenolt mattrobenolt

🤠
🤔🤔🤔🤔🤔🤔🤔🤔🤔🤔🤔🤔🤔🤔🤔🤔🤔🤔🤔🤔🤔🤔🤔🤔🤔🤔🤔🤔🤔🤔🤔🤔🤔🤔🤔🤔🤔🤔🤔🤔🤔🤔🤔🤔🤔🤔🤔🤔🤔🤔🤔🤔🤔🤔🤔🤔🤔🤔🤔🤔🤔🤔🤔🤔🤔🤔🤔🤔🤔🤔🤔🤔🤔🤔🤔🤔🤔🤔🤔🤔
View GitHub Profile
@mattrobenolt
mattrobenolt / mongodb.py
Created May 19, 2011
Wrapper for pymongo to integrate nicer into Django with failover stuff
View mongodb.py
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
View cramermath.py
"""
cramermath
~~~~~~~~~~
Usage:
>>> import cramermath
>>> cramermath.log(10)
0.014728067495500818
"""
@mattrobenolt
mattrobenolt / gist:4439597
Created Jan 3, 2013
Django middleware to capture X-Forwarded-Port header
View gist:4439597
class XForwardedPort(object):
def process_request(self, request):
try:
request.META['SERVER_PORT'] = request.META['HTTP_X_FORWARDED_PORT']
except KeyError:
pass
return None
View raven-1.0-beta4.js
// 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;
View keybase.md

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:

View 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)
View gist:5075441
>>> import sourcemap
>>> index = sourcemap.load(open('jquery.min.map')) # Parses the map
>>> index.lookup(line=1, column=3000)) # Search in index for a Token
View gist:4993301
// 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
})
View gist:4580442
>>> class Foo(object): pass
...
>>> foo = Foo()
>>> setattr(foo, '☃', 'snowman')
>>> getattr(foo, '☃')
'snowman'
@mattrobenolt
mattrobenolt / README.md
Last active Dec 11, 2015
raven-js public beta
View README.md

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()