Never. Really not ever if you need to ask this question. If you are building a new shopping experience, you likely aren’t really asking this question. If you simply want to sell stuff online, do not go build a front end, payment system, taxation system, inventory management, temporary sales management, email collection, analytics, reviews, tags,…
vim settings: tabs, spaces, indents
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…
![How to detect if a user is online](https://thepatricktran.com/wp-content/uploads/2018/07/screen-shot-2018-07-08-at-12-43-05-pm-1.png)
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…
Setting up .vim directory
vim settings are important for every vim user and you shouldn’t have to use a vanilla vim setup just because you ssh into a VM or set up a new computer. Since most vim settings have zero personal data, the most convenient thing to do is to upload your vim directory+settings onto the internet for the world to bask…
Mac Unix Command Basics for Beginners
These are useful unix commands that are entered through a Terminal shell prompt. These commands are actually names of Unix programs that usually sit in a folder called /bin where am i? pwd How to check the current directory $ pwd learn more about anything – man How to bring up the manual page for a command:…