// jQuery
$(document).ready(function() {
// code
})
/* | |
Here's some documentation on XMLHttpRequest Level 1 and 2 as per the | |
standard and as per implementation. | |
XHR | |
http://www.w3.org/TR/XMLHttpRequest/ | |
http://developer.apple.com/internet/webcontent/xmlhttpreq.html | |
http://msdn.microsoft.com/en-us/library/ms535874%28VS.85%29.aspx | |
XHR2 |
for (var i=1; i <= 20; i++) | |
{ | |
if (i % 15 == 0) | |
console.log("FizzBuzz"); | |
else if (i % 3 == 0) | |
console.log("Fizz"); | |
else if (i % 5 == 0) | |
console.log("Buzz"); | |
else | |
console.log(i); |
{ | |
"AL": "Alabama", | |
"AK": "Alaska", | |
"AS": "American Samoa", | |
"AZ": "Arizona", | |
"AR": "Arkansas", | |
"CA": "California", | |
"CO": "Colorado", | |
"CT": "Connecticut", | |
"DE": "Delaware", |
This entire guide is based on an old version of Homebrew/Node and no longer applies. It was only ever intended to fix a specific error message which has since been fixed. I've kept it here for historical purposes, but it should no longer be used. Homebrew maintainers have fixed things and the options mentioned don't exist and won't work.
I still believe it is better to manually install npm separately since having a generic package manager maintain another package manager is a bad idea, but the instructions below don't explain how to do that.
Installing node through Homebrew can cause problems with npm for globally installed packages. To fix it quickly, use the solution below. An explanation is also included at the end of this document.
'use strict'; | |
function BinarySearchTree() { | |
this.root = null; | |
} | |
BinarySearchTree.prototype.makeNode = function(value) { | |
var node = {}; | |
node.value = value; | |
node.left = null; |
.fadeinDown { | |
-webkit-animation: fadeInDown 500ms ease-in-out; /* Chrome, Safari, Opera */ | |
animation: fadeInDown 500ms ease-in-out; | |
} | |
/* Chrome, Safari, Opera */ | |
@-webkit-keyframes fadeInDown { | |
0% { |
All of the below properties or methods, when requested/called in JavaScript, will trigger the browser to synchronously calculate the style and layout*. This is also called reflow or layout thrashing, and is common performance bottleneck.
Generally, all APIs that synchronously provide layout metrics will trigger forced reflow / layout. Read on for additional cases and details.
elem.offsetLeft
,elem.offsetTop
,elem.offsetWidth
,elem.offsetHeight
,elem.offsetParent
/** | |
* @license Recursive-Primitive.js | |
* | |
* Copyright (c) 2014, Robert Eisele ([email protected]) | |
* Dual licensed under the MIT or GPL Version 2 licenses. | |
**/ | |
const add = (a, b) => b === 0 ? a : add(a + 1, b - 1); | |
const sub = (a, b) => b === 0 ? a : sub(a - 1, b - 1); | |
const mul = (a, b) => b === 1 ? a : add(mul(a, b - 1), a); |
@Component({ | |
selector: 'add-story-form', | |
template: ` | |
<div class="container"> | |
<h1>New Story</h1> | |
<form [formGroup]="newStory" | |
(submit)="submit($event)" | |
(success)="onSuccess()" | |
(error)="onError($event)" | |
connectForm="newStory"> |