File Application/Autoload/Loader.php
:
<?php
namespace Application\Autoload;
class Loader
{
const UNABLE_TO_LOAD = 'Unable to load';
node_modules | |
dist/ | |
yarn.lock | |
wwwroot |
write-host "`n ## NODEJS INSTALLER ## `n" | |
### CONFIGURATION | |
# nodejs | |
$version = "4.4.7-x64" | |
$url = "https://nodejs.org/dist/latest-v4.x/node-v$version.msi" | |
# git | |
$git_version = "2.9.2" |
<?php | |
$username = "your_username"; | |
$password = "your_pass"; | |
$url = 'your_stp_server_url'; | |
// Make our connection | |
$connection = ssh2_connect($url); | |
// Authenticate |
{ | |
"rows" : "!", | |
"id" : "{index}", | |
"active" : "{bool}", | |
"fname" : "{firstName}", | |
"lname" : "{lastName}", | |
"category" : "[13,16,19,21]", | |
"tel" : "{phone}", | |
"address" : "{addressObject}", | |
"cc" : "{ccObject}", |
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset="utf-8"/> | |
<title>Array#forEach</title> | |
<script src="https://cdnjs.cloudflare.com/ajax/libs/benchmark/1.0.0/benchmark.min.js"></script> | |
<script src="./suite.js"></script> | |
</head> | |
<body> | |
<h1>Open the console to view the results</h1> |
<?php | |
$c = new Client('https://poste.io/admin/api/v1/', '[email protected]', 'admin'); | |
$c->delete('domains/t.com'); | |
$c->post('domains', ['name' => 't.com']); | |
$c->post('boxes', ['email' => '[email protected]', 'passwordPlaintext' => 't', 'name' => 't']); | |
$c->patch('boxes/[email protected]', ['name' => 'a', 'disabled' => true, 'passwordPlaintext' => 'a']); |
// recieve message | |
// event object contains: | |
// - data: message sent | |
// - origin (host from which the message was sent, e.g. http://blah.example.com) | |
// - source (reference to a Window object from which message was sent) | |
function postMessageHandler( event ) { | |
console.log("We've got a message!"); | |
console.log("* Message:", event.data); | |
console.log("* Origin:", event.origin); | |
console.log("* Source:", event.source); |
<?php | |
// more: http://baylorrae.com/php-pubsub/ | |
class PubSub | |
{ | |
private static $events = array(); // all subscriptions | |
// Don't allow PubSub to be initialized outside this class |
<?php | |
function cache_image($image_url){ | |
//replace with your cache directory | |
$image_path = 'path/to/cache/dir/'; | |
//get the name of the file | |
$exploded_image_url = explode("/",$image_url); | |
$image_filename = end($exploded_image_url); | |
$exploded_image_filename = explode(".",$image_filename); | |
$extension = end($exploded_image_filename); | |
//make sure its an image |