-
var
는function-scoped
이고,let
,const
는block-scoped
입니다. -
function-scoped
와block-scoped
가 무슨말이냐?
import { fakeAsync, tick } from '@angular/core/testing'; | |
import { Observable } from 'rxjs/Observable'; | |
import 'rxjs/add/observable/interval'; | |
import 'rxjs/add/operator/takeWhile'; | |
import { TimeAgoPipe } from './time-ago.pipe'; | |
import { WrappedValue } from '@angular/core'; | |
// Learning |
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
// Based on http://stackoverflow.com/questions/1571374/converting-values-to-unit-prefixes-in-jsp-page. | |
// The inner filter function can be used standalone. | |
angular.module('Utils') | |
.filter('thousandSuffix', function () { | |
return function (input, decimals) { | |
var exp, rounded, | |
suffixes = ['k', 'M', 'G', 'T', 'P', 'E']; | |
if(window.isNaN(input)) { |
These rules are adopted from the AngularJS commit conventions.
// Sass utilities | |
@import "helpers/variables"; | |
@import "helpers/functions"; | |
@import "helpers/mixins"; | |
@import "helpers/placeholders"; | |
// Vendors and external stylesheets | |
@import "vendors/bootstrap"; | |
@import "vendors/jquery-ui"; |
#Node.js and the Event Loop
Node.js is a framework for writing server-side JavaScript applications. It is built on top of the V8 JavaScript runtime and uses an event-driven, non-blocking I/O model that makes it perfectly suited for data-intensive real-time applications.
This blog post will describe what non-blocking I/O means and how working with the event loop can help your applications be more efficient.
##The Restaurant
"This [non-blocking I/O] model simplifies access to slow resources in a scalable way that is intuitive to JavaScript programmers and easy to learn for everyone else." - Node Up and Running.
// http://paulirish.com/2011/requestanimationframe-for-smart-animating/ | |
// http://my.opera.com/emoller/blog/2011/12/20/requestanimationframe-for-smart-er-animating | |
// requestAnimationFrame polyfill by Erik Möller. fixes from Paul Irish and Tino Zijdel | |
// MIT license | |
(function() { | |
var lastTime = 0; | |
var vendors = ['ms', 'moz', 'webkit', 'o']; |
install PostgreSQL 9 in Mac OSX via Homebrew | |
Mac OS X Snow Leopard | |
System Version: Mac OS X 10.6.5 | |
Kernel Version: Darwin 10.5.0 | |
Install notes for PostgreSQL 9.0.1 install using Homebrew: | |
sh-3.2# brew install postgresql |