Skip to content

Instantly share code, notes, and snippets.

View vmitchell85's full-sized avatar

Vince Mitchell vmitchell85

View GitHub Profile
@vmitchell85
vmitchell85 / php.json
Created March 3, 2022 16:04
Vince's PHP Snippets for VsCode
{
// Place your snippets for php here. Each snippet is defined under a snippet name and has a prefix, body and
// description. The prefix is what is used to trigger the snippet and the body will be expanded and inserted. Possible variables are:
// $1, $2 for tab stops, $0 for the final cursor position, and ${1:label}, ${2:another} for placeholders. Placeholders with the
// same ids are connected.
// Example:
// "Print to console": {
// "prefix": "log",
// "body": [
// "console.log('$1');",
@vmitchell85
vmitchell85 / ComboBox.vue
Created January 21, 2022 00:54
First pass at a ComboBox using TailwindCSS
<template>
<div>
<label v-if="label" :for="name" class="block text-sm font-medium text-gray-700">
{{ label }}
</label>
<div class="relative mt-1">
<input v-show="is_editing" ref="input" v-model="query" :name="name" class="block w-full px-4 py-2 border border-gray-300 rounded-md shadow-sm focus:ring-indigo-500 focus:border-indigo-500 sm:text-sm" @keydown="inputKeyDown">
<div v-show="!is_editing" @click="startEditing" class="block w-full px-4 py-2 border border-gray-300 rounded-md shadow-sm focus:ring-indigo-500 focus:border-indigo-500 sm:text-sm">
{{ selectedOption ? selectedOption.text : blankText }}
</div>
<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;
<?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 January 8, 2021 19:43
Some dd style shortcuts for Ray
{
"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 December 3, 2020 14:39
Responsive line between elements with resizing
<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 / .bashrc
Created January 6, 2017 13:40
Full .bashrc
hs(){
cd "/c/Users/vlm/Homestead"
vagrant up
vagrant ssh
}
hsp(){
cd "/c/Users/vlm/Homestead"
vagrant provision
}
@vmitchell85
vmitchell85 / clubs-trump.md
Last active April 27, 2020 00:46
How to play Clubs Trump

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 March 17, 2020 13:46
Chrome PIP Bookmarklet
javascript:(function () { document.querySelector('video').requestPictureInPicture() })()
@vmitchell85
vmitchell85 / nukecomposer.sh
Created January 9, 2020 04:18
A little function to delete all your vendor folders where a composer.lock file exists
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