Skip to content

Instantly share code, notes, and snippets.

View bouchard's full-sized avatar

Brady Bouchard bouchard

View GitHub Profile
@bouchard
bouchard / download.rb
Created December 31, 2014 23:51
Download Private but Embedded Vimeo Videos
#!/usr/bin/env ruby
require 'nokogiri'
require 'net/http'
require 'shellwords'
require 'json'
source = Net::HTTP.get('www.domain.com', '/thepagethathasthevideos/')
doc = Nokogiri::HTML(source)
ids = doc.css('a').map{ |a| a.attr('data-vimeoid') }.compact.uniq
@bouchard
bouchard / config.rb
Last active December 26, 2017 05:43
Podcast XML/Builder Template for Middleman
page '/podcast.xml', layout: false
# Methods defined in the helpers block are available in templates
helpers do
def podcast_source_path(article)
"source/audio/#{article.data.file}"
end
end
@bouchard
bouchard / .profile
Created September 3, 2016 19:45 — forked from bmhatfield/.profile
Automatic Git commit signing with GPG on OSX
# In order for gpg to find gpg-agent, gpg-agent must be running, and there must be an env
# variable pointing GPG to the gpg-agent socket. This little script, which must be sourced
# in your shell's init script (ie, .bash_profile, .zshrc, whatever), will either start
# gpg-agent or set up the GPG_AGENT_INFO variable if it's already running.
# Add the following to your shell init to set up gpg-agent automatically for every shell
if [ -f ~/.gnupg/.gpg-agent-info ] && [ -n "$(pgrep gpg-agent)" ]; then
source ~/.gnupg/.gpg-agent-info
export GPG_AGENT_INFO
else
@bouchard
bouchard / delete_all_archives.rb
Last active August 1, 2016 15:12
Delete all archives in an Amazon Glacier Vault
#!/usr/bin/env ruby
require 'aws-sdk'
require 'json'
glacier = AWS::Glacier.new(
:access_key_id => "ID_GOES_HERE",
:secret_access_key => "SECRET_GOES_HERE"
)
2012/06/08 10:39am,2,29,88,12,39,4,28,31,106,25,6,127,13,15,25
2012/06/08 10:40am,2,29,88,12,39,4,28,31,106,25,6,127,13,15,25
2012/06/08 10:41am,2,29,88,12,39,4,28,31,106,25,6,127,13,15,25
2012/06/08 10:42am,2,29,88,12,39,4,28,31,106,25,6,127,13,15,25
2012/06/08 10:43am,2,29,88,12,39,4,28,31,106,25,6,127,13,15,25
2012/06/08 10:44am,2,29,88,12,39,4,28,31,106,25,6,127,13,15,25
2012/06/08 10:45am,2,29,88,12,39,4,28,31,106,25,6,127,13,15,25
2012/06/08 10:46am,2,29,88,12,39,4,28,31,106,25,6,127,13,15,25
2012/06/08 10:47am,2,29,88,12,39,4,28,31,106,25,6,127,13,15,25
2012/06/08 10:48am,2,29,88,12,39,4,28,31,106,25,6,127,13,15,25
Date/Time: 2012-11-06 12:50:52 +1000
OS Version: 10.8.2 (Build 12C60)
Architecture: x86_64
Report Version: 11
Command: Tagalicious
Path: /Applications/Tagalicious.app/Contents/MacOS/Tagalicious
Version: 1.5.5 (1.5.5)
Parent: launchd [173]
#!/usr/bin/env ruby
# A few helpful tips about the Rules file:
#
# * The string given to #compile and #route are matching patterns for
# identifiers--not for paths. Therefore, you can’t match on extension.
#
# * The order of rules is important: for each item, only the first matching
# rule is applied.
#
@bouchard
bouchard / gist:1528761
Created December 28, 2011 17:18
Force Lowercase and Force Parameterize for Acts as Taggable On.
module ActsAsTaggableOn
class TagList < Array
cattr_accessor :force_lowercase, :force_parameterize
self.force_lowercase = false
self.force_parameterize = false
private
# Remove whitespace, duplicates, and blanks.
def clean!
@bouchard
bouchard / Rules
Created November 18, 2011 06:43
Nanoc Nested Routes with RecursiveCompilation Error
compile '/' do
filter :erb
layout 'default'
end
compile '*' do
# item[:extension] returns 'html.erb' for multi-dotted filename
ext = item[:extension].nil? ? nil : item[:extension].split('.').last
if ext == 'erb'
/*
* svgObject: a jQuery plugin, version: 0.1 (2010-09-03)
* @requires jQuery v.1.4.2 or later
*
* svgObject parses all SVG images linked in the document as IMG tags, and replaces
* the IMG tags with OBJECTs instead to make it all work nicely in FF 3.6+ and Safari 5+
*
* This:
*
* <img class="up svg" src="/images/up.svg" />