Combine default parameters and destructuring for a compact version of the defaults / overrides pattern.
function foo ({
bar = 'no',
baz = 'works!'
} = {}) {
module.exports = function (grunt) { | |
// show elapsed time at the end | |
require('time-grunt')(grunt); | |
// load all grunt tasks | |
require('load-grunt-tasks')(grunt); | |
//MODIFIED: add require for connect-modewrite | |
var modRewrite = require('connect-modrewrite'); | |
grunt.initConfig({ |
:+1: | |
:-1: | |
:airplane: | |
:art: | |
:bear: | |
:beer: | |
:bike: | |
:bomb: | |
:book: | |
:bulb: |
/* Set up Git Configuration */ | |
git config --global user.email "neil@coolestguidesontheplanet.com" | |
git config --global user.name "Neil Gee" | |
git config --global core.editor "vi" | |
git config --global color.ui true |
// We have the option to define arguments for a custom resource | |
interface IArticleParameters { | |
id: number; | |
} | |
interface IArticleResource extends ng.resource.IResource<IArticleResource> { | |
title: string; | |
text: string; | |
date: Date; | |
author: number; |
declare module ng{ | |
interface IAngularStatic{ | |
} | |
interface IPromise<T> { | |
then<TResult>(successCallback: (promiseValue: T) => IPromise<TResult>, errorCallback?: (reason: any) => any, notifyCallback?: (state: any) => any): IPromise<TResult>; | |
then<TResult>(successCallback: (promiseValue: T) => TResult, errorCallback?: (reason: any) => TResult, notifyCallback?: (state: any) => any): IPromise<TResult>; | |
} |
<body> | |
<div class="container"> | |
<!-- Centered inside whatever sized container --> | |
<div class="outer"> | |
<div class="inner"> | |
<div class="centered"> | |
<p> |
var dom = (function(window) { | |
'use strict'; | |
var docElem = window.document.documentElement; | |
function getViewportSize() { | |
return { | |
w: Math.max(document.documentElement.clientWidth, window.innerWidth || 0), | |
h: Math.max(document.documentElement.clientHeight, window.innerHeight || 0) |
// Person super class | |
function Person(name) { | |
this.name = name; | |
} | |
Person.prototype.describe = function () { | |
return 'Person called '+this.name; | |
}; | |
// Employee sub class | |
function Employee(name, title) { |
A very exclusive collection of only must-have JavaScript links. I'm only listing my favorite links. Nothing else makes the cut. Feel free to suggest links if you think they're good enough to make this list. The really curious should feel free to browse the comments to find other links. I can't guarantee the quality of links in the comments.
Some of these links are affiliate links, meaning that if you make a purchase, I might earn a little money. This has absolutely no bearing on whether or not links make the list. None, whatsoever. However, it does allow me more resources to fight poverty with code. Every little bit counts.