Skip to content

Instantly share code, notes, and snippets.

View carbontwelve's full-sized avatar
🎯
Focusing

Simon Dann carbontwelve

🎯
Focusing
View GitHub Profile

Keybase proof

I hereby claim:

  • I am carbontwelve on github.
  • I am carbontwelve (https://keybase.io/carbontwelve) on keybase.
  • I have a public key whose fingerprint is 9C54 2C8A C7F3 8B07 351A F190 FFF3 22CE BDDF 0006

To claim this, I am signing this object:

<?php
$locationTemplate = 'http://???/picam/index.php';
$ipTemplate = '192.168.20.???';
for ($i = 10; $i<255; $i++){
$ip = str_replace('???', $i, $ipTemplate);
$loc = str_replace('???', $ip, $locationTemplate);

Below test results from executing this benchmark script.

Running within an Azure App Service Plan (Standard 1 Large) PHP 5.4.45:

----------------------------------------------------------------------
|                        PHP Benchmark Script                        |
|                     2016-04-06 07:42:53 -07:00                     |
|              PHP Version: 5.4.45 // OS Version: WINNT              |
----------------------------------------------------------------------
@carbontwelve
carbontwelve / gulpfile.js
Last active February 18, 2016 10:46
Stolen from Lewis
var gulp = require('gulp'),
autoprefixer = require('gulp-autoprefixer'),
minifycss = require('gulp-minify-css'),
uglify = require('gulp-uglify'),
rename = require('gulp-rename'),
concat = require('gulp-concat'),
less = require('gulp-less'),
plumber = require('gulp-plumber'),
util = require('gulp-util'),
livereload = require('gulp-livereload'),
@carbontwelve
carbontwelve / azure_lb.txt
Created January 27, 2016 15:41
Azure Load Balancer details
info: Executing command network lb show
+ Looking up the load balancer "LAMPClusterLB"
data: Id : /subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourceGroups/CompanyLAMPCluster/providers/Microsoft.Network/loadBalancers/LAMPClusterLB
data: Name : LAMPClusterLB
data: Type : Microsoft.Network/loadBalancers
data: Location : northeurope
data: Provisioning State : Succeeded
data: Frontend IP configurations:
data: Name : LBFrontEndPool
data: Provisioning state : Succeeded
@carbontwelve
carbontwelve / BasicWebAuth.php
Created November 3, 2015 16:33
BasicAuth Middleware Laravel/Lumen
<?php namespace App\Http\Middleware;
use Closure;
use Illuminate\Http\Response;
class BasicWebAuth
{
/**
* Name of the realm
*
<?php
/*
Plugin Name: Skeleton Widget
Description: A widget example for the widget article at photogabble.co.uk
*/
class Carbontwelve_Skeleton_Widget extends WP_Widget {
/**
* Register widget with WordPress.
@carbontwelve
carbontwelve / curl_example.php
Created March 27, 2014 13:54
PHP Curl to check if url is alive
<?php
function check_alive($url, $timeout = 10, $successOn = array(200, 301)) {
$ch = curl_init($url);
// Set request options
curl_setopt_array($ch, array(
CURLOPT_FOLLOWLOCATION => false,
CURLOPT_NOBODY => true,
CURLOPT_TIMEOUT => $timeout,
@carbontwelve
carbontwelve / Snippets.php
Created February 25, 2014 15:42
Laravel CSRF Before filter on post
<?php
// CSRF Protection
$this->beforeFilter('csrf', array('on' => 'post'));
@carbontwelve
carbontwelve / usefull_commands.sh
Last active June 24, 2021 06:10
Running xdebug in the console, for debugging Laravel artisan commands. Useful as I keep forgetting this one...
# Running xdebug in the console, for debugging Laravel artisan commands. Useful as I keep forgetting this one...
php -dxdebug.remote_autostart artisan
#Running phpcs for 5.3:
phpcs -pv --standards= --runtime-set testVersion 5.3 --ignore=*/public/*,*.js,*.css,*/tests/*,*/views/training/* .