Skip to content

Instantly share code, notes, and snippets.

View alistairtweedie's full-sized avatar

Alistair Tweedie alistairtweedie

  • United Kingdom
View GitHub Profile
@luetkemj
luetkemj / wp-query-ref.php
Last active April 25, 2024 09:37
WP: Query $args
// This gist is now maintained on github at https://github.com/luetkemj/wp-query-ref
<?php
/**
* WordPress Query Comprehensive Reference
* Compiled by luetkemj - luetkemj.github.io
*
* CODEX: http://codex.wordpress.org/Class_Reference/WP_Query#Parameters
* Source: https://core.trac.wordpress.org/browser/tags/4.9.4/src/wp-includes/query.php
*/
@antonjb
antonjb / layers_export.jsx
Created December 10, 2012 06:47
Illustrator Layer to SVG Exporter
/*
* Layers to SVG - layers_export.jsx
* @version 0.1
* Improved PageItem selection, which fixed centering
*
* @author Anton Ball
* Exports all layers to SVG Files
* I didn't want every layer in the SVG file so it first creates a new document
* and one by one copies each layer to that new document while exporting it out
* as an SVG.
@jslegers
jslegers / gist:6562976
Created September 14, 2013 15:34
Hiding mobile specific content on IE6-8
/* Add the desktop-hidden class to any HTML tag that contains mobile specific content */
.desktop-hidden {
*display:none !important; /* IE6-7 */
}
@media \0 screen {
.desktop-hidden {
display:none !important; /* IE8 only */
@chrisjhoughton
chrisjhoughton / fb-open-graph.liquid
Last active September 9, 2023 07:52
Facebook Open Graph meta tags for Shopify. Add this as a snippet called "fb-open-graph.liquid" in your theme, and then add {% include 'fb-open-graph' %} to your theme.liquid file.
{% if template contains 'product' %}
<meta property="og:type" content="product">
<meta property="og:title" content="{{ product.title | strip_html | escape }}">
<meta property="og:category" content="{{ product.type }}" />
{% for image in product.images limit:3 %}
<meta property="og:image" content="http:{{ image.src | product_img_url: 'master' }}">
<meta property="og:image:secure_url" content="https:{{ image.src | product_img_url: 'master' }}">
{% endfor %}
<meta property="og:price:amount" content="{{ product.price | money_without_currency | stip_html | escape | remove: ',' }}">
<meta property="og:price:currency" content="{{ shop.currency }}">
@onyxfish
onyxfish / README.md
Last active January 2, 2023 14:37
Google Spreadsheets script to generate slugs from a range of cells

This script for Google Spreadsheets allows you to generate slugs for your data such as might be used for creating unique urls.

Use it like this!

# A B C
1 a b slug
2 foo baz bing =slugify(A2:B4)
3 bar BAZ
4 FOO baz-bing
@bastianallgeier
bastianallgeier / nginx
Last active November 30, 2023 10:14
nginx setup
# block content
location ~ ^/content/(.*).(txt|md|mdown)$ {
rewrite ^/content/(.*).(txt|md|mdown)$ /error redirect;
}
# block all files in the site folder from being accessed directly
location ~ ^/site/(.*)$ {
rewrite ^/site/(.*)$ /error redirect;
}
@frontendbeast
frontendbeast / grid.scss
Last active August 29, 2015 14:08
Sass grid column generator
// ========================================================================== \\
// About
// ========================================================================== \\
// The Sass below will generate a class for each of the columns required to
// fill your grid. For example, a four column grid requires columns with
// widths of 1/4, 1/2 and 3/4.
// |----| | | |
// |1/4 |
<script type="text/javascript">
(function () {
"use strict";
// once cached, the css file is stored on the client forever unless
// the URL below is changed. Any change will invalidate the cache
var css_href = './index_files/web-fonts.css';
// a simple event handler wrapper
function on(el, ev, callback) {
if (el.addEventListener) {
el.addEventListener(ev, callback, false);
@johanbrook
johanbrook / github.css
Created May 12, 2015 17:40
HighlightJS GitHub style
/*
github.com style (c) Vasily Polovnyov <vast@whiteants.net>
*/
.hljs {
display: block;
overflow-x: auto;
padding: 0.5em;
color: #333;
background: #f8f8f8;
@plasticbrain
plasticbrain / gulpfile.js
Last active February 13, 2024 14:31
gulp.js task to deploy code to remote servers
/*******************************************************************************
* Description:
*
* Gulp file to push changes to remote servers (eg: staging/production)
*
* Usage:
*
* gulp deploy --target
*
* Examples: