Skip to content

Instantly share code, notes, and snippets.


Kevin Ruscoe kevinruscoe

View GitHub Profile
View ArrayUserProvider.2.php
namespace App;
use App\Models\User;
use Exception;
use Illuminate\Contracts\Auth\Authenticatable;
use Illuminate\Contracts\Auth\UserProvider;
class ArrayUserProvider implements UserProvider
kevinruscoe / ResponseMacros.php
Last active Jun 14, 2020
A few handy response macros
View ResponseMacros.php
Request::macro('startsWith', function(string $needle) {
return collect(array_filter(
fn($key) => str_starts_with($key, $needle),

Raspberry Pi VPN Router

This is a quick-and-dirty guide to setting up a Raspberry Pi as a "router on a stick" to PrivateInternetAccess VPN.


Install Raspbian Jessie (2016-05-27-raspbian-jessie.img) to your Pi's sdcard.

Use the Raspberry Pi Configuration tool or sudo raspi-config to:

View sortWithPreference.php
function ($preference = [], $key = 'id') {
return $this->sort(
function ($a, $b) use ($preference, $key) {
$a = array_search(is_array($a) ? $a[$key] : $a->$key, $preference);
$b = array_search(is_array($b) ? $b[$key] : $b->$key, $preference);
if ($a === false && $b === false) {
kevinruscoe / Remove _notes directories
Created Jul 29, 2019 — forked from pcmccull/Remove _notes directories
Remove all _notes directories from a project that has been 'touched' by Dreamweaver
View Remove _notes directories
find . -name _notes -type d -exec rm -rf {} \;
View MethodLink.vue
View ConnectToCorrectDatabase.php
namespace App\Http\Middleware;
use Closure;
use Config;
class ConnectToCorrectDatabase
View thing.php
// Assuming the field name is 'url'.
// Don't forget to URL encode
$url = sprintf("", get_field('url'));
// Or use http_build_query
$url = sprintf('', http_build_query([
'app_id' => 'xxxxxx',
View gist:ec83313d5713bb0dd19a8828c6e0cf4e
| Web Routes
| Here is where you can register web routes for your application. These
| routes are loaded by the RouteServiceProvider within a group which
| contains the "web" middleware group. Now create something great!
View registration.php
You can’t perform that action at this time.