Skip to content

Instantly share code, notes, and snippets.

Jeffrey Way JeffreyWay

View GitHub Profile
@JeffreyWay
JeffreyWay / recaptcha.blade.php
Last active Aug 5, 2020
Recaptcha Example using Laravel, Blade Components, and Alpine
View recaptcha.blade.php
<div
x-data="recaptcha()"
x-init="init"
@recaptcha.window="execute"
></div>
@push('scripts')
<script src="https://www.google.com/recaptcha/api.js?render=explicit"></script>
<script>
View demo.html
<x-layout>
<x-section>
<x-tabs active="First">
<x-tab name="First">
First content goes here.
</x-tab>
<x-tab name="Second">
Second content goes here.
</x-tab>
@JeffreyWay
JeffreyWay / laravel.js
Last active Aug 1, 2020
Want to send a DELETE request when outside of a form? This will handle the form-creation bits for you dynamically, similar to the Rails implementation. (Requires jQuery, but doesn't have to.) To use, import script, and create a link with the `data-method="DELETE"` attribute.
View laravel.js
/*
<a href="posts/2" data-method="delete"> <---- We want to send an HTTP DELETE request
- Or, request confirmation in the process -
<a href="posts/2" data-method="delete" data-confirm="Are you sure?">
*/
(function() {
@JeffreyWay
JeffreyWay / .vimrc
Last active Jul 31, 2020
My .vimrc file
View .vimrc
set nocompatible " Disable vi-compatibility
set t_Co=256
colorscheme xoria256
set guifont=menlo\ for\ powerline:h16
set guioptions-=T " Removes top toolbar
set guioptions-=r " Removes right hand scroll bar
set go-=L " Removes left hand scroll bar
set linespace=15
View demo.php
<!DOCTYPE html>
<html>
<head>
<title>CSS Quirks</title>
<link
href="https://unpkg.com/tailwindcss@^1.0/dist/tailwind.min.css"
rel="stylesheet"
/>
<style>
.clamp {
View .bash_profile
# laravel new-app
alias laravel="git clone -o laravel -b develop https://github.com/laravel/laravel.git"
alias artisan="php artisan"
alias migrate="php artisan migrate"
alias serve="php artisan serve"
alias dump="php artisan dump"
alias t="phpunit"
# Generators Package
@JeffreyWay
JeffreyWay / demo.html
Created Jul 21, 2020
Alpine.js Essentials: Handling Custom Events
View demo.html
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Alpine Examples</title>
<script src="https://cdn.jsdelivr.net/gh/alpinejs/alpine@v2.x.x/dist/alpine.min.js"
defer
></script>
@JeffreyWay
JeffreyWay / web.php
Created Jul 17, 2020
Array Filtering + Casting Demo
View web.php
<?php
use Illuminate\Support\Str;
use Illuminate\Support\Facades\Route;
Route::get('/', function () {
return view('welcome');
});
Route::get('/names', function () {
@JeffreyWay
JeffreyWay / PjaxMiddleware.php
Last active Jul 16, 2020
Laravel middleware for working with pjax.
View PjaxMiddleware.php
<?php
namespace App\Http\Middleware;
use Closure;
use Illuminate\Http\Request;
use Illuminate\Http\Response;
use Symfony\Component\DomCrawler\Crawler;
class PjaxMiddleware
View gist:5105516
data:text/html, <style type="text/css">#e{position:absolute;top:0;right:0;bottom:0;left:0;font-size:16px}</style><div id="e"></div><script src="http://d1n0x3qji82z53.cloudfront.net/src-min-noconflict/ace.js" type="text/javascript" charset="utf-8"></script><script>var e=ace.edit("e");e.setTheme("ace/theme/monokai");e.getSession().setMode("ace/mode/php");</script>
You can’t perform that action at this time.