This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<item> | |
<name>CODE/WASD Keyboard Media Keys (Mac)</name> | |
<appendix>This will bind CODE/WASD the printed values on the media keys to their actual software function. | |
* Insert : Pause / Play | |
* Delete : Previous SOng | |
* End : Next Song | |
* Pause : Mute Volume | |
* Page Up : Volume Up | |
* Page Down : Volume Down | |
</appendix> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
if [ $(id -u) -eq 0 ]; | |
then # you are root, make the prompt red | |
PS1="┌─[\e[01;34m\u @ \h\e[00m]---[\e[01;34m$(pwd)\e[00m]\n└─>\e[01;31m#\e[00m " | |
else | |
PS1="┌─[\e[0;31m\u @ \h\e[00m]$\n└─>" | |
fi | |
export CLICOLOR=1 | |
export LSCOLORS=ExFxBxDxCxegedabagacad | |
# Settings via http://hackercodex.com/guide/mac-osx-mavericks-10.9-configuration/ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
// Matt's Sublime SFTP settings for developing on a remote server | |
// This setup assumes you are using both an SSH key (as you should) and SFTP | |
// sftp, ftp or ftps | |
"type": "sftp", | |
"sync_skip_deletes": false, | |
"sync_same_age": true, | |
"confirm_downloads": false, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import collections | |
from pprint import pprint | |
my_dict = { | |
'one': { | |
'one-one': True, | |
'one-two': False, | |
'one-three': { | |
'one-three-one': True, | |
}, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
usage () { | |
echo "usage:" $@ | |
exit 127 | |
} | |
die () { | |
echo $@ | |
exit 128 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/local/bin/python3 | |
import inspect | |
import random | |
class Foo(object): | |
def a_method(self, x, y, z): | |
print('Your method ran:\n', x, y, z) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
APP_PATH=$HOME/app | |
PYTHON_KERNEL=$APP_PATH/venv/bin/python | |
function install_pip { | |
echo -e 'downloading pip...' | |
curl -SLO https://bootstrap.pypa.io/get-pip.py | |
echo -e 'installing pip...' | |
python get-pip.py |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/python | |
"""Randomly select your March Madness bracket. | |
""" | |
import random | |
south = ( | |
( |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import json | |
from urllib import request | |
from pprint import pprint | |
def main(): | |
weather_req = request.urlopen("http://api.wunderground.com/api/872a930f94a85692/conditions/q/UK/London.json") | |
# read the request and decode the bytes into sensible UTF-8 strings | |
weather_data = weather_req.read().decode("utf-8") | |
# take a peak at the mess of it |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python3 | |
import sys | |
def PascalsTriangle(row): | |
max_row = int(row) | |
triangle = [] | |
current_row = 0 |
OlderNewer