Skip to content

Instantly share code, notes, and snippets.

@frankdejonge
frankdejonge / until-breakpoint-tailwind-plugin.js
Created July 16, 2022 18:15
Tailwind plugin to add screen variants up until a breakpoint
const plugin = require('tailwindcss/plugin');
let untilBreakpoint = plugin(({ addVariant, config }) => {
let screens = config('theme.screens');
for (let screen in screens) {
let def = screens[screen];
if (typeof def === 'string') {
addVariant(`-${screen}`, `@media (max-width: calc(${def} - 1px))`);
@sagalbot
sagalbot / yarn_install.sh
Last active May 31, 2020 16:03
Quick Yarn Installs on Laravel Envoyer, share `node_modules` between deployments.
cd {{ release }}
# link node_modules from last deployment
ln -s {{ project }}/node_modules
# update linked folder with latest deps
yarn install
# remove the symlink
rm node_modules
@nrollr
nrollr / ApacheHTTPSConfig.md
Last active March 11, 2024 13:32
Enable SSL in Apache for 'localhost' (OSX, El Capitan)

Enable SSL in Apache (OSX)

The following will guide you through the process of enabling SSL on a Apache webserver

  • The instructions have been verified with OSX El Capitan (10.11.2) running Apache 2.4.16
  • The instructions assume you already have a basic Apache configuration enabled on OSX, if this is not the case feel free to consult Gist: "Enable Apache HTTP server (OSX)"

Apache SSL Configuration

Create a directory within /etc/apache2/ using Terminal.app: sudo mkdir /etc/apache2/ssl
Next, generate two host keys:

@jrmadsen67
jrmadsen67 / gist:bd0f9ad0ef1ed6bb594e
Last active February 15, 2022 08:41
Laravel Quick Tip: Handling CsrfToken Expiration gracefully
Quick tip for handling CSRF Token Expiration - common issue is when you use csrf protection is that if
a form sits there for a while (like a login form, but any the same) the csrf token in the form will
expire & throw a strange error.
Handling it is simple, and is a good lesson for dealing with other types of errors in a custom manner.
In Middleware you will see a file VerifyCsrfToken.php and be tempted to handle things there. DON'T!
Instead, look at your app/Exceptions/Handler.php, at the render($request, Exception $e) function.
All of your exceptions go through here, unless you have excluded them in the $dontReport array at the