Skip to content

Instantly share code, notes, and snippets.

View areichman's full-sized avatar

Aaron Reichman areichman

View GitHub Profile
@areichman
areichman / dl-metadata.less
Created May 21, 2014 19:29
Custom styles for Bootstrap's .dl-horizontal class to display key-value pairs
.dl-metadata {
dl {
border-top: 1px solid #e5e5e5;
width: 100%;
overflow: hidden;
dt {
width: 100%;
padding: 12px 20px 0 0;
color: #888;
@areichman
areichman / rename.sh
Created December 24, 2013 15:35
Remove underscores from filenames
for name in *\ *; do mv -v "$name" "${name// /}"; done
@areichman
areichman / play.css
Created June 7, 2013 14:43
CSS play button
.play {
position: relative;
z-index: 1;
width: 100%;
height: 100%;
}
.play:before { /* triangle */
content: "";
display: block;
@areichman
areichman / options_for_select.js
Created August 28, 2012 18:45
Rails-like options_for_select helper for Handlebars
// Create a set of HTML option tags for each of the supplied inputs. If the inputs are arrays
// themselves, it is assume they are of the form [displayName, value].
//
// e.g.
// directions = ['North', 'South']
// {{options_for_select directions}}
//
// results in:
// <option>North</option>
// <option>South</option>
@areichman
areichman / smugmug_oauth.rb
Created March 16, 2012 03:53
Some Ruby snippets I wrote to learn how to use OAuth and the SmugMug API
#!/usr/bin/ruby
# based on http://blog.andydenmark.com/2009/03/how-to-build-oauth-consumer.html
require 'rubygems'
require 'digest'
require 'base64'
require 'cgi'
require 'openssl'
require 'restclient'
require 'json'
@areichman
areichman / app.bash
Created March 6, 2012 14:26
Run the Rails console or rake tasks from a deployed JRuby war file
#!/bin/bash
# Print the usage statement and exit if no options are provided. Otherwise, set
# the required variables.
#
if [ $# -lt 1 ]
then
echo "Usage:"
echo "app console Start the console application"
echo "app test Run the test suite"