(by @andrestaltz)
If you prefer to watch video tutorials with live-coding, then check out this series I recorded with the same contents as in this article: Egghead.io - Introduction to Reactive Programming.
let lsb = ['', 'one', 'two', 'three', 'four', 'five', 'six', 'saven', 'eight', 'nine'], | |
mid = ['', 'ten', 'tweenty', 'therty', 'fourty', 'fifty', 'sixty', 'saventy', 'eighty', 'ninty'], | |
msb = ['', 'one hundred', 'two hundred', 'three hundred', 'four hundred', 'five hundred', 'six hundred', 'saven hundred', 'eight hundred', 'nine hundred'], | |
num = 445; | |
input = String(num); | |
let msbBit = Number(input[0]), | |
midBit = input.length > 1 ? Number(input[1]) : 0, | |
lsbBit = input.length > 2 ? Number(input[2]) : 0; |
//Array syntax | |
let promises = [promiseOne(), promiseTwo(), promiseThree()]; | |
$q.all(promises).then((values) => { | |
console.log(values[0]); // value One | |
console.log(values[1]); // value Two | |
console.log(values[2]); // value Three | |
// do something |
/** | |
* @title: `setting up BaseCtrl` in AngularJS 1.3.x | |
* @author: Shahzad Nawaz | |
* @dated: 2/28/2015. | |
*/ | |
(function () { | |
'use strict'; | |
/*Base Controller starts*/ |
var myApp = angular.module('myApp', []); | |
myApp.directive('googleplace', function() { | |
return { | |
require: 'ngModel', | |
scope: { | |
ngModel: '=', | |
details: '=?' | |
}, | |
link: function(scope, element, attrs, model) { |
#!/bin/bash | |
# node-reinstall | |
# credit: http://stackoverflow.com/a/11178106/2083544 | |
## program version | |
VERSION="0.0.13" | |
## path prefix | |
PREFIX="${PREFIX:-/usr/local}" |
(by @andrestaltz)
If you prefer to watch video tutorials with live-coding, then check out this series I recorded with the same contents as in this article: Egghead.io - Introduction to Reactive Programming.
This has been incorporated in a small library.
// # Mocha Guide to Testing | |
// Objective is to explain describe(), it(), and before()/etc hooks | |
// 1. `describe()` is merely for grouping, which you can nest as deep | |
// 2. `it()` is a test case | |
// 3. `before()`, `beforeEach()`, `after()`, `afterEach()` are hooks to run | |
// before/after first/each it() or describe(). | |
// | |
// Which means, `before()` is run before first it()/describe() |
# delete local tag '12345' | |
git tag -d 12345 | |
# delete remote tag '12345' (eg, GitHub version too) | |
git push origin :refs/tags/12345 | |
# alternative approach | |
git push --delete origin tagName | |
git tag -d tagName |