Skip to content

Instantly share code, notes, and snippets.

View impressiver's full-sized avatar

Ian White impressiver

View GitHub Profile
@impressiver
impressiver / raven-config.html
Last active February 27, 2024 14:27
Raven.js configuration for logging JavaScript exceptions to Sentry (https://getsentry.com/). Without the added ignore options, you'll quickly find yourself swamped with unactionable exceptions due to shoddy browser plugins and 3rd party script errors.
<!-- Raven.js Config -->
<script src="{{ JS_PATH }}/lib/raven.js" type="text/javascript"></script>
<script type="text/javascript">
// Ignore list based off: https://gist.github.com/1878283
var ravenOptions = {
// Will cause a deprecation warning, but the demise of `ignoreErrors` is still under discussion.
// See: https://github.com/getsentry/raven-js/issues/73
ignoreErrors: [
// Random plugins/extensions
'top.GLOBALS',
@impressiver
impressiver / django_bash_completion.sh
Last active December 4, 2021 18:01
Bash completion script for Django that adds tab-completion to django-admin.py and manage.py. This gist is used by the Homebrew formula `django-completion`, which you can install using: `brew install django-completion`.
# vim: ft=sh:ts=4:sw=4:autoindent:expandtab:
# Source: https://github.com/django/django/blob/stable/1.5.x/extras/django_bash_completion
# #########################################################################
# This bash script adds tab-completion feature to django-admin.py and
# manage.py.
#
# Testing it out without installing
# =================================
#
@impressiver
impressiver / console-lite.js
Last active December 9, 2015 23:28
Was thinking that it would be nice to leave console messages in the front end code, with a switch to turn them on and off, making quick production debug sessions hassle-free. So I made a light `window.console` wrapper that routes `console` calls to noop functions if debug is not enabled, but back to the original console if you have `DEBUG = true…
/*!
* Console Lite
* https://gist.github.com/impressiver/4343889
*
* Stop wayward debug messages from inadvertently jamming up browsers.
* Setting `localStorage.DEBUG = true` will turn console messages on
* again, though you still only get partial console functionality
* (which is intentional).
*
* Copyright 2013 Impressiver LLC
@impressiver
impressiver / README.md
Created July 17, 2012 01:56
Testing Gist embedding

#Gist Embeds

All you need to know is that these gists will be included in the page. So rad.

How does it work?

Simply include the link in your post and it will show up inline, with syntax highlighting and everything.

 > Here is some posted text, followed by a Gist:

> https://gist.github.com/1002914

var driver = browserMob.openBrowserWebDriver();
browserMob.beginTransaction();
browserMob.beginStep("Go to google home page");
driver.get("http://www.google.com");
// Find the text input element by its name
var element = driver.findElement(By.name("q"));
function f() {
console.log(arguments);
}
xmlhttp = new XMLHttpRequest();
xmlhttp.onreadystatechange=f;
res = xmlhttp.open("GET", "http://www.yahoo.com/",true);