Skip to content

Instantly share code, notes, and snippets.

View codearmorygists's full-sized avatar

codearmorygists

View GitHub Profile
@codearmorygists
codearmorygists / checkall.js
Created September 19, 2012 22:46
Check/uncheck all checkboxes in a form
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;
}
}
}
@codearmorygists
codearmorygists / rpg.php
Created September 19, 2012 22:45
Random Readable Password
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,';
@codearmorygists
codearmorygists / curl.php
Created September 19, 2012 22:44
PHP curl
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();
@codearmorygists
codearmorygists / rng.js
Created September 19, 2012 22:42
Random Name Generator
gLastNames = [
"Wood",
"May",
"Gallagher",
"Steele",
"Solomon",
"Monroe",
"Bender",
"Hamilton",
"Chung",
@codearmorygists
codearmorygists / ajaxappend.js
Created September 19, 2012 22:28
AjaxAppend: Autoappend JSON returned from an AJAX call, formatted by Underscore Templating Engine http://tybenz.com/ajaxAppend
/*!
* 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 ){
/* 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(){};
// 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] ||