- Create an empty repo in BitBucket
git clone --bare git@github.com:user/repo.gitcd repo.gitgit push --mirror git@bitbucket.org:user/repo.git
This file contains hidden or 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
| #!/usr/bin/env sed -f | |
| # whitespace at end of lines | |
| s/\s\+$// | |
| # fix comma followed by non-space character | |
| # don't be picky, this is correct even for text! | |
| /function/!s/\(,\)\(\S\)/\1 \2/g | |
| # fix comments may not appear after statements |
This file contains hidden or 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
| 1/https://www.drupal.org/project/backstretch module provide set backgroud full page | |
| 2/hook_process_page custom logo any page, etc | |
| 3/https://www.drupal.org/project/views_merge_rows |
This file contains hidden or 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 | |
| /** | |
| * Implementation of hook_drush_command(). | |
| * | |
| * In this hook, you specify which commands your | |
| * drush module makes available, what it does and | |
| * description. | |
| * | |
| * Notice how this structure closely resembles how | |
| * you define menu hooks. |
This file contains hidden or 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
| brew install python | |
| pip install PyYAML jinja2 | |
| sudo pip install ansible | |
| # paramiko isn't needed, MacOS has new enough ssh | |
| # sudo is needed for the ansible install because it wants to put resources in /usr/share | |
| # an alternative to using sudo is to checkout ansible from | |
| https://github.com/ansible/ansible | |
| # then run in the root of the git checkout |
This file contains hidden or 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 | |
| //set_include_path(get_include_path() . PATH_SEPARATOR . __DIR__); // optional | |
| spl_autoload_register(function ($class) { | |
| $file = preg_replace('#\\\|_(?!.+\\\)#','/', $class) . '.php'; | |
| if (stream_resolve_include_path($file)) | |
| require $file; | |
| }); |
This file contains hidden or 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
| function parseArguments() | |
| { | |
| array_shift($argv); | |
| $out = array(); | |
| foreach($argv as $arg) | |
| { | |
| if(substr($arg, 0, 2) == '--') | |
| { | |
| $eqPos = strpos($arg, '='); | |
| if($eqPos === false) |
This file contains hidden or 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 | |
| abstract class Command { | |
| abstract public function unExecute (); | |
| abstract public function Execute (); | |
| } | |
| class concreteCommand extends Command { | |
| private $operator,$operand,$calculator; | |
| public function __construct ($calculator,$operator,$operand) { | |
| $this->operator = $operator; | |
| $this->operand = $operand; |
This file contains hidden or 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 | |
| /** | |
| * Simple code for executing commands on a remote Linux server via SSH in PHP | |
| * | |
| * @author Phil Kershaw (In collaboration with Philip Mott) | |
| * | |
| * Note: ssh2_connect requires libssh2-php which is a non-standard PHP lib. | |
| * Debian: apt-get install libssh2-php | |
| * Redhat: yum install libssh2-php ???? I've no idea for redhat, sorry. | |
| */ |