| var Promise = function(wrappedFn, wrappedThis) { | |
| this.then = function(wrappedFn, wrappedThis) { | |
| this.next = new Promise(wrappedFn, wrappedThis); | |
| return this.next; | |
| }; | |
| this.run = function() { | |
| wrappedFn.promise = this; | |
| wrappedFn.apply(wrappedThis); | |
| }; |
To test a glob pattern go over to globtester and play around with creating your own file structure online, it's super easy to get started that way.
If you want to test out a glob pattern in the terminal use echo followed by the pattern, for instance.
echo **/*.js
Following this guide will set up a local Elasticsearch with Kibana and Marvel using Homebrew and Homebrew Cask
If you already have Java installed on your system, skip steps Install Cask and Install Java
If you already have Java and Homebrew installed on your system, skip steps Prerequisites, start at Install Elasticsearch and Kibana after running $ brew update
$ ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
Picking the right architecture = Picking the right battles + Managing trade-offs
- Clarify and agree on the scope of the system
- User cases (description of sequences of events that, taken together, lead to a system doing something useful)
- Who is going to use it?
- How are they going to use it?
| function asyncFunc(e) { | |
| return new Promise((resolve, reject) => { | |
| setTimeout(() => resolve(e), e * 1000); | |
| }); | |
| } | |
| const arr = [1, 2, 3]; | |
| let final = []; | |
| function workMyCollection(arr) { |
| function throttle(callback, wait, immediate = false) { | |
| let timeout = null | |
| let initialCall = true | |
| return function() { | |
| const callNow = immediate && initialCall | |
| const next = () => { | |
| callback.apply(this, arguments) | |
| timeout = null | |
| } |
I recently switched over to neovim (see my screenshots at the bottom). Below is my updated config file.
It's currently synchronized with my .vimrc config except for a block of neovim-specific terminal key mappings.
This is still a work in progress (everyone's own config is always a labor of love), but I'm already extremely pleased with how well this is working for me with neovim. While terminal mode isn't enough to make me stop using tmux, it is quite good and I like having it since it simplifies my documentation workflow for yanking terminal output to paste in a markdown buffer.
These days I primarily develop in Go. I'm super thrilled and grateful for fatih/vim-go,
- A recent version of Node.js
npm install -g create-react-app