Skip to content

Instantly share code, notes, and snippets.

View markmansour-zz's full-sized avatar

Mark Mansour markmansour-zz

View GitHub Profile
@markmansour-zz
markmansour-zz / optimize_images.rb
Created June 25, 2012 23:00 — forked from meleyal/optimize_images.rb
Simple png + jpg optimization script using optipng + jpegtran
#!/usr/bin/ruby
# Instructions
# - Install optipng + libjpeg (http://mxcl.github.com/homebrew/)
# - Put this file in a directory of images
# - Open in TextMate + run it (cmd+r)
# Config
@markmansour-zz
markmansour-zz / gist:1990113
Created March 7, 2012 00:33
How to deal with Decimals.
1.9.3-p0 :005 > (BigDecimal("70") - BigDecimal("10.95")).to_s("F")
=> "59.05"
1.9.3-p0 :006 > (BigDecimal("70") - BigDecimal("40.95")).to_s("F")
=> "29.05"
1.9.3-p0 :007 >
YAHOO.AgileBench.StoryDataSource = function() {
this.todoDataSource = null;
this.inprogressDataSource = null;
this.completeDataSource = null;
this.incompleteDataSource = null;
this.dataSourceReady = new YAHOO.util.CustomEvent("dataSourceReady", this);
this.init = function() {
url = "http://server/stories.json"
var request = YAHOO.util.Connect.asyncRequest('GET', url, jsonRequestCallback);
#!/bin/bash
if [[ "$0" =~ "set_proxy.sh" ]]
then
echo "You must run this script via 'source $0' not directly"
exit -1
fi
TIMEOUT=10
# have to blank out variables in case this is run more than once
USER_NAME=