Skip to content

Instantly share code, notes, and snippets.

Avatar

Matt Bailey matt-bailey

View GitHub Profile
@matt-bailey
matt-bailey / async-and-conditional-css-loading.html
Last active Mar 17, 2021
A simple script (based on one by Google) for loading CSS files asynchronously and conditionally based on body tag classes
View async-and-conditional-css-loading.html
<html>
<head>
<!-- Inlined critical styles -->
<style>.blue{color:blue;}</style>
<!-- CSS loader -->
<script>
/* ==========================================================================
Load CSS asynchronously and conditionally after initial painting
@matt-bailey
matt-bailey / github-pages-custom-domain-gandi-dns-records.md
Last active Mar 17, 2021
How to set up DNS records on gandi.net to use a custom domain on Github Pages
View github-pages-custom-domain-gandi-dns-records.md

How to set up DNS records on gandi.net to use a custom domain on Github Pages

You would think it would be easy to find this information, but none of the Github or Gandi documentation is clear so I have recorded the required steps here.

Create the following A records:

@ 1800 IN A 185.199.108.153
@ 1800 IN A 185.199.109.153
@ 1800 IN A 185.199.110.153
@matt-bailey
matt-bailey / customer_account.xml
Last active Nov 10, 2020
Disable My Account sidebar links in Magento 2
View customer_account.xml
<?xml version="1.0"?>
<!--
/**
* Copyright © 2016 Magento. All rights reserved.
* See COPYING.txt for license details.
*/
-->
<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
<body>
<!-- Remove unwanted account navigation links -->
@matt-bailey
matt-bailey / gist:3911666
Created Oct 18, 2012
Sass vs Less - Placeholders
View gist:3911666
// Source: http://ianstormtaylor.com/oocss-plus-sass-is-the-best-way-to-css/
// Sass
%separator
border-top: 1px solid black
hr
@extend %separator
.separator
@extend %separator
View gist:a332fa1e9afb908aedd52c089e81cb3d
Adyen Test Card Numbers
These cards are only valid on our TEST system and they will never involve any actual transaction or transfer of funds. The TEST card numbers will not work on the Adyen LIVE Platform.
For all cards use the following expiration and CVV2/CVC2/or CID for Amex.
For all cards:
Expiration Dates CVV2 / CVC3 CID (American Express)
08/2018 OR 10/2020 737 7373
@matt-bailey
matt-bailey / gist:5815536
Created Jun 19, 2013
The 'watch' task in Gruntfile.js (as scaffolded by yo webapp)
View gist:5815536
grunt.initConfig({
yeoman: yeomanConfig,
watch: {
coffee: {
files: ['<%= yeoman.app %>/scripts/{,*/}*.coffee'],
tasks: ['coffee:dist']
},
coffeeTest: {
files: ['test/spec/{,*/}*.coffee'],
tasks: ['coffee:test']
View gist:2497771
/* H5BP image replacement: http://nicolasgallagher.com/another-css-image-replacement-technique/ */
.ir {
font: 0/0 a;
text-shadow: none;
color: transparent;
}
@matt-bailey
matt-bailey / .stencil
Last active Jun 21, 2019
Example BigCommerce .stencil file
View .stencil
{
"normalStoreUrl": "[store-url]",
"port": 3000,
"clientId": "[client-id]",
"accessToken": "[access-token]",
"customLayouts": {
"brand": {},
"category": {},
"page": {
"style-guide.html":"/style-guide/"
@matt-bailey
matt-bailey / formstack-embed-using-postscribe.html
Created Sep 13, 2017
Embed a Formstack form asynchronously, using Postscribe
View formstack-embed-using-postscribe.html
// https://github.com/krux/postscribe
<!-- Main form wrapper, required for styling the form -->
<div class="webform">
<!-- Empty div (must have a unique ID), into which the form will be loaded -->
<div id="formstack-bridal-appointment"></div>
<script type="text/javascript">// <![CDATA[
// Only run the code below when jQuery says the document is ready
(function($) {
// Process the form using postscribe:
// 1. Must reference the unique ID of the div above
@matt-bailey
matt-bailey / m2-setup-install.sh
Last active Oct 7, 2018
Example Magento 2 setup:install command
View m2-setup-install.sh
php bin/magento setup:install --base-url=http://mysite.dev --db-host=localhost --db-name=mysite --db-user=root --admin-firstname=Magento --admin-lastname=User --admin-email=my@email.com --admin-user=admin --admin-password=password123 --language=en_GB --currency=GBP --timezone=Europe/London --use-rewrites=1 --backend-frontname=admin