View Archive.org.md

Downloading old websites from Archive.org

Using Wayback Machine Downloader.

Usage is very simple:

# Install
sudo gem install wayback_machine_downloader
View Laravel-Container.md

Laravel's Dependency Injection Container in Depth

Laravel has a powerful Inversion of Control (IoC) / Dependency Injection (DI) Container. Unfortunately the official documentation doesn't cover all of the available functionality, so I decided to experiment with it and document it for myself. The following is based on Laravel 5.4.26 - other versions may vary.

Introduction to Dependency Injection

I won't attempt to explain the principles behind DI / IoC here - if you're not familiar with them you might want to read What is Dependency Injection? by Fabien Potencier (creator of the Symfony framework).

Accessing the Container

View prolog.md

Getting started with SWI-Prolog

Today (May 2017) I decided to learn a bit about Prolog. Here is how to start using it...

Install it on Ubuntu:

sudo apt-get install swi-prolog
View Docker.md

Docker Reference

This week (May 2017) I have been learning about Docker... Here is what I've learned so far.

The shortcut commands in brackets refer to functions/aliases I've set up in my dotfiles.

Installing Docker on Ubuntu

sudo apt-get install docker docker-compose
View _Font Awesome mixins.md

Font Awesome mixins

Sass mixins to add Font Awesome icons to CSS classes/elements, instead of using the fa-* classes in HTML.

View BladeServiceProvider.php
<?php
namespace App\Providers;
use Blade;
use Illuminate\Support\ServiceProvider;
class BladeServiceProvider extends ServiceProvider
{
/**
* Bootstrap the application services.
View cf7-campaignmonitor.php
<?php
/*
Plugin Name: Contact Form 7 - Campaign Monitor Addon
Plugin URI: http://www.bettigole.us/published-work/wordpress-contributions/campaign-monitor-addon-for-contact-form-7/
Description: Add the power of CampaignMonitor to Contact Form 7
Author: Joshua Bettigole
Author URI: http://www.bettigole.us
Version: 1.06 (Modified)
https://wordpress.org/support/topic/contact-form-7-campaign-monitor-addon-broken
View EncryptCookies.php
<?php namespace App\Http\Middleware;
use Illuminate\Contracts\Encryption\DecryptException;
use Illuminate\Cookie\Middleware\EncryptCookies as BaseMiddleware;
use Symfony\Component\HttpFoundation\Cookie;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\Response;
// The first two functions are identical to the originals in the parent class
// other than the sections marked "MOD". The third function is a new helper
View outdated-privileges.sql
-- Useful for finding users who had permission to access databases that have since been deleted
SELECT mysql.db.*
FROM mysql.db
LEFT JOIN information_schema.SCHEMATA
ON information_schema.SCHEMATA.SCHEMA_NAME LIKE mysql.db.Db
WHERE information_schema.SCHEMATA.SCHEMA_NAME IS NULL;
View no-privileges.sql
-- Note: This only checks global permissions and database permissions, not table permissions.
-- Tested on MySQL 5.6 - other versions may have a different set of global permissions.
SELECT mysql.user.*
FROM mysql.user
LEFT JOIN mysql.db
ON mysql.db.Host = user.Host
AND mysql.db.User = user.User
WHERE mysql.db.Db IS NULL
AND mysql.user.Select_priv = FALSE