This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Inline-block trinity | |
@mixin inline-block{ | |
display:inline-block; | |
*display:inline; | |
zoom:1; | |
} | |
// Hide text for background image replacement | |
@mixin hide-text{ | |
overflow:hidden; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
display:inline-block; | |
*display:inline; | |
*zoom:1; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var global = "Global string"; | |
function firstFunction(){ | |
var local = "Local string"; | |
alert(global); //alerts out 'Global string' | |
alert(local); //alerts out 'Local string' | |
} | |
function secondFunction(){ | |
alert(global); //alerts out "Global string" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var Class = function(){ | |
//private | |
var privateVariable = 2; | |
function privateFunction(){ | |
return 5; | |
} | |
//public | |
return { | |
publicFunction1 : function(){ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* Writing Unit Tests to learn code or a library has been a fantastic strategy for me. | |
* I wrote these Jasmine Tests to enforce some of the very powerful concepts from | |
* https://github.com/rwldrn/idiomatic.js?utm_source=javascriptweekly&utm_medium=email. | |
*/ | |
describe("JavaScript Idiomatics", function() { | |
describe("Coercion", function() { | |
it("coerces string into number", function() { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var MultiSortCollection = Backbone.Collection.extend({ | |
/** | |
* Sort by supplied attributes. First param is sorted first, and | |
* last param is final subsort | |
* @param {String} sortAttributes | |
* @example collection.sortBy("last_name","first_name") | |
*/ | |
sortBy : function(sortAttributes){ | |
var attributes = arguments; |