- node.js
- Installation paths: use one of these techniques to install node and npm without having to sudo.
- Node.js HOWTO: Install Node+NPM as user (not root) under Unix OSes
- Felix's Node.js Guide
- Creating a REST API using Node.js, Express, and MongoDB
- Node Cellar Sample Application with Backbone.js, Twitter Bootstrap, Node.js, Express, and MongoDB
- JavaScript Event Loop
- Node.js for PHP programmers
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import {Injectable} from '@angular/core'; | |
import {DateAdapter} from '@angular/material'; | |
import {addDays, addMonths, addYears, format, getDate, getDaysInMonth, getMonth, getYear, parse, setDay, setMonth, toDate} from 'date-fns'; | |
// CONFIG. Use environment or something for a dynamic locale and settings | |
import {es as locale} from 'date-fns/locale'; | |
const WEEK_STARTS_ON = 1; // 0 sunday, 1 monday... | |
export const MAT_DATE_FNS_DATE_FORMATS = { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function params(fn) { | |
var str = fn.toString(); | |
var sig = str.match(/\(([^)]*)\)/)[1]; | |
if (!sig) return []; | |
return sig.split(', '); | |
} | |
console.api = function(obj){ | |
console.log(); | |
var proto = Object.getPrototypeOf(obj); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# | |
# Use posixregex CLI tool from: https://github.com/syzdek/dmstools/blob/master/src/posixregex.c | |
RE_IPV4="((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])" | |
posixregex -r "^(${RE_IPV4})$" \ | |
127.0.0.1 \ | |
10.0.0.1 \ | |
192.168.1.1 \ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(function(angular) { | |
'use strict'; | |
var directives = angular.module('app.directives', []); | |
directives.directive('ngTap', function() { | |
return function(scope, element, attrs) { | |
var tapping; | |
tapping = false; | |
element.bind('touchstart', function(e) { |