brew install mongodb
Set up launchctl to auto start mongod
$ ln -sfv /usr/local/opt/mongodb/*.plist ~/Library/LaunchAgents
/usr/local/opt/mongodb/
is a symlink to /usr/local/Cellar/mongodb/x.y.z
(e.g., 2.4.9
)
############################################################################## | |
# History Configuration | |
############################################################################## | |
HISTSIZE=5000 #How many lines of history to keep in memory | |
HISTFILE=~/.zsh_history #Where to save history to disk | |
SAVEHIST=5000 #Number of history entries to save to disk | |
#HISTDUP=erase #Erase duplicates in the history file | |
setopt appendhistory #Append history to the history file (no overwriting) | |
setopt sharehistory #Share history across terminals | |
setopt incappendhistory #Immediately append to the history file, not just when a term is killed |
// See https://wiki.openstreetmap.org/wiki/Slippy_map_tilenames for more details. | |
var degrees2meters = function(lon,lat) { | |
var x = lon * 20037508.34 / 180; | |
var y = Math.log(Math.tan((90 + lat) * Math.PI / 360)) / (Math.PI / 180); | |
y = y * 20037508.34 / 180; | |
return [x, y] | |
} | |
x= -77.035974 |
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE | |
Version 2, December 2004 | |
Copyright (C) 2011 Tom Robinson <http://tlrobinson.net/> | |
Everyone is permitted to copy and distribute verbatim or modified | |
copies of this license document, and changing it is allowed as long | |
as the name is changed. | |
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE |
/** | |
* Patch the console methods in order to provide timestamp information | |
* | |
* Usage: | |
* > console.log('ok') | |
* 2012-09-06T11:52:56.769Z ok true | |
* | |
* Note: | |
* The patch will only be applied with the first call. | |
* |
using System; | |
using System.Collections.Generic; | |
using System.Reactive; | |
using System.Reactive.Disposables; | |
using System.Reactive.Linq; | |
using System.Windows.Forms; | |
namespace RxStuff | |
{ | |
class Program | |
{ |
(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.
// NOTICE 2020-04-18 | |
// Please see the comments below about why this is not a great PRNG. | |
// Read summary by @bryc here: | |
// https://github.com/bryc/code/blob/master/jshash/PRNGs.md | |
// Have a look at js-arbit which uses Alea: | |
// https://github.com/blixt/js-arbit | |
/** |
Here is an example how await
operator can be desugared into Promise-based code without ES6 generators (and state machines that emulate generators missing in ES5).
The only assumption is that there is Promise.resolve
(to create an empty promise for the loop finalization) among the globals.
Examples are written with "throw early" policy adoption: if promisified code has a synchronous preamble that throws we prefer to throw instead of creating rejected Promise.
Note that patterns below don't cover control flow breaks like return
, break
, continue
and throw
(for these breaks we should use a bit more complex structures).