Skip to content

Instantly share code, notes, and snippets.

Avatar

Ray Besiga raybesiga

View GitHub Profile
@raybesiga
raybesiga / restart_bluetooth.sh
Created Jan 17, 2019 — forked from nicolasembleton/restart_bluetooth.sh
Restart Bluetooth Daemon on Mac OS X without restarting
View restart_bluetooth.sh
#!/bin/bash
sudo kextunload -b com.apple.iokit.BroadcomBluetoothHostControllerUSBTransport
sudo kextload -b com.apple.iokit.BroadcomBluetoothHostControllerUSBTransport
@raybesiga
raybesiga / script.sh
Created Jul 11, 2018 — forked from vielhuber/script.sh
PostgreSQL: Backup and restore pg_dump with password on command line #sql
View script.sh
# best practice: linux
nano ~/.pgpass
*:5432:*:username:password
chmod 0600 ~/.pgpass
# best practice: windows
edit %APPDATA%\postgresql\pgpass.conf
*:5432:*:username:password
# linux
@raybesiga
raybesiga / Python3 Virtualenv Setup.md
Created Apr 25, 2018 — forked from pandafulmanda/Python3 Virtualenv Setup.md
Setting up and using Python3 Virtualenv on Mac
View Python3 Virtualenv Setup.md

Python3 Virtualenv Setup

Requirements
  • Python 3
  • Pip 3
$ brew install python3
@raybesiga
raybesiga / gist:0ad45684f189e9c41689
Created Feb 8, 2016 — forked from digitaljhelms/gist:4287848
Git/GitHub branching standards & conventions
View gist:0ad45684f189e9c41689

Branching

Quick Legend

Instance Branch Description, Instructions, Notes
@raybesiga
raybesiga / gist:6ed1a9bcaf079df67ee6
Created Nov 2, 2015 — forked from TimFletcher/gist:034e799c19eb763fa859
Django template filter to add attributes to form fields
View gist:6ed1a9bcaf079df67ee6
# 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 Aug 29, 2015 — forked from JohnMurray/unload-keyboard
Disable Mac OS X Keyboard (built-in only)
View unload-keyboard
#!/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/