brew install tmux
Run tmux -CC
or tmux -CC attach
in iTerm2 and then menu is shown on terminal:
- ESC to detach
- C to run commands
- X to force quit
- L for log
brew install tmux
Run tmux -CC
or tmux -CC attach
in iTerm2 and then menu is shown on terminal:
Dumping your homebrew installed packages use the following command
brew bundle dump
This creates a Brewfile under the current directory. You can also write this from scratch easily and the specs are fairly easy. To install all packages from Brewfile run the following command
brew bundle
If you don't want download manually from Mac App Store, you can use Mas utility which download all specified apps from App Store for you automatically.
mas install wunderlist
Note: For apps installed from Mas you need to specify explicitly the id of app. If you don't know id, just run
mas search wunderlist // 410628904
Use this id with the name of app in your Brewfile config
Note: No extra tooling, no symlinks, files are tracked on a version control system, you can use different branches for different computers, you can replicate you configuration easily on new installation.
git init --bare $HOME/.dotfiles
alias config='/usr/bin/git --git-dir=$HOME/.dotfiles/ --work-tree=$HOME'
dotfiles config --local status.showUntrackedFiles no
const deepFreeze = (obj) => { | |
// Retrieve the property names defined on obj | |
const propNames = Object.getOwnPropertyNames(obj); | |
// Freeze properties before freezing self | |
propNames.forEach(function(name) { | |
const prop = obj[name]; | |
// Freeze prop if it is an object | |
if (typeof prop == 'object' && prop !== null) { |
ssh-keygen -t rsa -b 4096 -C "[email protected]"
This creates a new ssh key, using the provided email as a label.
Generating public/private rsa key pair.
When you're prompted to "Enter a file in which to save the key," press Enter. This accepts the default file location.
Solution:
Try config the $NVM_DIR reference again.
For example nvm use v7.10.0, and have the error: Run npm config delete prefix
or nvm use --delete-prefix v7.10.0 --silent
to unset it. You need overwrite nvm prefix,
npm config set prefix $NVM_DIR/versions/node/v7.10.0
const selected = [ | |
{ price: 20 }, | |
{ price: 45 }, | |
{ price: 67 }, | |
{ price: 1305 } | |
]; | |
const reducers = { | |
rubles: function(state, item) { | |
const newPrice = state.rubles + item.price; |
/* Replace all text nodes which has parent div element to wrapped by p tag. | |
Example | |
Before | |
<body> | |
<p>Boom</p> | |
text | |
<div>Bam</div> | |
</body> | |
After |
const images = ['1.jpg', '2.jpg', '3.jpg']; | |
const total = images.length; | |
const next = (current + 1) % total; | |
const prev = (current + (total - 1)) % total; |
Пропустить теорию и перейти прямо к задачам
Ссылка на учебник: http://learn.javascript.ru
Сразу расскажу про несколько особенностей яваскрипта, о которых может быть не написано (или мало написано) в учебниках, но которые стоит понимать: