Skip to content

Instantly share code, notes, and snippets.

View raybesiga's full-sized avatar

Ray Besiga raybesiga

View GitHub Profile
@raybesiga
raybesiga / gist:6ed1a9bcaf079df67ee6
Created November 2, 2015 13:20 — forked from TimFletcher/gist:034e799c19eb763fa859
Django template filter to add attributes to form fields
# From http://vanderwijk.info/blog/adding-css-classes-formfields-in-django-templates/#comment-1193609278
from django import template
register = template.Library()
@register.filter(name='add_attributes')
def add_attributes(field, css):
attrs = {}
definition = css.split(',')
@raybesiga
raybesiga / unload-keyboard
Last active August 29, 2015 14:27 — forked from JohnMurray/unload-keyboard
Disable Mac OS X Keyboard (built-in only)
#!/bin/bash
# Unload the keyboard so I can use my external keyboard
# and not worry about accidentally pressing buttons on
# the built-in. This may not be a problem for you but, you
# should see my desk sometimes (Oh no!!) ;-)
sudo kextunload /System/Library/Extensions/AppleUSBTopCase.kext/Contents/PlugIns/AppleUSBTCKeyboard.kext/