Skip to content

Instantly share code, notes, and snippets.

View oconnoat's full-sized avatar

Alexander O'Connor oconnoat

  • Los Angeles, California, USA
View GitHub Profile
@oconnoat
oconnoat / speechinput.html
Created January 22, 2014 20:47
simplest possible form with html speech input on webkit (or chrome at least, not sure how to do it in other browsers)
<!doctype html>
<html>
<head>
</head>
<body>
<form action="#" method="post">
<!-- chrome / webkit text-to-speech -->
<input type="text" x-webkit-speech />
<input type="submit" />
@oconnoat
oconnoat / newpythonfile
Last active August 29, 2015 13:56
template for a new python file
#!/usr/bin/env python
# -*- coding: utf-8 -*-
""" docstring """
import os
import sys
import argparse
import logging
@oconnoat
oconnoat / brewupdate
Created February 6, 2014 16:41
Handy command to get a notification Dialog in OSX when brew has upgraded and updated
brew update && brew upgrade && /usr/bin/osascript -e 'tell app "System Events" to display dialog "Brew Done."'
@oconnoat
oconnoat / .gitignorepy
Last active August 29, 2015 13:56
.gitignore file for Vim, OSX and Python
#Some of this from https://github.com/github/gitignore
#OS files and Swap Files
*~
*.lock
*.DS_Store
*.swp
*.out
#Vim
@oconnoat
oconnoat / bash_prompt.sh
Created March 20, 2014 20:49
nice terminal colours for LS and prompt
export PS1="\[\033[36m\]\u\[\033[m\]:\[\033[33;1m\]\w\[\033[m\]\$ "
export CLICOLOR=1
export LSCOLORS=GxFxBxDxCxegedabagacad
@oconnoat
oconnoat / filecount.md
Created April 15, 2014 10:49
Show Long Filenames on the desktop in OSX 10.9 Mavericks

Open Terminal.app (or your favourite terminal) and type:

defaults write com.apple.finder FXDesktopLayoutGridCharCount 50; killall Finder; killall Dock

You then need to change the 'Grid Size' in 'View Options' and the full names should appear.

@oconnoat
oconnoat / brewinfo.sh
Created April 18, 2014 08:32
Short shell script to get the url for a homebrew package and open it in google chrome in the background
#!/bin/bash
brew info $1 | sed -n '2p' | xargs open -g -a "Google Chrome"
#Get the Package info from brew for the first argument
# and pipe it to
#sed which outputs only the second line
# and pipe it to
# xargs calling open with options to background the app, the app named "Google Chome" and the url is appended
@oconnoat
oconnoat / SimpleHTTPChrome.sh
Created April 18, 2014 09:17
start a python SimpleHTTPServer on port 8000 in this directory and open chrome to the root
python -m SimpleHTTPServer & open -a "Google Chrome" http://localhost:8000
@oconnoat
oconnoat / pipfromsource
Last active August 29, 2015 14:00
Install from source git repo with pip
git clone the repo
python setup.py sdist
pip install --user dist/*.tgz
##If you get a file not found error, there might be a stray reference to readme.md or something in setup.py
via @talideon: https://twitter.com/talideon/status/462591048045588480
@oconnoat
oconnoat / node-gyp fix
Created May 26, 2014 14:40
if node-gyp fails on OSX Mavericks with Homebrew
export PKG_CONFIG_PATH=/usr/X11/lib/pkgconfig