Function | Shortcut |
---|---|
Previous Tab | ⌘ + Left Arrow |
Next Tab | ⌘ + Right Arrow |
Go to Tab | ⌘ + Number |
Go to Window | ⌘ + Option + Number |
Go to Split Pane by Direction | ⌘ + Option + Arrow |
Go to Split Pane by Order of Use | ⌘ + ] , ⌘ + [ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
include_once './includes/bootstrap.inc'; | |
drupal_bootstrap(DRUPAL_BOOTSTRAP_FULL); | |
header('Content-Type: text/plain'); | |
function _get_module_count() { | |
$modules = system_list('module_enabled'); | |
foreach ($modules as $module) { | |
if (strpos($module->filename, 'sites/all/modules/contrib') === 0) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ^ matches the beginning of the string. | |
// \w matches a "word" character (A-Z, a-z, 0-9, and _ only). | |
// The "+" sign means "one or more." | |
// \. matches a single dot. | |
// And the final $ matches the end of the string. | |
$safeFilename = '/^\w+\.\w+$/'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Implements hook_node_insert | |
*/ | |
function mymodulename_node_insert($node) { | |
// Get Node Author. | |
$author = $node->author; | |
// Use Drupal Mail | |
send_mail($to=$author); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
watchdog('module_name', 'Your Object: !object', array('!object' => '<pre>' . check_plain(print_r($object, TRUE)) . '</pre>'), WATCHDOG_ERROR); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#! /bin/bash | |
MYSQL="mysql -h <hostname> -u <username> -<password> -D <DATABASENAME>" | |
$MYSQL -BNe "show tables" | awk '{print "set foreign_key_checks=0; drop table `" $1 "`;"}' | $MYSQL | |
unset MYSQL |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
watchdog('custom_debug', 'Debug Global User Object for @user_name, user object: !user', array('@' => $user->name, '!node' => '<pre>' . check_plain(print_r($user, TRUE)) . '</pre>'), WATCHDOG_ERROR); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- SSH with password | |
- Add alias on bashrc | |
sudo apt-get install sshpass | |
#Then prepend your ssh/scp command with | |
sshpass -p '<password>' <ssh/scp command> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#Screen | |
#Run a task and detach | |
screen -S <Name Your Screen> -d -m <yourcommand> | |
#List screens | |
screen -ls | |
#Attach to a screen | |
screen -r <initials of screen id> |