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
// Simple JavaScript Templating | |
// John Resig - http://ejohn.org/ - MIT Licensed | |
(function(){ | |
var cache = {}; | |
this.tmpl = function tmpl(str, data){ | |
// Figure out if we're getting a template, or if we need to | |
// load the template - and be sure to cache the result. | |
var fn = !/\W/.test(str) ? | |
cache[str] = cache[str] || |
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
/* Simple JavaScript Inheritance | |
* By John Resig http://ejohn.org/ | |
* MIT Licensed. | |
*/ | |
// Inspired by base2 and Prototype | |
(function(){ | |
var initializing = false, fnTest = /xyz/.test(function(){xyz;}) ? /\b_super\b/ : /.*/; | |
// The base Class implementation (does nothing) | |
this.Class = function(){}; |
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
/*! | |
* ajaxAppend v1.0 - a jQuery Plugin by Tyler Benziger | |
* http://tylerbenziger.github.com/ajaxAppend | |
* | |
* Copyright 2012, Tyler Benziger | |
* | |
* Date: Tuesday June 26, 2012 09:47AM | |
*/ | |
(function( $, undefined ){ |
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
gLastNames = [ | |
"Wood", | |
"May", | |
"Gallagher", | |
"Steele", | |
"Solomon", | |
"Monroe", | |
"Bender", | |
"Hamilton", | |
"Chung", |
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 curl_download($Url){ | |
// is cURL installed yet? | |
if (!function_exists('curl_init')){ | |
die('Sorry cURL is not installed!'); | |
} | |
// OK cool - then let's create a new cURL resource handle | |
$ch = curl_init(); | |
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 random_readable_pwd($length=10){ | |
// the wordlist from which the password gets generated | |
// (change them as you like) | |
$words = 'dog,cat,sheep,sun,sky,red,ball,happy,ice,'; | |
$words .= 'green,blue,music,movies,radio,green,turbo,'; | |
$words .= 'mouse,computer,paper,water,fire,storm,chicken,'; | |
$words .= 'boot,freedom,white,nice,player,small,eyes,'; |
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 checkAll() { | |
var theForm, z = 0; | |
theForm = form_1; | |
for(z=0; z<theForm.length;z++){ | |
if(theForm[z].type == 'checkbox'){ | |
theForm[z].checked = true; | |
} | |
} | |
} |
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 'net/http' | |
require 'uri' | |
require "rexml/document" | |
# Retrieves US Location data based on a passed in Zipcode. Uses | |
# Google Maps geocoding service to retrieve a Hash of city, state, and zip | |
# For more info on the service see: <a href="http://code.google.com/apis/maps/documentation/geocoding/" >http://code.google.com/apis/maps/documentation/geocoding/</a> | |
# | |
# example: | |
# puts get_location_data(97030).inspect |
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 'pdf/reader' | |
class TotalPages | |
def count(dir) | |
@conv_directory = dir | |
## I output the directory argument as a test with the below line - | |
## mostly to make sure that passing '.' gets current dir | |
# puts @conv_directory |
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
find SOURCE_DIR -print -name "*.jpg" -execdir convert -resize 800x800 -quality 80 '{}' 'TARGET_DIR/{}' ; | |
find Pictures/ -print -name "*.jpg" -execdir convert -resize 800x800 -quality 80 '{}' '/tmp/test/{}' ; |
OlderNewer