Skip to content

Instantly share code, notes, and snippets.

View nuex's full-sized avatar
👾

Chase James nuex

👾
  • Lexington, KY
View GitHub Profile
@nuex
nuex / budget-calc
Created October 7, 2012 18:07
budget-calc
#!/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:
#
@nuex
nuex / helpers.awk
Created September 16, 2011 20:06
render.awk - render an html, given a layout, metadata, and a markdown page
function load_helpers() {
data["page_title"] = page_title()
}
function page_title( title) {
if (data["title"]) {
title = data["title"] " - "
}
@nuex
nuex / rlc.sh
Created August 12, 2011 16:50
rlc - resize like crazy - resize all images in a directory recursively
#!/bin/sh
#
# rlc: resize like crazy
#
# rlc.sh targetdir
target=$1
destination=$target-resized
dimensions=1000x
quality=100
@nuex
nuex / html5vid.sh
Created June 20, 2011 19:35
make a bunch of html5 video formats from a source video
#!/bin/sh
# html5vid.sh
#
# Encode an input video to multiple html5-ready formats:
# - webm
# - ogv
# - mp4
# - png (50th frame)
#
@nuex
nuex / import_osxfnt.sh
Created November 29, 2010 15:53
Imports OSX fonts from a zip file
#!/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:
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();
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}'
@nuex
nuex / gist:109410
Created May 9, 2009 21:32
jQuery-like getJSON function in ActionScript 3
/*
* 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/
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
@nuex
nuex / gist:11630
Created September 19, 2008 18:26
little lib for parsing Yahoo! Store XML
require 'rubygems'
require 'roxml'
class Pricing
include ROXML
xml_name "Pricing"
xml_text :base_price, "BasePrice"
xml_text :localized_base_price, "LocalizedBasePrice"
end