# Batch convert SVG to PNG. Useful for creating new sizes of twemoji.
# Uses On macOS install with 'brew install librsvg'
for file in svg/*.svg
filename="$(basename $file)"
name=$(echo $filename | cut -f 1 -d '.')
echo "Converting $file to $name.png"
rsvg-convert -h 36 -w 36 $file > 36x36/$name.png
View gist:fc8e1b7a95e97eca70e5
* I have a custom post type for my Portfolio, using Advanced Custom Fields for extra fields including a field for me to
* order the portfolio entires how I want. Standard single navigation using previous_post_link and next_post_link don't work as they
* return the order the posts were added. This fixes things:
// New query
$args = array(
View gist:f3aa71e103e59ef7105f
sudo update-rc.d varnish defaults 91 9
View gist:c9bf43b056debd3eb584
# This is my VCL file for Varnish 4.0.2 & Wordpress 4.0
# ASSUME The builtin VCL is called afterwards.
# Specify VCL new 4.0 format.
vcl 4.0;
# Imports
import std;
View gist:0b4ad458f2c74f4c0723
sudo find . -type f -print0 | sudo xargs -0 sed -i 's/:8080/:80/g'
View gist:93be8af56bb4cc062073
sudo update-rc.d varnish defaults 91 9
View gist:ded7ec7892e017b6d3c5
// Responsive Slideshow in Wordpress
$images = get_field('gallery');
if( $images ): ?>
<div class="cycle-slideshow"
View Set parent height of absolutely positioned child.js
// set figure heights based on child image + figcaption heights
$(window).on('resize', setFigureHeight);
function setFigureHeight() {
$('.story-image').each(function(index,value) {
imgHeight = $(this).outerHeight(true);
capHeight = $(this).next('figcaption').outerHeight(true);
figHeight = imgHeight + capHeight;
View Add Site to DNS.scpt
tell application "Finder"
set theItems to selection
set folderName to name of item 1 of theItems
do shell script "sudo dscl localhost -create /Local/Default/Hosts/" & folderName & ".dev IPAddress"
end tell