Skip to content

Instantly share code, notes, and snippets.

View johnhearfield's full-sized avatar

John Hearfield johnhearfield

  • United Kingdom
View GitHub Profile
/*
* This script fetches all color styles from a Figma team/document.
*
* Dependencies:
*
* - node-fetch
*
* Due to a limitation in the Figma /styles endpoint, we need to use a
* document for actually using the colors in a color grid 🙄That's why
* we're both fetching from /styles and /files below.
@uglyeoin
uglyeoin / background image for HTML email.html
Last active November 8, 2021 17:06
Background Image with Outlook support in HTML Email
<!-- Full width background image with content. Image is full width but 200px high -->
<div mc:repeatable="options" mc:variant="Main Background Image with Text overlay">
<table cellpadding="0" cellspacing="0" border="0" width="100%" style="width:100%;min-height:328px;height:328px;" background="https://gallery.mailchimp.com/fa85a578f928f05fa5750d667/images/cc24d737-fea1-4a47-87fb-517f5fecb2f4.jpg">
<tr>
<td style="font-size: 16px;line-height: 20px; font-family: Georgia, Arial, sans-serif;">
<!--[if gte mso 9]>
<v:rect style="width:600px;height:328px;" strokecolor="none" stroke="false">
<v:fill type="frame" color="#303131" src="https://gallery.mailchimp.com/fa85a578f928f05fa5750d667/images/cc24d737-fea1-4a47-87fb-517f5fecb2f4.jpg" /></v:fill>
</v:rect>
<v:shape id="bgImage" style="position:absolute;width:600px;height:328px;">
@emsifa
emsifa / README.md
Last active April 1, 2020 11:15
Laravel 5.1 Validation Outside Laravel

Laravel 5.1 Validation Outside Laravel

First you need to install illuminate/validation by typing this composer require illuminate/validation:5.1.*.

Then, you can use laravel validation like this:

$validatorFactory = new ValidatorFactory;
@cfxd
cfxd / gulp_module_installation
Last active January 29, 2019 20:04
Gulpfile and module installation for UnCSS + Gulp + Sage 8.3.0
$ npm install gulp-uncss gulp-exec --save-dev
@smutek
smutek / inspect.php
Created June 15, 2015 15:17
lists handles for all enqueued styles and scripts
/*
* Lists out the handles for all enqueued styles and scripts.
* Credit: http://wordpress.stackexchange.com/questions/54064/how-do-i-get-the-handle-for-all-enqueued-scripts
*/
function wp_inspect_scripts() {
global $wp_scripts;
echo '<pre><h1>Script Handles</h1><ul>';
foreach( $wp_scripts->queue as $handle ) :
echo '<li>' . $handle . '</li>';
@plentz
plentz / nginx.conf
Last active November 16, 2024 14:10
Best nginx configuration for improved security(and performance)
# to generate your dhparam.pem file, run in the terminal
openssl dhparam -out /etc/nginx/ssl/dhparam.pem 2048
@logicaroma
logicaroma / jQuery Plugin Boilerplate
Created October 13, 2011 09:41
jQuery lightweight plugin boilerplate
/*!
* jQuery lightweight plugin boilerplate
* Original author: @ajpiano
* Further changes, comments: @addyosmani
* Licensed under the MIT license
* @link http://coding.smashingmagazine.com/2011/10/11/essential-jquery-plugin-patterns/
*/
// the semi-colon before the function invocation is a safety
// net against concatenated scripts and/or other plugins