Skip to content

Instantly share code, notes, and snippets.

View Chapoton's full-sized avatar

Lee Chapoton Chapoton

View GitHub Profile
@Chapoton
Chapoton / post-receive.sample
Created September 25, 2019 03:11
Server-side hook for running scripts associated with auto deployments
#!/bin/sh
#
# Server-side hook for running scripts associated with auto deployments.
#
# Reference:
# http://nicolasgallagher.com/simple-git-deployment-strategy-for-static-sites/
# https://git-scm.com/book/en/v2/Customizing-Git-Git-Hooks
#
# To enable this hook, rename this file to "post-receive".
@Chapoton
Chapoton / gulpfile.js
Created May 29, 2019 14:31
Updated gulpfile for Smashing Magazine article
// Updated gulpfile for the following article: https://www.smashingmagazine.com/2018/07/pattern-library-first-css/
'use strict';
const gulp = require('gulp');
const fractal = require('./fractal.js');
const logger = fractal.cli.console;
const sass = require('gulp-sass');
const sassGlob = require('gulp-sass-glob');
const plumber = require('gulp-plumber');
@Chapoton
Chapoton / Remove_blank_lines.txt
Created December 17, 2017 18:03
To remove all blank lines in document, find all instances using this regex and replace with nothing.
^(?:[\t ]*(?:\r?\n|\r))+
@Chapoton
Chapoton / html_email_btn.html
Last active September 23, 2022 17:23
HTML email button. I use this in MailChimp emails because their default email buttons are only clickable on the text, not the entire button.
<!-- Paste this into the code block of a HTML email. -->
<table align="center" border="0" cellpadding="0" cellspacing="0" width="600" style="border-collapse: collapse;mso-table-lspace: 0pt;mso-table-rspace: 0pt;table-layout: fixed;margin 0px auto;width:100%;">
<tbody>
<tr>
<td align="center">
<style type="text/css">
.btn a {
display: inline-block;
background-color: #00add2;
@Chapoton
Chapoton / preview_text_hack.html
Created December 4, 2017 18:46
HTML email preview text hack
<!-- Ref: https://litmus.com/blog/the-little-known-preview-text-hack-you-may-want-to-use-in-every-email -->
<p style="display:none;">Your beautiful preview text prose goes here.&nbsp;&zwnj;&nbsp;&zwnj;&nbsp;&zwnj;&nbsp;&zwnj;&nbsp;&zwnj;&nbsp;&zwnj;&nbsp;&zwnj;&nbsp;&zwnj;&nbsp;&zwnj;&nbsp;&zwnj;&nbsp;&zwnj;&nbsp;&zwnj;&nbsp;&zwnj;&nbsp;&zwnj;&nbsp;&zwnj;&nbsp;&zwnj;&nbsp;&zwnj;&nbsp;&zwnj;&nbsp;&zwnj;&nbsp;&zwnj;&nbsp;&zwnj;&nbsp;&zwnj;&nbsp;&zwnj;&nbsp;&zwnj;&nbsp;&zwnj;&nbsp;&zwnj;&nbsp;&zwnj;&nbsp;&zwnj;&nbsp;&zwnj;&nbsp;&zwnj;&nbsp;&zwnj;&nbsp;&zwnj;&nbsp;&zwnj;&nbsp;&zwnj;&nbsp;&zwnj;&nbsp;&zwnj;&nbsp;&zwnj;&nbsp;&zwnj;&nbsp;&zwnj;&nbsp;&zwnj;&nbsp;&zwnj;&nbsp;&zwnj;&nbsp;&zwnj;&nbsp;&zwnj;&nbsp;&zwnj;&nbsp;&zwnj;&nbsp;&zwnj;&nbsp;&zwnj;&nbsp;&zwnj;&nbsp;&zwnj;&nbsp;&zwnj;&nbsp;&zwnj;&nbsp;&zwnj;&nbsp;&zwnj;&nbsp;&zwnj;&nbsp;&zwnj;&nbsp;&zwnj;&nbsp;&zwnj;&nbsp;&zwnj;&nbsp;&zwnj;&nbsp;&zwnj;&nbsp;&zwnj;&nbsp;&zwnj;&nbsp;&zwnj;&nbsp;&zwnj;&nbsp;&zwnj;&nbsp;&zwnj;&nbsp;&zwnj;&nbsp;&zwnj;&nbsp;&zwnj;&nbsp;&