Skip to content

Instantly share code, notes, and snippets.

Avatar

Ben Nadel bennadel

View GitHub Profile
View Application.cfc
<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 Jan 13, 2012
Test Blog Post
View demo.htm
<!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 Jan 16, 2012
Experimenting With GitHub Gist-Based Code Samples For My Blog
View demo.cfm
<!--- 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 Jan 17, 2012
Trying To Mimic LET Functionality In JavaScript Using Self-Executing Functions
View demo.htm
<!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 Jan 19, 2012
Using An IFrame To Override document.write() Inside A DOM (Document Object Model) Sandbox
View demo.htm
<!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 Jan 20, 2012
Handling Keyboard Shortcuts Within Modular JavaScript Application Architecture
View color-swatch.js
// Define the color swtch View controller.
define(
[
"jquery",
"signal"
],
function( $, Signal ){
// I return an initialized component.
@bennadel
bennadel / color-swatch.js
Created Jan 23, 2012
Creating A Keyboard-Shortcuts Module In A Modular JavaScript Application
View color-swatch.js
// Define the color swtch View controller.
define(
[
"jquery",
"signal"
],
function( $, Signal ){
// I return an initialized component.
@bennadel
bennadel / my-class.js
Created Jan 25, 2012
Managed Dependencies vs. Dependency Injection In RequireJS
View my-class.js
// 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 Jan 26, 2012
Extending Classes In A Modular JavaScript Application Architecture Using RequireJS
View friend.js
// 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 Jan 31, 2012
Using jQuery Deferred To Chain Validation Rules In An Asynchronous, Non-Blocking Environment
View demo.js
// 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.
You can’t perform that action at this time.