function trackDownload(link) {
var fileName = link.getAttribute('href');
fileName = fileName.split('/').pop();
// Track event in GA
_gaq.push(['_trackEvent', 'Download', 'Resources Download', fileName]);
}
- Functional Programming for the Object-Oriented Programmer
- Design Patterns: Elements of Reusable Object-Oriented Software
- [Agile Software Development, Principles, Patterns, and Practices] (http://www.amazon.com/Software-Development-Principles-Patterns-Practices/dp/0135974445/ref=pd_sim_14_44?ie=UTF8&refRID=1YR3J29Y6PA7WWJBGR1H)
- The Pragmatic Programmer: From Journeyman to Master
- Refactoring: Improving the Design of Existing Code
- [Patterns of Enterprise Application Architecture](http://www.amazon.com/Patterns-Enterprise-Application-Architecture-Mart
JavaScript Books
-
High Performance JavaScript - zakas
-
JavaScript Patterns
require 'pry' | |
# | |
# +---+---+---+ | |
# | | | | | |
# | 3 | 5 | 4 | | |
# | | | | | |
# +---+---+---+ | |
# |
Ignoring files from local work folder, without altering the .gitignore
.
git update-index --assume-unchanged <file1> <file2> <file3>
// Bonfire: Find the Longest Word in a String | |
// Author: @vadimbrodsky | |
// Challenge: http://www.freecodecamp.com/challenges/bonfire-find-the-longest-word-in-a-string | |
// Learn to Code at Free Code Camp (www.freecodecamp.com) | |
function findLongestWord(str) { | |
return str.toLowerCase().split(' ').sort(function(a, b) { | |
if (a.length < b.length) { | |
return 1; | |
} else if (a.length > b.length) { |
;; -*- mode: emacs-lisp -*- | |
;; This file is loaded by Spacemacs at startup. | |
;; It must be stored in your home directory. | |
(defun dotspacemacs/layers () | |
"Configuration Layers declaration. | |
You should not put any user code in this function besides modifying the variable | |
values." | |
(setq-default | |
;; Base distribution to use. This is a layer contained in the directory |
By default, Rails applications build URLs based on the primary key -- the id
column from the database. Imagine we have a Person
model and associated controller. We have a person record for Bob Martin
that has id
number 6
. The URL for his show page would be:
/people/6
But, for aesthetic or SEO purposes, we want Bob's name in the URL. The last segment, the 6
here, is called the "slug". Let's look at a few ways to implement better slugs.
Source -- http://craftcms.stackexchange.com/a/6996
Untested, but you should be able to do this by using the [merge filter in Twig][1] to join the two results together.
Get the top level 'landing page' for this section:
{% set landingPage = entry.getAncestors().level(1) %}