Magic words:
psql -U postgresMost \d commands support additional param of __schema__.name__ and accept wildcards like *.*
\q: Quit/Exit\c __database__: Connect to a database\d __table__: Show table definition including triggers
Magic words:
psql -U postgresMost \d commands support additional param of __schema__.name__ and accept wildcards like *.*
\q: Quit/Exit\c __database__: Connect to a database\d __table__: Show table definition including triggers| <?php | |
| class SecureSessionHandler extends SessionHandler { | |
| protected $key, $name, $cookie; | |
| public function __construct($key, $name = 'MY_SESSION', $cookie = []) | |
| { | |
| $this->key = $key; | |
| $this->name = $name; |
| ### USAGE | |
| Require the autoload in your bootstrap, and use the Application to start your app | |
| require __DIR__ . '/../Autoload.php'; | |
| $app = new Fastpress\Application; | |
| $app->get('/hello/{:name}', function($name) use ($app){ | |
| echo 'Hello ' $app->escape($name); // Hello world | |
| }); |
| <?php | |
| ### USAGE | |
| #Require the autoload in your bootstrap, and use the Application to start your app | |
| require __DIR__ . '/../Autoload.php'; | |
| $app = new Fastpress\Application; | |
| $app->get('/hello/{:name}', function($name) use ($app){ |
| #!/bin/bash | |
| set -e | |
| set -x | |
| if [ $1 == "master" ] | |
| then | |
| wget https://github.com/php/php-src/archive/master.zip -q -O master.zip | |
| rm -rf php-src-master | |
| unzip -q master.zip |
| Demo |
| """ An example of a Linux daemon written in Python. | |
| Based on http://www.jejik.com/articles/2007/02/a_simple_unix_linux_daemon_in_python/ | |
| The changes are: | |
| 1 - Uses file open context managers instead of calls to file(). | |
| 2 - Forces stdin to /dev/null. stdout and stderr go to log files. | |
| 3 - Uses print instead of sys.stdout.write prior to pointing stdout to the log file. | |
| 4 - Omits try/excepts if they only wrap one error message w/ another. |
| <?php | |
| function getJsonPage($url) | |
| { | |
| $ch = curl_init(); | |
| curl_setopt($ch, CURLOPT_URL, $url); | |
| curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); | |
| $result = curl_exec($ch); |
| <?php echo 1 + 1; ?> |