This file contains hidden or 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
| // Defer Image loading until parent headers come into view | |
| // ======================================================= | |
| // Setup vars | |
| var win = $(window), | |
| lazyScrollDelta = 200, | |
| headerIndex = 0, | |
| sectionCount = all_products.length - 1; | |
| // Bind scroll event |
This file contains hidden or 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
| $.parseJSON(decodeURIComponent($.getCookie('COOKIE_NAME'))); |
This file contains hidden or 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
| # To understand why this is important and a better idea than `*.css?v231`, read: | |
| # http://stevesouders.com/blog/2008/08/23/revving-filenames-dont-use-querystring | |
| <IfModule mod_rewrite.c> | |
| RewriteCond %{REQUEST_FILENAME} !-f | |
| RewriteCond %{REQUEST_FILENAME} !-d | |
| RewriteRule ^(.+)\.(\d+)\.(js|css|png|jpg|gif)$ $1.$3 [L] | |
| </IfModule> |
This file contains hidden or 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
| // define the function to see what the rabbits say | |
| function speak (line) { | |
| console.log("The ", this.adjective, " rabbit says ", line); | |
| } | |
| // define some rabbit objects | |
| var whiteRabbit = {adjective: "white", speak: speak}; | |
| var fatRabbit = {adjective: "fat", speak: speak}; | |
| // apply an array of arguments to our fatter of the two rabbit objects |
This file contains hidden or 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
| // Update the appropriate href query string parameter | |
| function paramReplace(name, string, value) { | |
| // Find the param with regex | |
| // Grab the first character in the returned string (should be ? or &) | |
| // Replace our href string with our new value, passing on the name and delimeter | |
| var re = new RegExp("[\\?&]" + name + "=([^&#]*)"), | |
| delimeter = re.exec(string)[0].charAt(0), | |
| newString = string.replace(re, delimeter + name + "=" + value); | |
| return newString; |
This file contains hidden or 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
| // Lazy load directive, taken from http://slid.es/djsmith/deep-dive-into-custom-directives | |
| directive('myLazyLoad', function() { | |
| return { | |
| transclude: 'element', | |
| priority: 1200, // changed needed for 1.2 | |
| terminal: true, | |
| restrict: 'A', | |
| compile: function(element, attr, linker) { | |
| return function (scope, iterStartElement, attr) { |
This file contains hidden or 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
| sudo ln -s "/Applications/Sublime Text.app/Contents/SharedSupport/bin/subl" /usr/local/bin |
This file contains hidden or 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 jq = document.createElement('script'); | |
| jq.src = "https://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js"; | |
| document.getElementsByTagName('head')[0].appendChild(jq); | |
| jQuery.noConflict(); | |
| var array = [] | |
| $(".title > a").each(function() { | |
| array.push($(this).text()); | |
| }); |
This file contains hidden or 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
| # generate ssh key | |
| ssh-keygen -t rsa | |
| # copy public key to clipboard | |
| pbcopy < ~/.ssh/id_rsa.pub |
This file contains hidden or 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
| (function(console){ | |
| console.save = function(data, filename){ | |
| if(!data) { | |
| console.error('Console.save: No data') | |
| return; | |
| } | |
| if(!filename) filename = 'console.json' |