This file contains 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/awk -f | |
# | |
# budget-calc | |
# | |
# Builds a budget to save for upcoming bills | |
# | |
# USAGE | |
# | |
# Given a budget file like this with bill costs per month: | |
# |
This file contains 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
function load_helpers() { | |
data["page_title"] = page_title() | |
} | |
function page_title( title) { | |
if (data["title"]) { | |
title = data["title"] " - " | |
} |
This file contains 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/sh | |
# | |
# rlc: resize like crazy | |
# | |
# rlc.sh targetdir | |
target=$1 | |
destination=$target-resized | |
dimensions=1000x | |
quality=100 |
This file contains 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/sh | |
# html5vid.sh | |
# | |
# Encode an input video to multiple html5-ready formats: | |
# - webm | |
# - ogv | |
# - mp4 | |
# - png (50th frame) | |
# |
This file contains 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/sh | |
# | |
# Synopsis: | |
# Sometimes I have to use MACOSX fonts on my Linux machine. | |
# They come in from a zip file, but the fonts are hidden files | |
# in a __MACOSX directory in the zip. This script handles | |
# unzipping the file, moving the hidden font files into my user | |
# font directory and updating my font cache automatically. | |
# | |
# Description: |
This file contains 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 cart_total_without_shipping = null; | |
var cart_tax_without_shipping = null; | |
/* | |
* Because IE isn't DOM level 3 compliant | |
*/ | |
function | |
cart_element_text(element) { | |
if (element.text()) { | |
return element.text(); |
This file contains 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
set :application, '{project}' | |
set :repository, 'ssh://code.myhost.net/var/git/{project}.git' | |
set :web_command, 'sudo apache2ctl' | |
desc 'Staging environment' | |
task :staging do | |
set :repository, '/var/git/{project}.git' | |
set :environment, 'staging' | |
set :domain, 'staging1' | |
set :deploy_to, '/var/staging/{project}' |
This file contains 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
/* | |
* jQuery-like getJSON function in ActionScript 3 | |
* | |
* Used like: | |
* | |
* get_json('http://somehost.com/my.json', function(data) { | |
* trace(data); | |
* }); | |
* | |
* Requires the AS3 Core Libraries: http://code.google.com/p/as3corelib/ |
This file contains 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
The Polls Tab: | |
Creating polls is handled through the Polls tab in the admin area. When creating a new poll give the poll a title and add all of its options. You can also view poll results from this area. By clicking on the poll from the poll listing, a breakdown of responses per question is shown. | |
Rendering a submission form: | |
To render a submission form, start off with the <r:poll title="My Poll"> tag so that all child tags can reference the poll given in the title attribute. The <r:form> tag starts the submission form. Usually you will want to render each poll option that user’s can choose from. The <r:options:each> tag iterates through each poll option. Within this tag, you can use <r:input /> to render the radio button and <r:title /> to render the option’s text. <r:submit /> render’s the form’s submit button. | |
Rendering the results: | |
Use <r:options:each> and <r:title /> to render each option and its text. To render the number of responses for the current option, use <r:number_responses />. To render the |
This file contains 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
require 'rubygems' | |
require 'roxml' | |
class Pricing | |
include ROXML | |
xml_name "Pricing" | |
xml_text :base_price, "BasePrice" | |
xml_text :localized_base_price, "LocalizedBasePrice" | |
end | |
NewerOlder