Skip to content

Instantly share code, notes, and snippets.

@tnorthcutt
tnorthcutt / drip.html
Created April 4, 2017 16:07
better drip mobile responsive template
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<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;}
@tnorthcutt
tnorthcutt / membermouse.php
Last active December 27, 2017 15:38
Protect plans older than sign up date minus one week.
<?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
@tnorthcutt
tnorthcutt / membermouse.php
Last active December 27, 2017 15:38
Don't show meal plans older than (sign up date + 1 week)
<?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
Given this collection:
Illuminate\Support\Collection {#1108
all: [
"verb" => [
"have",
"have-not",
],
"type" => [
"1",
@tnorthcutt
tnorthcutt / tls-test.php
Created February 13, 2018 15:32
Testing local TLS version
<?php
function stripe_test()
{
\Stripe\Stripe::setApiKey("sk_test_BQokikJOvBiI2HlWgH4olfQ2");
\Stripe\Stripe::$apiBase = "https://api-tls12.stripe.com";
try {
\Stripe\Charge::all();
echo "TLS 1.2 supported, no action required.";
} catch (\Stripe\Error\ApiConnection $e) {
@tnorthcutt
tnorthcutt / jigsaw-npm-run-watch-error.txt
Created August 15, 2018 15:07
Error message shown when running `npm run watch` in a new tightenco/jigsaw project
⭠ 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"
// Starting with
{
"2018-08-18":28,
"2018-08-17":33
}
// Desired end result

Setting up a Jigsaw project to use Tailwind

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

webpack.mix.js

let mix = require('laravel-mix');
let tailwind = require('tailwindcss');
let build = require('./tasks/build.js');
@import "docs";
@import "automation";
@import "bootstrap-overrides";
@tailwind preflight;
@tailwind components;
@tailwind utilities;
html {
font-size: 16px;
}
body {
font-size: 16px;
font-weight: inherit;
}