Skip to content

Instantly share code, notes, and snippets.

Jeffrey Way JeffreyWay

Block or report user

Report or block JeffreyWay

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@JeffreyWay
JeffreyWay / with-data-attributes.js
Last active Jun 29, 2019
Vue Tooltips: Three Ways
View with-data-attributes.js
import PopperTooltip from 'tooltip.js';
new Vue({
el: '#app',
mounted() {
document.querySelectorAll('[data-tooltip]').forEach(elem => {
new PopperTooltip(elem, {
placement: elem.dataset.tooltipPlacement || 'top',
title: elem.dataset.tooltip
@JeffreyWay
JeffreyWay / ex.blade.php
Created Nov 5, 2016
Blade Directive for SVG Icon.
View ex.blade.php
<!-- Before -->
<svg class="icon is-active" xmlns="http://www.w3.org/2000/svg" width="12" height="16" viewBox="0 0 12 16">
<path d="M5.05.31c.81 2.17.41 3.38-.52 4.31C3.55 5.67 1.98 6.45.9 7.98c-1.45 2.05-1.7 6.53 3.53 7.7-2.2-1.16-2.67-4.52-.3-6.61-.61 2.03.53 3.33 1.94 2.86 1.39-.47 2.3.53 2.27 1.67-.02.78-.31 1.44-1.13 1.81 3.42-.59 4.78-3.42 4.78-5.56 0-2.84-2.53-3.22-1.25-5.61-1.52.13-2.03 1.13-1.89 2.75.09 1.08-1.02 1.8-1.86 1.33-.67-.41-.66-1.19-.06-1.78C8.18 5.31 8.68 2.45 5.05.32L5.03.3l.02.01z"/>
</svg>
<!-- After -->
@icon ('flame', 'is-success')
@JeffreyWay
JeffreyWay / CommunityLinksQuery.php
Created Aug 3, 2016
Consider Query Objects source.
View CommunityLinksQuery.php
<?php
namespace App\Queries;
use App\CommunityLink;
class CommunityLinksQuery
{
/**
* Fetch all relevant community links.
View Collection-Iterator-Aggregate.php
<?php
class Collection implements IteratorAggregate
{
/**
* The collection contents.
*
* @var array
*/
protected $items;
@JeffreyWay
JeffreyWay / laravel-elixir-webpack.js
Last active Feb 9, 2019
Laravel Elixir Webpack Extension
View laravel-elixir-webpack.js
var gulp = require('gulp');
var gulpWebpack = require('webpack-stream');
var Elixir = require('laravel-elixir');
var $ = Elixir.Plugins;
var config = Elixir.config;
/*
|----------------------------------------------------------------
| Webpack Compilation
@JeffreyWay
JeffreyWay / routes.php
Last active Aug 18, 2019
This route will require authentication with a valid api_token, and then return the relevant user, as JSON. - https://laracasts.com/series/whats-new-in-laravel-5-2/episodes/5
View routes.php
<?php
Route::group([
'prefix' => 'api/v1',
'middleware' => ['api', 'auth:api']
], function () {
Route::get('/', function () {
return Auth::guard('api')->user();
});
View ex.stylus
.Alert
background red
color white
@JeffreyWay
JeffreyWay / .vimrc
Created Jan 28, 2016
Laracasts: Vim Mastery - Episode 3 .vimrc progress
View .vimrc
syntax enable
colorscheme desert
"-------------General Settings--------------"
set backspace=indent,eol,start "Make backspace behave like every other editor.
let mapleader = ',' "The default leader is \, but a comma is much better.
set number "Let's activate line numbers.
@JeffreyWay
JeffreyWay / PjaxMiddleware.php
Last active Aug 5, 2019
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 .bash_profile
alias gl="git log --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit"
You can’t perform that action at this time.