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 ($) { | |
| Drupal.behaviors.myModule = { | |
| attach: function (context) { | |
| // Code ... | |
| } | |
| } | |
| })(jQuery); |
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
| /** | |
| Code copyright Dustin Diaz and Ross Harmes, Pro JavaScript Design Patterns. | |
| **/ | |
| // Constructor. | |
| var Interface = function (name, methods) { | |
| if (arguments.length != 2) { | |
| throw new Error("Interface constructor called with " + arguments.length + "arguments, but expected exactly 2."); | |
| } | |
| this.name = name; |
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
| javascript:ASTEROIDS.watch('enemiesKilled', function(prop, old, newval) {return newval+4;});void(0); |
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. | |
| */ |
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
| 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 | |
| //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
| 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 | |
| /** | |
| * 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. |
OlderNewer