(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.
(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.
#list all ports for tcp | |
sudo lsof -itcp | |
#find all things listening on ports | |
lsof -Pnl +M -i4 | grep LISTEN | |
#all ports for tcp, dont resolve port name from numbers | |
sudo lsof -itcp -P | |
#open files and ports of process #$PID |
Sometimes you may want to undo a whole commit with all changes. Instead of going through all the changes manually, you can simply tell git to revert a commit, which does not even have to be the last one. Reverting a commit means to create a new commit that undoes all changes that were made in the bad commit. Just like above, the bad commit remains there, but it no longer affects the the current master and any future commits on top of it.
git revert {commit_id}
Deleting the last commit is the easiest case. Let's say we have a remote origin with branch master that currently points to commit dd61ab32. We want to remove the top commit. Translated to git terminology, we want to force the master branch of the origin remote repository to the parent of dd61ab32:
None of the string methods modify this
– they always return fresh strings.
charAt(pos: number): string
ES1
Returns the character at index pos
, as a string (JavaScript does not have a datatype for characters). str[i]
is equivalent to str.charAt(i)
and more concise (caveat: may not work on old engines).
Some things that are "better" with this BetterPromise
implementation:
BetterPromise # then(..)
accepts a BetterPromise
(or Promise
) instance passed directly, instead of requiring a function to return it, so that the promise is linked into the chain.
var p = BetterPromise.resolve(42);
var q = Promise.resolve(10);
p.then(console.log).then(q).then(console.log);