Code Snippets / Slides / Etc. from my talk at jQueryTO this year
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.

jQueryTO2013 Talk

Tyler Savery

Here are the files used during my presentation at jQueryTO 2013. It was a lot of fun and I wanted to make sure those who liked my approach could revisit my code samples.


Audio Recording of my Talk

Slides PDF

Video Recording hopefully coming soon

Workflow Tools

  1. ".profile" - put this in your ~/ directory and relaunch terminal. If you get a minor error it means you don't have VCPrompt installed/in your path (for git repo identification). Either remove that line or install VCPrompt

  2. "" - run this to have a full featured calculator in your terminal

  3. "" - this will loop through pictures in a folder recurrsivly and create an MOV file. Requires FFMPEG to be installed.

  4. "" - awesome tool to build the folder/file structure of a new frontend project. Change as you like to meet your setup needs.

Code Snippets

These are in the repo, but you can see them here too!

Javascript Gotchas

1. Callbacks (get triggered on each element - not once)

	//log to console
	console.log("fadeout completed");

	//tell the server the fade out is complete
	//for some strange reason....

2. Variable Scope
var MyFunction = function(){

	var dog = "Doggy";  //scoped within function
	cat = "Kitty"; 		//works, but makes variable global

3. Using Selectors
var FunctionThatIsCalledAllTheTime = function(w){

	$(".bar").css("width", w + "px");



var App = {};

App.Cache = function(){

	App.dom = {}; = $('.foo'); = $('.bar');


var FunctionThatIsCalledAllTheTime = function(w){"active");"width", w + "px");

4. Many ways to call a function
loadSomePage = function(hash){
	// Never do this!

function loadSomePage(hash){
	// This is okay....

var loadSomePage = function(hash){
	//This is great

App.loadSomePage = function(hash){
	//This is namespaced and best

App.loadSomePage = function loadSomePage(hash){
	//This option can be useful because it 
	//provides a little more context when debugging.
5. "This" - works differently than other languages
var myFunction = function() {

var someObject = {};            
someObject.myFunction = myFunction; 

//logs the object as expected

//logs the window?
6. Adding / Subtracting Strings
var funnyFunction = function(add){
		return '5' + 3; //returns "53"
	} else {
		return '5' - 3; //returns 2


Photo of me presenting!