Skip to content

Instantly share code, notes, and snippets.

Travis Northcutt tnorthcutt

Block or report user

Report or block tnorthcutt

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
View app.less
@import "docs";
@import "automation";
@import "bootstrap-overrides";
@tailwind preflight;
@tailwind components;
@tailwind utilities;
View js-object-manipulation.js
// Starting with
// Desired end result

Setting up a Jigsaw project to use Tailwind

tailwind.js ./node_modules/.bin/tailwind init


let mix = require('laravel-mix');
let tailwind = require('tailwindcss');
let build = require('./tasks/build.js');
tnorthcutt / jigsaw-npm-run-watch-error.txt
Created Aug 15, 2018
Error message shown when running `npm run watch` in a new tightenco/jigsaw project
View jigsaw-npm-run-watch-error.txt
⭠ master ⮀ ~/sites/jigsaw ⮀
» npm run watch ◉ ◼◼◼◼◼◼◼◼◼◼
> @ watch /Users/travis/Sites/jigsaw
> npm run local -- --watch
> @ local /Users/travis/Sites/jigsaw
> cross-env NODE_ENV=development node_modules/webpack/bin/webpack.js --progress --hide-modules --env=local --config=node_modules/laravel-mix/setup/webpack.config.js "--watch"
tnorthcutt / tls-test.php
Created Feb 13, 2018
Testing local TLS version
View tls-test.php
function stripe_test()
\Stripe\Stripe::$apiBase = "";
try {
echo "TLS 1.2 supported, no action required.";
} catch (\Stripe\Error\ApiConnection $e) {
View transformCollection.txt
Given this collection:
Illuminate\Support\Collection {#1108
all: [
"verb" => [
"type" => [
tnorthcutt / membermouse.php
Last active Dec 27, 2017
Don't show meal plans older than (sign up date + 1 week)
View membermouse.php
* Don't show meal plans older than (sign up date + 1 week)
* @since 1.0.0
* @author Travis Northcutt
function gfmp_show_allowed_meal_plans( $query ) {
// First, make sure we're on the front end and on the right archive view
tnorthcutt / membermouse.php
Last active Dec 27, 2017
Protect plans older than sign up date minus one week.
View membermouse.php
* Protect plans older than sign up date minus one week.
* This is for a site with new content published weekly;
* adjust as necessary for other publishing schedules.
* @since 1.0.0
* @author Travis Northcutt

UsedByTeams Model Trait For Laravel Spark

Automatically limit your models to the current team

So you're using spark, and you have teams enabled. You start creating models and want to have them be team specific. Instead of writing, Model::where('team_id', auth()->user()->currentTeam->id)->get(); use this trait to add that behind the scenes so that every time you call on your model, it's assumed that you mean for the current team.

This assumes that the model has a team_id, while it adds a scope of where team_id = currentTeam->id.

Note: Implicit Route Model Binding in 5.2, auth session doesn't exist at the point of this trait causing issue. fixed in 5.3

tnorthcutt / drip.html
Created Apr 4, 2017
better drip mobile responsive template
View drip.html
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "">
<html xmlns="">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0"/>
<style type="text/css">
/* Based on The MailChimp Reset INLINE: Yes. */
/* Client-specific Styles */
#outlook a {padding:0;} /* Force Outlook to provide a "view in browser" menu link. */
body{width:100% !important; margin:0; padding:0;}
You can’t perform that action at this time.