Skip to content

Instantly share code, notes, and snippets.

View rwaldron's full-sized avatar

Rick Waldron rwaldron

  • Boston, MA
View GitHub Profile
/* ------------------------------ Main Class ------------------------------ */
// Returns "instances" of itself which are actually functions.
function Ben ( greeting ) { var Parent, scope
function Scope () {
// Here is where you put your normal constructor junk
this.greeting = greeting
this.colours = [ 'yellow', 0xFFFFFF ]
}
// Magic
/**
* This library defines magic properties and methods
* for objects. Generic hooks are: __get__, __set__,
* __delete__, __count__ and __noSuchProperty__.
*
* Used features: Harmony (ES6) proxies.
*
* Tested in FF4 beta.
*
* @author Dmitry A. Soshnikov <[email protected]>
/*!
* jQuery log selector - v0.1pre - 10/22/2010
* http://benalman.com/
*
* Copyright (c) 2010 "Cowboy" Ben Alman
* Dual licensed under the MIT and GPL licenses.
* http://benalman.com/about/license/
*/
// Log the selector used to select elements to each selected element,
<?php
echo "Prepping CSS and JS for deploy...\n";
$css_files['app'] = array('reset', '960', 'screen', 'jquery.tagsinput', 'jquery.autocomplete', 'tipsy', 'prettify');
//$css_files['splash'] = array('reset', 'splash');
//$css_files['iphone'] = array('reset', 'screen', 'iphone');
$js_files['app'] = array('jquery.autocomplete.min', 'jquery.tagsinput', 'jquery.scrollTo-1.4.2-min', 'forrst',
'jquery.tipsy', 'jquery.autoresize.min', 'prettify',
/*!
* jQuery Tiny Pub/Sub - v0.X - 11/18/2010
* http://benalman.com/
*
* Original Copyright (c) 2010 "Cowboy" Ben Alman
* Dual licensed under the MIT and GPL licenses.
* http://benalman.com/about/license/
*
* Made awesome by Rick Waldron
*
// SMELLY: HTML in your JavaScript
$('#showMessage').click(function() {
$('<div>' +
'<h1>' + $('#messageTitle').val() + '</h1>' +
'<p>' + $('#messageText').val() + '</p>' +
'</div>')
.appendTo('#messageContainer')
});
// MINTY FRESH: Use templates instead
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>Detect Credit Card Type</title>
</head>
<body>
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>Detect Credit Card Type</title>
</head>
<body>
/*!
* jQuery htmlDoc "fixer" - v0.2pre - 12/15/2010
* http://benalman.com/projects/jquery-misc-plugins/
*
* Copyright (c) 2010 "Cowboy" Ben Alman
* Dual licensed under the MIT and GPL licenses.
* http://benalman.com/about/license/
*/
(function($){
// Want to learn more about Immediately Invoked Function Expressions? Read
// this article first:
//
// http://benalman.com/news/2010/11/immediately-invoked-function-expression/
// Parens are used to tell the parser that it's a function expression,
// not a function declaration. If you don't explicitly tell the parser to
// expect an expression, it will throw a SyntaxError exception because it
// sees a function declaration without a name specified.