Skip to content

Instantly share code, notes, and snippets.

@LeoHeo
LeoHeo / var-let-const.md
Last active February 13, 2024 08:21
javascript var, let, const 차이점

var, let, const 차이점은?

  • varfunction-scoped이고, let, constblock-scoped입니다.

  • function-scopedblock-scoped가 무슨말이냐?

var(function-scoped)

jsfiddle 참고주소

@JohannesRudolph
JohannesRudolph / time-ago.pipe.spec.ts
Created December 1, 2016 09:58
Angular2 TimeAgo Pipe
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
@xx4159
xx4159 / mosql-wiki.md
Created November 28, 2016 06:15
Migrate Mongodb to PostgreSQL

Migrate Mongodb to PostgreSQL

목적

  • 사용자의 로컬 테스트를 목적으로 쓰여진 내용입니다.
  • mac osx에서 진행했으며, ubuntu 나 centos같은 다른 리눅스 버전에서는 다를 수 있음!
  • This is FOR OSX
  • I hope we collaborate.

Prerequire

  • postgreSQL install.
  • mongodb가 replica setting.
@paulirish
paulirish / what-forces-layout.md
Last active April 26, 2024 17:33
What forces layout/reflow. The comprehensive list.

What forces layout / reflow

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.

Element APIs

Getting box metrics
  • elem.offsetLeft, elem.offsetTop, elem.offsetWidth, elem.offsetHeight, elem.offsetParent
@thewarpaint
thewarpaint / filter.js
Created August 25, 2014 04:30
Angular filter to convert numbers to thousand suffixes (1234 > 1.2k)
// 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)) {
@KittyGiraudel
KittyGiraudel / main.scss
Last active April 5, 2022 19:11
From: Architecturing a Sass project
// 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";
@caike
caike / node.md
Last active August 1, 2022 03:57
post about Node.js, non-blocking I/O and the event loop

#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.

@paulirish
paulirish / rAF.js
Last active March 22, 2024 00:00
requestAnimationFrame polyfill
// 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'];
@lxneng
lxneng / gist:741932
Created December 15, 2010 13:21
install PostgreSQL 9 in Mac OSX via Homebrew
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