Each of these commands will run an ad hoc http static server in your current (or specified) directory, available at http://localhost:8000. Use this power wisely.
$ python -m SimpleHTTPServer 8000| <?php | |
| class ReconnectingPDO | |
| { | |
| protected $dsn, $username, $password, $pdo, $driver_options; | |
| public function __construct($dsn, $username = "", $password = "", $driver_options = array()) | |
| { | |
| $this->dsn = $dsn; | |
| $this->username = $username; | |
| $this->password = $password; |
| <?php | |
| require 'vendor/autoload.php'; | |
| $resolver = new Illuminate\Database\ConnectionResolver; | |
| $resolver->setDefaultConnection('default'); | |
| $factory = new Illuminate\Database\Connectors\ConnectionFactory; | |
| $connection = $factory->make(array( | |
| 'host' => 'localhost', | |
| 'database' => 'database', |
| #!/bin/bash | |
| # for use with cron, eg: | |
| # 0 3 * * * postgres /var/db/db_backup.sh foo_db | |
| if [[ -z "$1" ]]; then | |
| echo "Usage: $0 <db_name> [pg_dump args]" | |
| exit 1 | |
| fi |
| <?php | |
| // we're loading the Database TestCase here | |
| require 'PHPUnit' . DIRECTORY_SEPARATOR . 'Extensions' . | |
| DIRECTORY_SEPARATOR . 'Database' . DIRECTORY_SEPARATOR . | |
| 'TestCase.php'; | |
| class FixtureTestCase extends PHPUnit_Extensions_Database_TestCase { | |
| public $fixtures = array( | |
| 'posts', |
| <?php | |
| /** | |
| * Compare two arrays and return a list of items only in array1 (deletions) and only in array2 (insertions) | |
| * | |
| * @param array $array1 The 'original' array, for comparison. Items that exist here only are considered to be deleted (deletions). | |
| * @param array $array2 The 'new' array. Items that exist here only are considered to be new items (insertions). | |
| * @param array $keysToCompare A list of array key names that should be used for comparison of arrays (ignore all other keys) | |
| * @return array[] array with keys 'insertions' and 'deletions' | |
| */ | |
| public static function arrayDifference(array $array1, array $array2, array $keysToCompare = null) { |
| _docker_procs() | |
| { | |
| local procs | |
| procs="$(docker ps -q)" | |
| COMPREPLY=( $(compgen -W "${procs}" -- ${cur}) ) | |
| } | |
| _docker_imgs() | |
| { | |
| local repos tags imgs |
| {{#linkTo 'contact' contact tagName="tr"}} | |
| <td>{{name}}</td> | |
| <td><button {{action destroy contact bubbles=false}}>Destroy!</button></td> | |
| <td>{{#linkTo 'somewhere else' foo}}something{{/linkTo}}</td> | |
| {{/linkTo}} |
Each of these commands will run an ad hoc http static server in your current (or specified) directory, available at http://localhost:8000. Use this power wisely.
$ python -m SimpleHTTPServer 8000We have changed our check_url implementation from curl to wget for three reasons
curl -sSfL --retry 3 URL
to the current one:
| #! /bin/bash | |
| # Description: show dependency tree | |
| # Author: damphat | |
| if [ $# != 1 ]; then | |
| echo 'Usage: apt-rdepends-tree <package>' | |
| echo 'Required packages: apt-rdepends' | |
| exit 1 | |
| fi |