Skip to content

Instantly share code, notes, and snippets.

View thisislawatts's full-sized avatar

Luke Watts thisislawatts

View GitHub Profile
@thisislawatts
thisislawatts / gist:87eb1ab9207a8ec30729
Last active August 29, 2015 14:17
Shopify - Bulk Redirect Import
var directs = [{
old: "/i-am-an-old-url",
new: "/i-am-your-new-url"
}];
var counter = 0;
var $addURLRedirect = jQuery('a[bind-event-click*="addUrlRedirectModal"]');
var currentRedirect;
addRedirect = function() {
@thisislawatts
thisislawatts / excludes.rsync
Created February 25, 2015 15:17
Deploy Lite™
.DS_Store
.git/
.gitignore
deploy/
*.sublime-*
plesk-stat/
picture_library/
node_modules/
wp-includes/
wp-admin/
I am line: 0
I am line: 1
I am line: 2
I am line: 3
I am line: 4
I am line: 5
I am line: 6
I am line: 7
I am line: 8
I am line: 9
@thisislawatts
thisislawatts / reorder-posts-within-categories.php
Last active August 29, 2015 14:15
Adds support for a WP_Query with the ReOrder Posts within Categories plugin https://wordpress.org/support/topic/support-for-wp_query-object?replies=1
<?php
/*
Plugin Name: ReOrder Post Within Categories
Plugin URI: http://www.deefuse.fr/wordpress/nouveau-plugin-reorder-post-within-categories
Description: Arrange Post and Custom Post Type through drag & drop interface of selected category (or custom taxonomies).
Version: 1.1.6-patched
Author: Aurélien Chappard
Author URI: http://www.deefuse.fr/
License: GPLv2
Copyright: Aurélien Chappard
@thisislawatts
thisislawatts / README.md
Last active August 29, 2015 14:15 — forked from onyxfish/README.md

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
@thisislawatts
thisislawatts / ffumbnail.sh
Created January 27, 2015 12:33
Takes the first frame out of a video for your previewing pleasure
# Requires ffmpeg
function ffumbnail() {
file_name=$(basename "${1}")
file_name_no_ext="${file_name%.*}"
ffmpeg -i $file_name -vframes 1 $file_name_no_ext.jpg;
}
@thisislawatts
thisislawatts / update.php
Last active May 25, 2021 02:54
Force database upgrade
<?php
class acf_update {
/*
* __construct
*
* A good place to add actions / filters
*
* @type functionac
@thisislawatts
thisislawatts / bashimonsta
Created January 7, 2015 10:41
tifftojpeg
# Converts all tiffs to jpg
#
# Requires imagemagick:
# brew install libtiff
# brew install imagemagick --with-libtiff (or brew reinstall)
#
function tifftojpeg() {
for i in *.tif;
do convert $i "${i%.*}.jpg";
done;
<!DOCTYPE html>
<html>
<head>
<script src="http://code.jquery.com/jquery-1.11.1.min.js"></script>
<meta charset="utf-8">
<title>JS Bin</title>
<style id="jsbin-css">
body {
@thisislawatts
thisislawatts / .profile
Created October 24, 2014 11:44
Convert your gif to an mp4
function giftomp4() {
file_path=$(pwd)
file_name=$(basename "${1}")
file_ext="${file_name##*.}"
file_name="${file_name%.*}"
frame_rate=3
if [ "$2" ]
then