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 / slack_emoji_map.json
Created December 23, 2020 00:31
Slack emoji 2020-12-22
[
{ "name": "1234", "unicode": "1f522", "id": "E1f522", "keywords": ["1234", "input", "numbers"] },
{ "name": "hash", "unicode": "0023-fe0f-20e3", "id": "E0023-fe0f-20e3", "keywords": ["symbol"] },
{ "name": "keycap_star", "unicode": "002a-fe0f-20e3", "id": "E002a-fe0f-20e3", "keywords": [] },
{ "name": "zero", "unicode": "0030-fe0f-20e3", "id": "E0030-fe0f-20e3", "keywords": ["number", "0"] },
{ "name": "one", "unicode": "0031-fe0f-20e3", "id": "E0031-fe0f-20e3", "keywords": ["number", "1"] },
{ "name": "two", "unicode": "0032-fe0f-20e3", "id": "E0032-fe0f-20e3", "keywords": ["number", "2"] },
{ "name": "three", "unicode": "0033-fe0f-20e3", "id": "E0033-fe0f-20e3", "keywords": ["number", "3"] },
{ "name": "four", "unicode": "0034-fe0f-20e3", "id": "E0034-fe0f-20e3", "keywords": ["number", "4"] },
{ "name": "five", "unicode": "0035-fe0f-20e3", "id": "E0035-fe0f-20e3", "keywords": ["number", "5"] },
@impressiver
impressiver / Preferences.sublime-settings
Last active January 30, 2018 22:27
Sublime Text 3 settings
{
"always_prompt_for_file_reload": false,
"always_show_minimap_viewport": false,
"animation_enabled": true,
"atomic_save": true,
"auto_close_tags": true,
"auto_complete": true,
"auto_complete_commit_on_tab": true,
"auto_complete_delay": 25,
"auto_complete_selector": "source - comment, meta.tag - punctuation.definition.tag.begin",
@impressiver
impressiver / README.md
Last active May 24, 2017 20:47
Pi 2 Wink Hub Homebridge

Wink Hub HomeKit bridge

... on a Pi 2, in 5 min.

don't be scared

pi@pi:~ $ sudo su -
@impressiver
impressiver / keybase.md
Created February 12, 2017 23:24
keybase.io

Keybase proof

I hereby claim:

  • I am impressiver on github.
  • I am impressiver (https://keybase.io/impressiver) on keybase.
  • I have a public key ASDJ4qjxwGq0XFr3qsp_OduTyOw6OyQRml-pgFeL-l-U1Qo

To claim this, I am signing this object:

@impressiver
impressiver / dammit-grandpa.js
Last active December 31, 2015 04:09
Traverse the DOM hierarchy and return the first ancestor that has all/any css attributes that match the provided hash. Expects jQuery, but could be easily modified to work w/o. Main use for this is in Chrome dev tools to quickly find the parent of an element that's responsible for layout troubles.
//
// Traverse the DOM hierarchy and return the first ancestor that has all/any
// css attributes that match the provided attribute:regexp hash.
//
var $parent = (function declares(el, attrs, any) {
var $el = $(el), fn = (!!any ? 'some' : 'every'), match;
if(!attrs || !$el.length || $el.is(document)) return undefined;
match = Object.keys(attrs)[fn](function(key) {
var css = $el.css(key), matcher = attrs[key];
@impressiver
impressiver / gist:7477068
Created November 15, 2013 00:33
Road to Dynamic Hybrid Web Applications

Road to Dynamic Hybrid Web Applications

Introduction

There has been a natural evolution over the past few years with regard to developing increasingly rich, desktop-like experiences in web applications. The old school way was to handle 100% of the dynamic content generation on the server and spit static HTML back to the browser. Then JavaScript grew up a bit and people slowly started to learn (begrudgingly) that it was more than just a toy. Increasingly, much of the rendering and processing was pushed to the

@impressiver
impressiver / private.xml
Created October 7, 2013 20:08
KeyRemap4Macbook Hyper
<?xml version="1.0"?>
<root>
<item>
<name>F19 to Hyper/Hyper+Esape</name>
<appendix>(F19 to Hyper (Control+Shift+Command+Option) or send Hyper+Escape when tapped)</appendix>
<identifier>private.f19_to_hyper</identifier>
<autogen>
--KeyOverlaidModifier--
KeyCode::F19,
KeyCode::COMMAND_L, ModifierFlag::OPTION_L | ModifierFlag::SHIFT_L | ModifierFlag::CONTROL_L,
@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