- Install iTerm2 from https://www.iterm2.com/
- Install oh-my-zsh from https://ohmyz.sh/ or https://github.com/robbyrussell/oh-my-zsh
- Set iTerm2 theme tab theme to Dark -
Preferences | Appearance | Tabs | Theme > Dark
- Install Fira Code fonts from https://github.com/tonsky/FiraCode (Clone and navigate to
dstr > ttf
, install all font files by double clicking) - Install Powerline fonts from https://github.com/powerline/fonts
- Set fonts for iTerm2 -
Preferences | Profiles | Text
- Change
Font
to14pt Fira code regular
and CheckUse Ligatures
checkbox - Change
Non ASCII Font
to14pt Fira mono
and CheckUse Ligatures
checkbox
- Change
- Install iTerm2 snazzy theme from https://github.com/sindresorhus/iterm2-snazzy
- Navigate to
Preferences | Profiles | Color Presets > Snazzy
- Navigate to
Vim has two modes insertion mode and command mode. The editor begins in command mode, where the cursor movement and text deletion and pasting occur. Insertion mode begins upon entering an insertion or change command. [ESC]
returns the editor to command mode (where you can quit, for example by typing :q!
). Most commands execute as soon as you type them except for "colon" commands which execute when you press the ruturn key.
:x
Exit, saving changes:q
Exit as long as there have been no changesZZ
Exit and save changes if any have been made:q!
Exit and ignore any changes
##what are generators##
- They're pausable functions, pausable iterable functions, to be more precise
- They're defined with the *
- every time you
yield
a value, the function pauses until.next(modifiedYieldValue)
is called
var myGen = function*() {
var one = yield 1;
var two = yield 2;
var three = yield 3;
console.log(one, two, three);
var path = require('path'); | |
var gulp = require('gulp'); | |
var streamqueue = require('streamqueue'); | |
var $gulp = require('gulp-load-plugins')({ | |
lazy: false | |
}); | |
var prependBowerPath = function (package) { | |
return path.join('./src/bower_components/', package); | |
}; |
/** | |
* testing tasks (using karma to test in the browser). Requires a karma.conf.js for full config | |
* single-run testing | |
* continuous testing | |
*/ | |
/** base deps, but you may need more specifically for your application */ | |
var gulp = require('gulp'); | |
var gutil = require('gulp-util'); | |
var path = require('path'); |
o.......Open files, directories and bookmarks....................|NERDTree-o|
go......Open selected file, but leave cursor in the NERDTree.....|NERDTree-go|
t.......Open selected node/bookmark in a new tab.................|NERDTree-t|
T.......Same as 't' but keep the focus on the current tab........|NERDTree-T|
i.......Open selected file in a split window.....................|NERDTree-i|
gi......Same as i, but leave the cursor on the NERDTree..........|NERDTree-gi|
s.......Open selected file in a new vsplit.......................|NERDTree-s|
gs......Same as s, but leave the cursor on the NERDTree..........|NERDTree-gs|
O.......Recursively open the selected directory..................|NERDTree-O|
This article has been given a more permanent home on my blog. Also, since it was first written, the development of the Promises/A+ specification has made the original emphasis on Promises/A seem somewhat outdated.
Promises are a software abstraction that makes working with asynchronous operations much more pleasant. In the most basic definition, your code will move from continuation-passing style:
getTweetsFor("domenic", function (err, results) {
// the rest of your code goes here.