Skip to content

Instantly share code, notes, and snippets.

View phegman's full-sized avatar
🙃
‏‏‎

Pete Hegman phegman

🙃
‏‏‎
View GitHub Profile
@phegman
phegman / router.js
Created January 29, 2019 05:56
Custom loading component for all lazy loaded Vue Router routes
import Vue from 'vue'
import Router from 'vue-router'
import Home from './views/Home.vue'
import Loading from './components/Loading.vue'
Vue.use(Router)
const withAsyncAndLoading = routes =>
routes.map(route => {
const component = route.component
@phegman
phegman / index.html
Last active March 11, 2023 11:37
Prevent non-numeric values in number input with JavaScript
<input
type="number"
id="number-input"
step="any"
pattern="[0-9\.\-]*" />
@phegman
phegman / AppServiceProvider.php
Created November 28, 2017 03:16
Laravel - body class based on view name
<?php
namespace App\Providers;
use Illuminate\Support\Facades\View;
use Illuminate\Support\ServiceProvider;
class AppServiceProvider extends ServiceProvider
{
/**