Skip to content

Instantly share code, notes, and snippets.

View bennadel's full-sized avatar
💭
Life's a garden, dig it!

Ben Nadel bennadel

💭
Life's a garden, dig it!
View GitHub Profile
@bennadel
bennadel / Application.cfc
Created January 12, 2012 14:25
Some blog post??
<cfcomponent
output="false"
hint="I define the application settings and event handlers.">
<!--- Define the application settings. --->
<cfset this.name = hash( getCurrentTemplatePath() ) />
<cfset this.applicationTimeout = createTimeSpan( 0, 0, 30, 0 ) />
<cfset this.sessionManagement = false />
@bennadel
bennadel / demo.htm
Created January 13, 2012 21:47
Test Blog Post
<!DOCTYPE html>
<html>
<head>
<title>Loading GitHub Gists After Page Content Has Loaded -- UPDATED</title>
<style type="text/css">
.gist,
pre {
font-size: 12px ;
@bennadel
bennadel / demo.cfm
Created January 16, 2012 15:27
Experimenting With GitHub Gist-Based Code Samples For My Blog
<!--- Param our hashable string. --->
<cfparam name="form.hashable" type="string" default="" />
<!--- Check to see if we have a hashable string. --->
<cfif len( form.hashable )>
<!--- Create an MD5 hash of the string. --->
<cfset hashedString = hash( form.hashable, "MD5" ) />
@bennadel
bennadel / demo.htm
Created January 17, 2012 15:36
Trying To Mimic LET Functionality In JavaScript Using Self-Executing Functions
<!DOCTYPE html>
<html>
<head>
<title>Inline Functions Create Sandboxes For Variable Binding</title>
<script type="text/javascript">
// Create a buffer to hold our function - these will invoked
// at the end to demonstrate variable binding.
var methodBuffer = [];
@bennadel
bennadel / demo.htm
Created January 19, 2012 15:54
Using An IFrame To Override document.write() Inside A DOM (Document Object Model) Sandbox
<!DOCTYPE html>
<html>
<head>
<title>Loading GitHub Gists After Page Content Has Loaded</title>
<style type="text/css">
.gist,
pre {
font-size: 12px ;
@bennadel
bennadel / color-swatch.js
Created January 20, 2012 21:46
Handling Keyboard Shortcuts Within Modular JavaScript Application Architecture
// Define the color swtch View controller.
define(
[
"jquery",
"signal"
],
function( $, Signal ){
// I return an initialized component.
@bennadel
bennadel / color-swatch.js
Created January 23, 2012 16:07
Creating A Keyboard-Shortcuts Module In A Modular JavaScript Application
// Define the color swtch View controller.
define(
[
"jquery",
"signal"
],
function( $, Signal ){
// I return an initialized component.
@bennadel
bennadel / my-class.js
Created January 25, 2012 15:41
Managed Dependencies vs. Dependency Injection In RequireJS
// Define our class within the dependency management system.
define(
[
"dependency-1",
"dependency-2"
],
function( Dependency1, Dependency2 ){
// Define the actual class constructor and methods.
@bennadel
bennadel / friend.js
Created January 26, 2012 15:30
Extending Classes In A Modular JavaScript Application Architecture Using RequireJS
// Define the Friend model class. This extends the core Model.
define(
[
"./model"
],
function( Model ){
// I return an initialized object.
function Friend( name ){
@bennadel
bennadel / demo.js
Created January 31, 2012 15:41
Using jQuery Deferred To Chain Validation Rules In An Asynchronous, Non-Blocking Environment
// Define the aynchronous validate() plugin for jquery.
(function( $ ){
// Define the validation factory. This will create an augmented
// Deferred object for each validator within the validation chain.
function Validation(){
// Create a deferred object that will be used to hold the
// state of a given validation step.