- C-a == Ctrl-a
- M-a == Alt-a
:q close
:w write/saves
:wa[!] write/save all windows [force]
:wq write/save and close
| // To turn on JS Aggregation | |
| drush vset preprocess_js 1 --yes | |
| // To clear all Cache | |
| drush cc all | |
| // To disable JS Aggregation | |
| drush vset preprocess_js 0 --yes | |
| // To clear cache of JS and CSS only |
| /** | |
| * Return a formated string from a date Object mimicking PHP's date() functionality | |
| * | |
| * format string "Y-m-d H:i:s" or similar PHP-style date format string | |
| * date mixed Date Object, Datestring, or milliseconds | |
| * | |
| */ | |
| function dateFormat(format,date){ | |
| if(!date || date === "") |
| dependencies[] = ctools | |
| ; Views Handlers | |
| files[] = views/mymodule_handler_handlername.inc |
#Views Handlers - A Shakedown
This is a cheat sheet for information about extending the capabilities of Views by extending and building your own handlers. It will cover the basic handlers and attempt to cover some of the hooks that you might use when doing so. Including examples, basic documentation and some caveats where necessary. THIS IS NOT A COMPLETE LIST!! Consider the code of the handler your looking to extend to be the ultimate source of documentation. This is merely a convenience and a starting point.
_Ignore the tags in the included snippets, they are a convenience for formatting.
views_handler_field_numeric).views_handler_field_my_numeric_field.inc.| <?php | |
| /** | |
| * Convert a multi-dimensional array into a single-dimensional array. | |
| * @author Sean Cannon, LitmusBox.com | [email protected] | |
| * @param array $array The multi-dimensional array. | |
| * @return array | |
| */ | |
| function array_flatten($array) { | |
| if (!is_array($array)) { |
If you're like me you have a dir like ~/Workspace/Github where all your git repos live. I often find myself making a change in a repo, getting side tracked and ending up in another repo, or off doing something else all together. After a while I end up with several repos with modifications. This script helps me pick up where I left off by checking the status of all my repos, instead of having to check each one individually.
Usage:
git-status [directory]This will run git status on each repo under the directory specified. If called with no directory provided it will default to the current directory.
| <?php echo $this->url->link('product/category', 'path=96'); ?> | |
| // http://example.com/category-three/ | |
| <?php echo $this->url->link('product/category', 'path=63_78'); ?> | |
| // http://example.com/category-one/category-two/ | |
| <?php echo $this->url->link('product/category', 'path=63_78_96'); ?> |
| (function ($, Drupal) { | |
| Drupal.behaviors.MODULE = { | |
| attach: function(context) { | |
| // Delicious code goes here. | |
| } | |
| } |
| /** | |
| * Get a random floating point number between `min` and `max`. | |
| * | |
| * @param {number} min - min number | |
| * @param {number} max - max number | |
| * @return {number} a random floating point number | |
| */ | |
| function getRandomFloat(min, max) { | |
| return Math.random() * (max - min) + min; | |
| } |