Skip to content

Instantly share code, notes, and snippets.

View btobolaski's full-sized avatar

Brendan Tobolaski btobolaski

View GitHub Profile
@btobolaski
btobolaski / drafts.sh
Created October 9, 2012 18:04
A script to deal with Drafts' App folder in dropbox. I don't like how it uses a special folder in Dropbox. I wish that I could just set the folder to whatever I want. So what I do is check whether a file exists in my notes directory, if it does, it adds t
#!/bin/bash
DRAFTS_DIR=~/Dropbox/Apps/Drafts/*
NOTES_DIR=~/Dropbox/Notes
for file in $DRAFTS_DIR
do
FILENAME=$(basename "$file")
if [ "$FILENAME" != "Journal.txt" ]; then
if [ -f $NOTES_DIR/"$FILENAME" ]; then
echo "" >> $NOTES_DIR/"$FILENAME"
@btobolaski
btobolaski / python.vim
Created October 10, 2012 16:51
My python settings for vim. Feel free to use this if you want to create python code that looks like mine.
setlocal tabstop=2
setlocal softtabstop=2
setlocal shiftwidth=2
setlocal textwidth=90
setlocal smarttab
setlocal expandtab
@btobolaski
btobolaski / redhat5.sh
Created October 17, 2012 17:00
A script to install the EPEL repo if it isn't installed.
#!/bin/bash
if [ ! -f /etc/yum.repos.d/epel.repo ]
then
wget http://mirror.es.its.nyu.edu/epel/5/i386/epel-release-5-4.noarch.rpm
yum localinstall epel-release-5-4.noarch.rpm
rm -f epel-release-5-4.noarch.rpm
sed -i "s/enabled=1/enabled=0/g" /etc/yum.repos.d/epel.repo
fi
@btobolaski
btobolaski / rss-subscribers.sh
Created November 2, 2012 17:07 — forked from drdrang/rss-subscribers.sh
Bash script to parse Apache log for a count of RSS subscribers and email it to you
#!/bin/bash
# A modification of Marco Arment's script at
#
# https://gist.github.com/3783146
#
# It's intended to be run once a day as a cron job. The main
# differences between it and Marco's script are:
#
# 1. It checks two feeds instead of just one.
@btobolaski
btobolaski / html.vim
Created November 2, 2012 19:43
my vim settings for HTML Files
setlocal tabstop=2
setlocal softtabstop=2
setlocal shiftwidth=2
setlocal smarttab
setlocal expandtab
@btobolaski
btobolaski / css.vim
Created November 28, 2012 22:07
My vim settings for css
setlocal tabstop=3
setlocal softtabstop=3
setlocal shiftwidth=3
setlocal noexpandtab
@btobolaski
btobolaski / php.vim
Created November 28, 2012 21:48
My vim settings for php
setlocal tabstop=3
setlocal softtabstop=3
setlocal shiftwidth=3
setlocal noexpandtab
setlocal tabstop=8
setlocal softtabstop=8
setlocal shiftwidth=8
setlocal noexpandtab
@btobolaski
btobolaski / Inbox.py
Created April 26, 2013 19:44
Adds a list of tasks from Drafts into your OmniFocus Inbox using Pythonista and Mail Drop
import re
import smtplib
import webbrowser
from email.mime.base import MIMEBase
from email.mime.multipart import MIMEMultipart
from email import encoders
###########################
to = ''
gmail_user = ''
<script type="text/javascript">
var _gaq = _gaq || [];
_gaq.push(['_setAccount', 'UA-XXXXXXX-1']);
_gaq.push(['_trackPageview']);
(function() {
var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);