An introduction to curl using GitHub's API.
Makes a basic GET request to the specifed URI
curl https://api.github.com/users/caspyin
| <?php | |
| $start_date_month = new DateTime("first day of this month"); | |
| $end_date_month = new DateTime("last day of this month"); | |
| echo $start_date_month->format('Y-m-d')."\n"; | |
| echo $end_date_month->format('Y-m-d'); |
An introduction to curl using GitHub's API.
Makes a basic GET request to the specifed URI
curl https://api.github.com/users/caspyin
| <?php | |
| require __DIR__ . '/../vendor/autoload.php'; | |
| use Symfony\Component\Console\Application; | |
| use Artis\App\Commands\CreateProject; | |
| use Artis\App\Commands\CreateController; | |
| use Artis\App\Commands\CreateModel; | |
| use Artis\App\Commands\CreateView; |
| RewriteEngine On | |
| # if the file with the specified name in the browser doesn’t exist, | |
| # or the directory in the browser doesn’t exist then procede to the rewrite rule below | |
| RewriteCond %{REQUEST_FILENAME} !-f | |
| RewriteCond %{REQUEST_FILENAME} !-d | |
| # this is the last rule | |
| RewriteRule ^(.*)$ index.php/$1 [L] |
| <?php | |
| namespace Helper; | |
| class Api extends \Codeception\Module | |
| { | |
| public $credentials = array( | |
| 'username' => 'remo', | |
| 'password' => '12345678' | |
| ); | |
| <?php | |
| require 'vendor/autoload.php'; | |
| $html = "<!DOCTYPE html><html><head><title>.</title></head><body><h1>Welcome to the jungle</h1><script>var x=10;</script><script>alert('this is an alert');</script></body></html>"; | |
| $config = HTMLPurifier_Config::createDefault(); | |
| $config->set('HTML.ForbiddenElements', array('script','applet')); | |
| $purifier = new HTMLPurifier($config); | |
| $clean= $purifier->purify($html); | |
| echo $clean; |
| <?php | |
| require 'adodb/adodb.inc.php'; | |
| require 'adodb/adodb-active-record.inc.php'; | |
| define("DB_DRIVER", "mysqli"); | |
| define("DB_HOST", "localhost"); | |
| define("DB_USERNAME", "root"); | |
| define("DB_PASSWORD", ""); | |
| define("DB_NAME", "test"); | |
| define("DB_CHARSET", "UTF-8"); |
| <!DOCTYPE html> | |
| <html lang="en"> | |
| <head> | |
| <meta charset="UTF-8"> | |
| <title>.</title> | |
| </head> | |
| <body> | |
| <?php | |
| // namespace Remo\Upload; |
| <!DOCTYPE html> | |
| <html lang="en"> | |
| <head> | |
| <meta charset="UTF-8"> | |
| <title>.</title> | |
| </head> | |
| <body> | |
| <?php | |
| if (isset($_POST['submit'])) { | |
| define("UPLOAD_FOLDER", "uploads"); |
| <?php | |
| include('adodb/adodb.inc.php'); | |
| include('adodb/adodb-active-record.inc.php'); | |
| $driver = 'mysqli'; | |
| $server = 'localhost'; | |
| $user = 'root'; | |
| $password = 'secret'; | |
| $database = 'mydb'; |