This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
.play { | |
position: relative; | |
z-index: 1; | |
width: 100%; | |
height: 100%; | |
} | |
.play:before { /* triangle */ | |
content: ""; | |
display: block; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
for name in *\ *; do mv -v "$name" "${name// /}"; done |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
.dl-metadata { | |
dl { | |
border-top: 1px solid #e5e5e5; | |
width: 100%; | |
overflow: hidden; | |
dt { | |
width: 100%; | |
padding: 12px 20px 0 0; | |
color: #888; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Make the nested fields parsed by multiparty look like req.body from body-parser | |
// e.g. 'metadata[foo]': ['1'] => {metadata: {foo: 1}} | |
// 'metadata[foo]': ['bar'] => {metadata: {foo: 'bar'}} | |
// 'metadata[foo][]': ['bar', 'bat'] => {metadata: {foo: ['bar', 'bat']}} | |
var qs = require('qs'); | |
function reformatFields(fields) { | |
// convert numbers to real numbers instead of strings | |
function toNumber(i) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var request = require('request') | |
spyOn(request, 'get').andCallFake(function(params, callback) { | |
var res = { | |
statusCode: 200 | |
} | |
var body = { | |
// JSON attributes | |
} | |
callback(null, res, body) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Checkbox helper, based on http://api.rubyonrails.org/classes/ActionView/Helpers/FormHelper.html#method-i-check_box | |
// | |
// Usage: | |
// {{check_box object name="test" type="checkbox" value=true hidden="false"}} | |
// | |
// Note that the value in the hash can be specified with/without quotes so a proper type comparison | |
// can be made. | |
// | |
Handlebars.registerHelper('check_box', function(context, options) { | |
var checked = context !== undefined && context == options.hash.value ? 'checked' : '', |
OlderNewer