Skip to content

Instantly share code, notes, and snippets.

View brennie's full-sized avatar
💭
🔥 🦊

Barret Rennie brennie

💭
🔥 🦊
View GitHub Profile
@brennie
brennie / extensions.py
Created June 13, 2012 05:29
Gist Markdown Extension
from markdown import Extension, Markdown
from markdown.inlinepatterns import Pattern
from markdown.util import etree
import re
GIST_RE = r"{gist:([0-9a-f]+)}"
class GistPattern(Pattern):
"""Enable inclusion of gists into markdown.
@brennie
brennie / sublimedropboxhost.bat
Created June 22, 2012 03:24
Host Sublime Text 2 settings on Dropbox (Windows)
@echo off
rem Host Sublime Text 2 settings on Dropbox
rem This must be run as administrator (for mklink)
setlocal
set DROPBOX=%HOMEDRIVE%%HOMEPATH%\Dropbox
set SUBLIME=%APPDATA%\Sublime Text 2
set NEW_SUBLIME=%DROPBOX%\configs\Sublime Text 2
mkdir "%NEW_SUBLIME%"
move "%SUBLIME\Installed Packages" "%NEW_SUBLIME%"
@brennie
brennie / sublimedropbox.bat
Created June 22, 2012 03:25
Set Sublime Text 2 to use settings hosted on Dropbox (Windows)
@echo off
rem Set Sublime Text 2 to use settings hosted on Dropbox
rem This must be run as administrator (for mklink)
rem This assumes Dropbox is located at C:\Users\Username\Dropbox
rem If this is not the case, change %DROPBOX%
setlocal
set DROPBOX=%HOMEDRIVE%%HOMEPATH%\Dropbox
set SUBLIME=%APPDATA%\Sublime Text 2
set NEW_SUBLIME=%DROPBOX%\configs\Sublime Text 2
@brennie
brennie / sublimedropbox.sh
Created June 22, 2012 03:26
Set Sublime Text 2 to use settings hosted on Dropbox (Linux)
#!/bin/bash
# Set Sublime Text 2 to use settings hosted on Dropbox
# This assumes Dropbox is located at ~/Dropbox
# rem If this is not the case, change $DROPBOX
DROPBOX=~/Dropbox
SUBLIME=~/.config/sublime-text-2/
NEW_SUBLIME="${DROPBOX}/configs/Sublime Text 2"
rm -rf "${SUBLIME}/Installed Packages"
@brennie
brennie / sublimedropboxhost.sh
Created June 22, 2012 03:27
Host Sublime Text 2 settings on Dropbox (Linux)
#!/bin/bash
# Host Sublime Text 2 settings on Dropbox
# This assumes Dropbox is located at ~/Dropbox
# rem If this is not the case, change $DROPBOX
DROPBOX=~/Dropbox
SUBLIME=~/.config/sublime-text-2/
NEW_SUBLIME="${DROPBOX}/configs/Sublime Text 2"
mkdir -p "${NEW_SUBLIME}"
@brennie
brennie / Preferences.sublime-settings
Created June 30, 2012 08:09
Sublime Text 2 Settings
{
"auto_complete": false,
"auto_match_enabled": false,
"color_scheme": "Packages/Railscasts.tmTheme",
"default_line_ending": "unix",
"font_face": "Inconsolata",
"font_size": 14,
"tab_size": 4,
"theme": "Soda Light.sublime-theme",
"translate_tabs_to_spaces": false,
@brennie
brennie / parser.rl
Created July 3, 2012 06:46
Parse an IRC Message
%%{
machine irc_parser;
action mark { mark = p }
action wr { puts "Got: #{data[mark .. p-1]}" }
valid = extend -- ('\r' | '\n' | 0);
nospace = extend -- ('\r' | '\n' | 0 | ' ');
special = '[' | ']' | '{' | '}' | '^' | '`' | '\\' | '-';
template<class T> class Range
{
public:
Range(T initial, T final, T step = T(1)) : _initial(initial), _final(final), _step(step) {}
class Iterator;
Iterator begin() const
{
return Iterator(_initial, _step);
### Keybase proof
I hereby claim:
* I am brennie on github.
* I am brennie (https://keybase.io/brennie) on keybase.
* I have a public key whose fingerprint is FD75 3599 8064 39F3 5D5F 2E1E 44ED 5735 647A B5F2
To claim this, I am signing this object:
#!/bin/bash
# git-setup-mirror
#
# Set up a repository to sync to and from a mirror.
#
# This is useful for working on a project from several machines.
set -euo pipefail
if [[ $# -ne 1 ]]; then