Vim Commands You Should Know About
As a developer you gotta love Vim! It is easily available on almost any server you login to. Most of the times, it will already be installed. You can customize it to your needs, but you should be comfortable with its basic functionalities as you don’t want to tweak it on every server. I thus like to customize it a little bit, but try to stick close to the default. But the best thing about Vim is that after some time learning it, it is so much faster and easier to edit text than any other editor.
Database Backup in the Cloud using AWS
So, we all regularly create backups of important data, right? Right. Well, at least I hope you do. For your personal data as well as any company data you are dealing with. It is fairly easy and straightforward to create e.g. a MySQL backup on a server, zip it up and always keep the last 10 days as copies. However, what happens in case your whole server’s disks have an unrecoverable crash?
How to write clean code?
This is a quick review of some important parts of the book “Clean Code: A Handbook of Agile Software Craftsmanship” by Robert C. Martin.
Advantages of clean code Better use of your time: Code is read a lot, you forget things, so clean code helps you quickly grasp what the code did. Easier onboarding: Getting co-workers up to speed is much easier if the code base is clean. Easier debugging: Others can help you out, since the code is understandable, even non-programmers like a project manager might be able to spot things.
What the heck is ~~ in JavaScript?
A note on bit-wise operations Today I read some JavaScript source code and stumbled on a line like var delta = ~~time; and I was unsure what that purpose of using ~~ was.
So I started to research and digging a bit deeper. It turns out that the binary not operator (~) when applied twice on a floating number (e.g. 4.12) returns an integer (~~4.12 = 4).
Why not simply use Math.
mod_rewrite operations you should know about
Rewriting URLs using mod_rewrite Every so often as a web developer, you might have to write a redirect of some URLs to some other ones to an .htaccess file. If you remember these tips here, you will probably have most of the stuff you need:
Redirect a specific URL to another URL Redirect 301 "/old-page.html" "/new-page.html" 301 here means it is a permanent redirect. Over time Google and other search engines will then replace the old URL with the new one in their index.