nanodano's blog

Advertisement

Advertisement

Bash Shortcut Keys

Sometimes when working we don't always have a fully featured keyboard. Whether using a small portable bluetooth keyboard, old software, or you just want to be a command line ninja, these shortcuts are very important to know to increase productivity and to work through technical limitations on keyboards.

Useful Linux Bash Shell Aliases

Typing long commands over and over gets old. Use bash aliases to make your life easier and impress your peers. Add these to your .bashrc and/or .bash_profile. Personally I use only one and symlink them together. These are just some examples of how you can use alias. Anytime you find yourself repeating lengthy commands think about creating an alias. Optionally, if it's a long command you are only going to be using for a short period, be sure to use history tools like ! and !? to quickly repeat previous commands.

PHP Show All Errors

To show all errors in PHP use these two functions:

error_reporting(E_ALL);
ini_set('display_errors', '1');

If you are using a framework or CMS, a good place to put it is your settings or bootstrap file. For Drupal I recommend the settings.php file.

JavaScript source code highlighter - Prettify

Google Code Prettify is great for turning <code> tags into nicely formatted HTML. I personally appreciate how it displays the line numbers, but they don't get included when you copy+paste. There are many themes available but my favorite is the google code. It treats word wrapping well with line numbers, shows each line number, and is styled nicely. The Drupal module allows you to integrate it easily to Drupal.

Drupal Pretiffy module: http://drupal.org/project/prettify

Advertisement

Advertisement