Skip to content

Instantly share code, notes, and snippets.

Avatar

Vince Mitchell vmitchell85

View GitHub Profile
View ImportWp.php
<?php
namespace App\Console\Commands;
use Corcel\Model\Page as WpPage;
use Illuminate\Console\Command;
use Illuminate\Support\Facades\Auth;
use Illuminate\Support\Str;
use Statamic\Entries\Entry;
use Statamic\Facades\Collection;
@vmitchell85
vmitchell85 / php.json
Created Jan 8, 2021
Some dd style shortcuts for Ray
View php.json
{
"ray": {
"prefix": "rr",
"body": [
"ray($1)$2;"
],
"description": "Dump data to Spatie's Ray application"
},
"ray model": {
"prefix": "rrm",
@vmitchell85
vmitchell85 / index.html
Last active Dec 3, 2020
Responsive line between elements with resizing
View index.html
<div class="max-w-5xl mx-auto p-32 flex items-center justify-center">
<div id="main" class="mx-auto text-gray-800 w-64 h-64 bg-gray-300 text-2xl rounded-full flex items-center justify-center">Main Circle</div>
</div>
<div class="max-w-5xl mx-auto p-32 flex items-center justify-center relative">
<div id="red" class="absolute left-0 mt-4 w-24 h-24 rounded-full bg-red-300 flex items-center justify-center">Red</div>
<div id="green" class="absolute left-0 -mt-16 ml-96 w-24 h-24 rounded-full bg-green-300 flex items-center justify-center">Green</div>
<div id="orange" class="absolute left-0 mt-64 ml-48 w-24 h-24 rounded-full bg-yellow-600 flex items-center justify-center">Orange</div>
<div id="blue" class="absolute right-0 mt-4 w-24 h-24 rounded-full bg-blue-300 flex items-center justify-center">Blue</div>
@vmitchell85
vmitchell85 / clubs-trump.md
Last active Apr 27, 2020
How to play Clubs Trump
View clubs-trump.md

Clubs Trump

The Deck

The standard 52-card pack is used.

Rank of Suits

The club suit is always trump.

RANK OF CARDS

A (high), K, Q, J, 10, 9, 8, 7, 6, 5, 4, 3, 2.

@vmitchell85
vmitchell85 / pip.js
Created Mar 17, 2020
Chrome PIP Bookmarklet
View pip.js
javascript:(function () { document.querySelector('video').requestPictureInPicture() })()
View imagePreview.html
<html>
<head>
<script src="https://cdn.jsdelivr.net/gh/alpinejs/alpine@v2.x.x/dist/alpine.js" defer></script>
<link href="https://unpkg.com/tailwindcss@^1.0/dist/tailwind.min.css" rel="stylesheet">
<script>
function imageData() {
return {
previewUrl: '',
updatePreview() {
var reader, files = document.getElementById('thumbnail').files;
@vmitchell85
vmitchell85 / nukecomposer.sh
Created Jan 9, 2020
A little function to delete all your vendor folders where a composer.lock file exists
View nukecomposer.sh
nukecomposer() {
find . -name "vendor" -type d -maxdepth 2 -print0 |
while IFS= read -r -d '' vendorDir; do
lockfile=${vendorDir/vendor/"composer.lock"};
if test -f $lockfile; then
echo 'Deleting vendor directory: ' $vendorDir
rm -rf $vendorDir
fi
done
View nukenodemodules.sh
alias nukenodemodules="find . -name "node_modules" -exec rm -rf '{}' + "
@vmitchell85
vmitchell85 / StreamRoutes.php
Created Jun 23, 2018
Larastream 2.0 sample routes
View StreamRoutes.php
<?php
Route::get('/streams', 'StreamController@index'); // List of all streams
Route::post('/streams', 'StreamController@store'); // Creates a new stream - If a stream starts now, it could do the logic for that as well
Route::get('/streams/{stream}', 'StreamController@show'); // Shows an existing stream
Route::get('/streams/{stream}/edit', 'StreamController@edit'); // Shows the page to edit a stream
Route::patch('/streams/{stream}', 'StreamController@update'); // Route where edits are saved for a stream
@vmitchell85
vmitchell85 / deploy.sh
Last active May 15, 2018 — forked from sahibalejandro/deploy.sh
Deploy script for Laravel projects.
View deploy.sh
# Shutdown the laravel app
php artisan down
# Pull down changes
git pull
# Install new composer packages
composer install --no-dev --prefer-dist
# Cache boost configuration and routes