Page 10 of 11
After merging a pull request Github shows the option to remove the branch that was merged, but that only removes the branch from the remote Github repo.
If you display all your branches in local( git branch -a ) you’ll still see that the removed branch still appear.
To verify which branches are ok to remove you use the command:
1
| git pull --prune --dry-run
|
This will show you which branches on remote can be removed, we will use this list to clean our local repo. The –dry-run flag makes the command just display what will happen if we prune the remote repo.
Read More...
After editing your config file (probably ~/.tmux.conf) you don’t need to kill your tmux server and reload it, you can just go to tmux command mode and source your configfile:
1
| <C-b>:source-file ~/.tmux
|
When you open use vim on tmux you might lose your colours that is because the term that tmux uses is screen and you might be using xterm, you can fix that by:
Adding to your alias(on your .bashrc .bash_profile or where every your alias are located):
Read More...
I prefer to keep all my gems separated by project so I use rbenv-gemset you might want to do that too.
If you want to use a specific ruby version on a project do the following:
1
2
| cd project
rbenv install 2.4.1 # you can pick any version `rbenv install -l`
|
then use that specif ruby-version on the project
This will create a .ruby-version file that contains the version you are using, to verify that you can check the version running:
Read More...
If you have to reference multiple directories on your ctags do the following.
Generate CTags for all of your projects, from your project’s root
this will generate a file tags, add it to the git ignore
1
| echo "tags" >> ~/.gitignore_global
|
Now configure your vimrc to search current dir, then add other the tag files from your other projects
set tags=./tags,$HOME/project1/tags,$DEVPATH/project2/tags
Now you can go to the root of all of your projects open vim and Ctrl-] Ctrl-t all you like
Read More...
If you use iTerm you’ll probably need to change the file:
/Applications/Docker/Docker Quickstart Terminal.app/Contents/Resources/Scripts/iterm.scpt
Following the code in this gist
Install bash_completion from mac ports or using homebrew
Here I’ll show the autocomplete files you need to add to your autocomplete.d directory (check where ports or brew installed your autocomplete.d)
- autocomplete for docker:
- go to this URL: `https://raw.githubusercontent.com/docker/cli/master/contrib/completion/bash/docker`
- autocomplete for docker-composer:
- `https://raw.githubusercontent.com/docker/compose/$(docker-compose version --short)/contrib/completion/bash/docker-compose`
- autocomplete for docker-machine:
Problem installing docker in VM:
https://github.com/moby/moby/issues/15990
Read More...
Sometimes rules or styles become hindrances instead of being helpful, we have to keep track of so many things that we forget what was the purpose of what we started with.
Interesting reads:
Just use double-quoted strings
https://en.wikipedia.org/wiki/The_Pragmatic_Programmer
Read More...
Why ALE and not Syntastic ? just personal preference, ALE seems to take advantage of the async in Vim 8, just that.
What would we need:
- Install - ESLint
- Have a Vim plugin manager, I prefer/use Plug
- Install - ALE
Step 1.Installing ESLint is very straightforward using NPM in general just(this will install it in your current directory if you want it global use the -g flag, you should have initialized your npm in the current project npm init prior to run this command):
Read More...
Two-factor authentication is important but sometimes is hard if you are travelling around and don’t have a fixed phone number in every country. Here are some security features that you might find helpful:
- http://lifehacker.com/what-do-i-do-if-i-use-two-factor-authentication-and-los-1668727532
Read More...
When you see colours displayed on vim, they are defined by highlight rules, and they are applied to groups (in the example below the group is Normal, you can view all of them running: :so $VIMRUNTIME/syntax/hitest.vim) for example:
" Set the background colour to white
:highlight Normal ctermbg=White
" Set the background colour to yellow
:highlight Normal ctermbg=Yellow
" Set the background colour to none(back to normal)
:highlight Normal ctermbg=0
Where are colours defined? you can check the value of each colour for x-term256 here
Read More...
- Get the book
- Get a working copy of Scheme (The one I used is Racket Download & Install )
- If you use VIM you could use the setup shown in this post to complete the exercises.
- Maybe you’ll struggle with the first exercises on what are you required to do. So just remember to initialise the function:
1
2
3
4
| ; atom? as defined in the Guidelines for the reader
(define atom?
(lambda (x)
(and (not (pair? x)) (not (null? x)))))
|
- Start with the first exercise:
When the instructions ask if it’s a list you can use the function list? (see the pattern?)
Read More...