Skip to content

Instantly share code, notes, and snippets.

View brock's full-sized avatar
😎

Brock Angelo brock

😎
View GitHub Profile
import praw # simple interface to the reddit API, also handles rate limiting of requests
import re
from collections import deque
from time import sleep
USERNAME = "Your username here"
PASSWORD = "Your password here"
USERAGENT = "Your useragent string here. It should include your /u/username as a courtesy to reddit"
r = praw.Reddit(USERAGENT)

A Backbone.js demo app (Sinatra Backend)

Oct 16 2010

Updates

  • 04/10/2011 - Updated application.js and application.rb thanks to @rebo's comments

In this article, I will walk through some simple steps to get a [demo app][2] up and running with [Backbone.js][3] and [Sinatra][4] on [Heroku][5].

@brock
brock / webinar.md
Last active August 29, 2015 14:00
a crazy good webinar on using webstorm. these are notes to accompany the recorded session that will be published the week of Mon, April 28th

WebStorm AngularJS Webinar

AngularJS

  1. Install angular with: terminal: bower install angular
  2. Ctrl-space twice
  3. ng stuff works now
  4. Preferences: Editor: angularjs add whitespace
  5. Debug (there is a shortcut so you can do live edit and it updates in chrome)
  6. You can change your code style for html. Preferences: Code Style: HTML (worth a look through these settings)
  7. Cmd+Alt+L to reformat your code
L.Control.Button = L.Control.extend({
options: {
position: 'bottomleft'
},
initialize: function (options) {
this._button = {};
this.setButton(options);
},
@brock
brock / gs.sh
Last active August 29, 2015 14:01
Name git stashes
function gs() {
BRANCH=$(git branch | grep "*" | sed 's/^\* //')
TODAY=$(date +"%Y%m%d-%H%M%S")
git stash save $TODAY-$BRANCH
}
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Ansi 0 Color</key>
<dict>
<key>Blue Component</key>
<real>0.19370138645172119</real>
<key>Green Component</key>
<real>0.15575926005840302</real>
@brock
brock / gbs.sh
Created June 19, 2014 21:11
gbs - git branch sorted (by date)
gbs () {
for k in `git branch | perl -pe 's/^..(.*?)( ->.*)?$/\1/'`
do
echo -e `git show --pretty=format:"%Cgreen%ci %Cblue%cr%Creset" $k -- | head -n 1`\\t$k
done | sort -r | awk '{ print $4, $5, $6, $7}' | head -n 10
}

I'd like to be able to control both the sidebar view and the graph view from the dropdown list.

<TaskerData sr="" dvi="1" tv="4.6u3m">
<Profile sr="prof45" ve="2">
<cdate>1421519030211</cdate>
<clp>true</clp>
<edate>1421529685178</edate>
<id>45</id>
<mid0>47</mid0>
<nme>Sonos Wand</nme>
<Event sr="con0" ve="2">
<cname>Wave For Sonos</cname>
@brock
brock / open-new-applications.scpt
Created January 22, 2015 03:33
Open new Applications in OSX
on adding folder items to this_folder after receiving this_item
tell application "Finder"
open this_item
end tell
end adding folder items to