Skip to content

Instantly share code, notes, and snippets.

View zourtney's full-sized avatar

Courtney Christensen zourtney

View GitHub Profile
@zourtney
zourtney / decorator
Last active March 18, 2016 02:30 — forked from jhunken/decorator
.config(['$provide', function($provide) {
// Minification-safe hack.
var $$watchers = '$$watchers',
$$nextSibling = '$$nextSibling',
$$childHead = '$$childHead',
$$childTail = '$$childTail',
$$listeners = '$$listeners',
$$listenerCount = '$$listenerCount',
$id = '$id',
@zourtney
zourtney / gist:9340796
Created March 4, 2014 05:30
Python-crontab "invalid range specifier: 'root' ('root')"
Traceback (most recent call last):
File "./server.py", line 22, in <module>
scheduler = Scheduler(root_path=ROOT_PATH, switches=switches)
File "/home/pi/Development/lightcontrol/lightcontrol/scheduler.py", line 12, in __init__
self.refresh()
File "/home/pi/Development/lightcontrol/lightcontrol/scheduler.py", line 15, in refresh
self._crontab = CronTab('root')
File "/usr/local/lib/python2.7/dist-packages/crontab/_crontab.py", line 275, in __init__
self.matchers = self._make_matchers(crontab)
File "/usr/local/lib/python2.7/dist-packages/crontab/_crontab.py", line 283, in _make_matchers
/**
* Model class
*/
Model = function(url, attributes) {
this.url = url;
this.attributes = attributes;
};
Model.prototype = {
set: function(data) {
@zourtney
zourtney / $.removeAttrI
Created February 17, 2012 20:48
Case insensitive $.removeAttr implementation. Based off jQuery 1.7.1.
(function($) {
var rcaps = /[A-Z]/,
rspace = /\s+/,
rboolean = /^(?:autofocus|autoplay|async|checked|controls|defer|disabled|hidden|loop|multiple|open|readonly|required|scoped|selected)$/i;
jQuery.fn.removeAttrI = function(value) {
return this.each(function() {
// Call normal `removeAttr`
if (! value.match(rcaps)) {
$(this).removeAttr(value);
@zourtney
zourtney / mathtype_mathml.py
Created February 2, 2012 22:15
MathType clipboard-to-clipboard transformation works on Windows, fails on OSX
# NOTE: Python must be invoked in 32-bit mode for ctypes to read the MathType lib.
# For example (OSX):
# arch -i386 /usr/bin/python2.6 mathtype_mathml.py
#
import sys
from ctypes import *
def main():
# On OSX, use the following line instead:
# lib = cdll.LoadLibrary('/Library/Frameworks/MT6Lib.framework/MT6Lib')