This tutorial uses the "Sample hapi.js REST API" project.
Take a look at: https://github.com/agendor/sample-hapi-rest-api/
##Topics
- Introduction
- Installing Node.js
- Installing MySQL
- Setting-up the project
This tutorial uses the "Sample hapi.js REST API" project.
Take a look at: https://github.com/agendor/sample-hapi-rest-api/
##Topics
<?php | |
# Cron job command for Laravel 4.2 | |
# Inspired by Laravel 5's new upcoming scheduler (https://laravel-news.com/2014/11/laravel-5-scheduler) | |
# | |
# Author: Soren Schwert (GitHub: sisou) | |
# | |
# Requirements: | |
# ============= | |
# PHP 5.4 |
#Laravel 5 Simple ACL manager
Protect your routes with user roles. Simply add a 'role_id' to the User model, install the roles table and seed if you need some example roles to get going.
If the user has a 'Root' role, then they can perform any actions.
Simply copy the files across into the appropriate directories, and register the middleware in App\Http\Kernel.php
<?php | |
/** | |
* Codes collected from http://en.wikipedia.org/wiki/List_of_HTTP_status_codes | |
**/ | |
$http_status_codes = array( | |
100 => 'Informational: Continue', | |
101 => 'Informational: Switching Protocols', | |
102 => 'Informational: Processing', | |
200 => 'Successful: OK', |
# This file lives in `app/.elasticbeanstalk/config.yml.erb` | |
branch-defaults: | |
master: | |
environment: <%= eb_environment %> | |
# environment: contigo-worker-env # Enable for worker | |
# Put global configs below! |
=LOWER(CONCATENATE(DEC2HEX(RANDBETWEEN(0;POWER(16;8));8);"-";DEC2HEX(RANDBETWEEN(0;POWER(16;4));4);"-";"4";DEC2HEX(RANDBETWEEN(0;POWER(16;3));3);"-";DEC2HEX(RANDBETWEEN(8;11));DEC2HEX(RANDBETWEEN(0;POWER(16;3));3);"-";DEC2HEX(RANDBETWEEN(0;POWER(16;8));8);DEC2HEX(RANDBETWEEN(0;POWER(16;4));4))) |
This page provides a full overview of PHP's SessionHandler
life-cycle - this was generated by a set of test-scripts, in order to provide an exact overview of when and
what you can expect will be called in your custom SessionHandler
implementation.
Each example is a separate script being run by a client with cookies enabled.
To the left, you can see the function being called in your script, and to the right, you can see the resulting calls being made to a custom session-handler registed using session_set_save_handler().
COMMANDS | |
MySQL PDO Notes | |
$result = mysql_query($queryStr) $pdoStatement = $pdo->query($queryStr) | |
mysql_fetch_array($result,$type = MYSQL_BOTH) $pdoStatement->fetch($type = PDO::FETCH_BOTH) | |
mysql_error() NO EXACT EQUIVALENT $pdo->errorInfo() returns an array, [0=>ErrorCode,1=>Driver specific error code,2=>driver specific error message] | |
mysql_insert_id() $pdo->lastInsertId() | |
mysql_free_cursor() NO EXACT EQUIVALENT $pdoStatement->closeCursor() is similar but on statement not PDO | |
mysql_select_db($dbName) NO EQUIVALENT PDO does not allow databases to be changed, you must create a new PDO connection, or if the info is the same you an use dot notation to query a different database | |
mysql_real_escape_string($stringToEscape) $pdo->quote($stringToEscape) PDO::quote will add the quotes for you!!!! | |
ssh-keygen -t rsa -b 4096 -m PEM -f jwtRS256.key | |
# Don't add passphrase | |
openssl rsa -in jwtRS256.key -pubout -outform PEM -out jwtRS256.key.pub | |
cat jwtRS256.key | |
cat jwtRS256.key.pub |
<?php | |
namespace App\Http\Middleware; | |
use Closure; | |
use Illuminate\Http\Request; | |
use Illuminate\Http\Response; | |
use Symfony\Component\DomCrawler\Crawler; | |
class PjaxMiddleware |