Skip to content

Instantly share code, notes, and snippets.

View bittersweetryan's full-sized avatar

Ryan Anklam bittersweetryan

View GitHub Profile
@bittersweetryan
bittersweetryan / Person.cfc
Created June 29, 2012 22:02 — forked from cfvonner/Person.cfc
Sample Components for CFKoans Mocking tests
<cfscript>
component displayname="Person" hint="I am a person object." output="false" accessors="true"
{
// Define the properties for this component
property name="personID" type="numeric" getter="true" setter="false" hint="Unique numeric id assigned by the database.";
property name="firstName" type="string" getter="true" setter="true" hint="The first name of the person.";
property name="lastName" type="string" getter="true" setter="true" hint="The last name of the person.";
property name="dateOfBirth" type="date" getter="true" setter="true" hint="The date of birth of the person.";

##Bio

Ryan Anklam is a Technical Solutions Architect at IDL Solutions which is a large enterprise and government focused technology company based in Milwaukee, WI. He has been doing web development using numerous platforms since 1996. Ryan is currently focused on developing large scale, single page applications using JavaScript and ColdFusion. He is passionate about code quality, unit testing, continous learning, and sharing code on GitHub. When he's not writing code he's either coaching basketball, riding his mountain bike, or spending time with his family.

##The Art Of JavaScript: Level Up Your Skills In 50 Minutes

>JavaScript is one of the most popular and fastest growing programming languages in the world. Many developers are introduced to JavaScript programming through one of the many frameworks such as jQuery, Dojo, or Sencha. While these frameworks allow developers to quickly be productive, they also create an environment where developers tend to overlook the fundamentals of the underlying JavaSc

$("ul").one('click','li',function(
$(this).css('text-decoration','line-through');
});
$("#once").one('click', { color: 'blue', size : 'xxl' }, function(e){
console.log('click once you ' + e.data.size + ' ' + e.data.color + ' rabbit.');
});
});
$("#once").one('mousedown mouseup click',function(){
console.log("click once");
});
$("#once").one('click',function(){
console.log("click once");
});
@bittersweetryan
bittersweetryan / AMD.sublime-snippet
Created July 25, 2012 19:27
create AMD module with jquery and backbone
<snippet>
<content><![CDATA[
define([
'jQuery',
'Underscore',
'Backbone'${2:,}
${1:''
}], function(\$, _, Backbone${4:, }${3: })\{
$0
\});
a(); //a makes an async call like an ajax request
b();
$.when(a())
.then(b);
var a = function(){
return $.Deferred(function(dfd){
//do something
dfd.resolve;
}).promise();
}
var obj = {
a : function(){
//do something
$(this).trigger("done");
}
}
$(obj).on("done",b);