Skip to content

Instantly share code, notes, and snippets.

View cliftonscott's full-sized avatar

Clifton Hatfield cliftonscott

  • CliftonScott LLC
View GitHub Profile
@cliftonscott
cliftonscott / focusChangeNotify.ts
Created February 18, 2022 00:17 — forked from msandrini/focusChangeNotify.ts
Vue 3 directive with Typescript - focusChangeNotify
import { DirectiveBinding, ObjectDirective } from 'vue'
type FocusableElement = HTMLInputElement | HTMLTextAreaElement
type NotificationCallback = (isNowFocused: boolean) => void
type GenericEventHandler = () => void
interface ExtendedDirective extends ObjectDirective {
handleFocus: GenericEventHandler
handleBlur: GenericEventHandler
}
@cliftonscott
cliftonscott / valet.conf
Created June 28, 2021 22:46 — forked from poul-kg/valet.conf
CORS Rules for Laravel Valet Nginx
# To enable CORS you should add lines with CORS rules below to your valet.conf file
# Find the file /usr/local/etc/nginx/valet/valet.conf - this is Valet conf for Nginx
# of try to execute `locate valet.conf` and find the `valet.coinf` in `nginx` subdirectory
# after you edit your valet.conf do not forget to execute `valet restart`
server {
listen 80 default_server;
root /;
charset utf-8;
client_max_body_size 128M;
@cliftonscott
cliftonscott / PaymentRequest.js
Created May 12, 2021 04:28 — forked from lorisleiva/PaymentRequest.js
Renderless VueJS component for Payment Requests using Stripe Element
export default {
props: {
stripe: {
type: String,
required: true,
},
options: {
type: Object,
required: true,
}
@cliftonscott
cliftonscott / UserSeeder.php
Created April 10, 2021 20:04 — forked from brifiction/UserSeeder.php
Laravel Console - Progress Bar Example
<?php
use App\Account;
use App\User;
use Illuminate\Database\Seeder;
use Symfony\Component\Console\Helper\ProgressBar;
use Symfony\Component\Console\Output\ConsoleOutput;
class LocalUserSeeder extends Seeder
{
@cliftonscott
cliftonscott / UsersTableSeeder.php
Created April 10, 2021 19:47 — forked from jorgecrodrigues/UsersTableSeeder.php
Progress bar for seed, Laravel
<?php
use Illuminate\Database\Seeder;
use Symfony\Component\Console\Helper\ProgressBar;
use Symfony\Component\Console\Output\ConsoleOutput;
class UsersTableSeeder extends Seeder
{
/**
* Amount.
@cliftonscott
cliftonscott / image_resize.vue
Created July 21, 2020 21:00 — forked from mvind/image_resize.vue
Custom node for creating an resizable image in tiptap.
template>
<span id="outer" :style="outerStyle" @click="toggleActive">
<img id="img1" v-bind:src="node.attrs.src" style=" width: 100%;"/>
<span id="handle" :style="handleStyle" @mousedown.prevent="handleMouseDown($event)"></span>
</span>
</template>
<script>
export default {
@cliftonscott
cliftonscott / easing.js
Created July 1, 2020 00:02 — forked from gre/easing.js
Simple Easing Functions in Javascript - see https://github.com/gre/bezier-easing
/*
* Easing Functions - inspired from http://gizma.com/easing/
* only considering the t value for the range [0, 1] => [0, 1]
*/
EasingFunctions = {
// no easing, no acceleration
linear: t => t,
// accelerating from zero velocity
easeInQuad: t => t*t,
// decelerating to zero velocity
@cliftonscott
cliftonscott / awesm.md
Created October 5, 2016 16:59 — forked from matula/awesm.md
Awesome PHP stuff in one Gist