Skip to content

Instantly share code, notes, and snippets.

@geoffyuen
geoffyuen / wpml.sh
Created September 14, 2017 16:21
Script combines your Timber/Templates/*twig files into an index.php for WPML string translation scanning. Put this script in your templates folder and run it.
#!/bin/bash
echo "<?php">index.php ; cat *.twig >> index.php
echo "Finished!"
echo "Scan your theme: WPML, Theme and plugins localization, Scan selected themes for strings"
// Vanilla version of FitVids
// Still licencened under WTFPL
//
// Not as robust and fault tolerant as the jQuery version.
// It's BYOCSS.
// And also, I don't support this at all whatsoever.
;(function(window, document, undefined) {
'use strict';
@aarongustafson
aarongustafson / watchResize.js
Last active September 16, 2019 14:37
Efficient callback management for window.onresize
(function( window ){
window.watchResize = function( callback ){
var resizing;
callback.size = 0;
function done()
{
var curr_size = window.innerWidth;
clearTimeout( resizing );
resizing = null;
// only run on a true resize
@malarkey
malarkey / Contract Killer 3.md
Last active May 8, 2024 16:02
The latest version of my ‘killer contract’ for web designers and developers

When times get tough and people get nasty, you’ll need more than a killer smile. You’ll need a killer contract.

Used by 1000s of designers and developers Clarify what’s expected on both sides Helps build great relationships between you and your clients Plain and simple, no legal jargon Customisable to suit your business Used on countless web projects since 2008

…………………………