Basics tabstop – amount to indent when using <Tab> shiftwidth – amount to indent when using ‘>’ or ‘<‘ expandtab – always insert spaces at the amount of tabstop set tabstop=4 set shiftwidth=4 set expandtab How to change tab size based on filetype setting it inline make sure there are no spaces between the…
All posts in July 2018

How to detect if a user is online
Many browsers have implemented events “online” and “offline”; in addition to this, browsers also expose the navigator.onLine property that will return “online” or “offline” How many browsers is many? caniuse says every major browser (Chrome, Firefox, Safair, IE11…) except Opera mini has this functionality (as of July 4th 2018). How can I check the online status? > navigator.onLine…
How to protect your files from deletion
I wrote about this before, but its important enough to write twice How to revoke write permissions to a directory How to revoke your own user permissions $ chmod u-w dirname How to delete all permissions from anyone on your system $ chmod a-w dirname removing write access on a file does not stop it from…
why vim?
vim is vi(improved) vim is a powerful way that allows you to transform your thoughts into action in as little keystrokes as possible. In fact, the subtitle of the book Practical Vim is this: “Edit Text at the Speed of Thought” With that said, vim has a steep learning curve that often does not feel…
Intro to OSX File Management Commands
Filenames can have spaces! So when you deal with them either surround the filename with apostrophes like this: “my file name.txt” or escape the spaces my\ file\ name.txt. Otherwise, don’t create new file names with spaces or escape characters to keep your sanity. Wildcards * greedy wildcard ? single character wildcard [] single character list of wildcards {} pattern list of…
Intro to your OS X Filesystem and Permissions
How to find home note: as a user of the system you will be given a user directory under the Users directory $ echo $HOME How to go to the home directory choices: $ cd $HOME, $ cd ~, $ cd, and $ cd then drag your home directory from your Finder window How to go to the…
Setting up version controlled bash_profile
Sometimes your roommate spills water on your computer for a second time. Why would I upload .bash_profile to github? If you keep your config files uploaded to github, you can avoid having to recreate your dotfiles like .bash_profile every time you need to set up a new computer. For most people, setting up a new computer…