Skip to content

Instantly share code, notes, and snippets.

View getsource's full-sized avatar

Kira Schroder getsource

View GitHub Profile
@tott
tott / export.php
Created December 20, 2011 13:21
Exporter for WP_CLI
<?php
WP_CLI::addCommand('export', 'ExportCommand');
/**
* Implement export command
*
* @package wp-cli
* @subpackage commands/internals
*/
@nacin
nacin / gist:2323060
Created April 6, 2012 21:23
Nacin's SVN override
# SVN override to prevent commits that try to implicitly commit more than one file.
# Has weaned me off of svn ci -m very effectively. I now almost always use svn ci,
# which usually results in me writing longer and more helpful commit messages.
# Also, it prevents me from committing unrelated code, so there's that.
#
# Also checks for error_log, var_dump, and console.log, and rejects these commits.
function svn() {
if [ "$1" == "ci" ] && [ "$2" == "-m" ] && [ -z "$4" ] && [ "$(svn stat --ignore-externals | grep '^[^?X]' | wc -l | awk '{print $1}')" -gt 1 ]; then
svn stat --ignore-externals | grep '^[^?X]'
@PeteMall
PeteMall / plugin-last-updated.php
Created June 19, 2012 20:00
Display the last updated date for all plugins from the WordPress.org plugins repo.
<?php
/*
Plugin Name: Plugin Last Updated
Version: 1.0
License: GPL
Author: Pete Mall, Range
Author URI: http://petemall.com/
Description: Display the last updated date for all plugins from the <a href="http://wordpress.org/extend/plugins/">WordPress.org plugins repo</a>.
*/
@staylor
staylor / wp-imagick-access.php
Created December 9, 2012 00:24
I am using a script called "test.php" in the root of WordPress with a folder for images called "test-images/*". The original image is called "scott.jpg" - change that value with your image to play along
<?php
error_reporting(-1);
require( 'wp-load.php' );
require_once( ABSPATH . WPINC . '/class-wp-image-editor.php' );
require_once( ABSPATH . WPINC . '/class-wp-image-editor-imagick.php' );
/**
* Tosses Imagick methods up the chain to WP_Image_Editor_Imagick::image.
* WP_Image_Editor_Imagick::image is protected, so you can't act on
@getsource
getsource / secretplace.php
Created January 31, 2013 23:06
Make your dashboard your secret place.
<?php
/*
Plugin Name: Secret Place
Plugin URI: http://github.com/getsource
Description: Make your dashboard your secret place.
Author: Mike Schroder and Jason Cosper
Version: 0.1
Author URI: http://www.getsource.net/
*/
@nacin
nacin / trac-attach.sh
Last active March 21, 2016 09:37
A script that leverages Trac XML-RPC (I know, I know) to upload patches. Usage: `trac-attach.sh 12345`
#!/bin/sh
# A script that leverages Trac XML-RPC (I know, I know) to upload patches.
#
# This script is written specifically for the Mac, in that it reads from
# your keychain to derive your SVN password. You can change the SVN_PASS
# line below if you wanted to pull from ~/.svn/ or what not.
#
# Basic usage: `trac-attach.sh 12345` uploads a patch to ticket #12345,
# using the name 12345.diff. If there exists a 12345.diff, the patch is
55 westonruter
11 DrewAPicture
11 ocean90
10 afercia
8 obenland
6 celloexpressions
4 adamsilverstein
3 melchoyce
3 sergeybiryukov
2 boonebgorges
@markjaquith
markjaquith / aaa.nginxconf
Last active February 1, 2017 04:30
Grab non-locally-existing production images from Photon for your local WordPress dev environment
location ~* \.(jpe?g|gif|png)$ {
try_files $uri @photon;
}
location @photon {
rewrite ^(.*)-([0-9]+)x([0-9]+)\.(jpe?g|gif|png)$ http://i0.wp.com/$host$1.$4?resize=$2,$3;
rewrite . http://i0.wp.com/$host$request_uri;
}
@i3inary
i3inary / wp_install_default.sh
Created April 3, 2012 22:55
Default Install Script for WordPress Setup on MAMP localhost
#!/bin/bash
##############################
# DEFAULT WORDPRESS AND PLUGIN INSTALL SCRIPT
#
# 2012-04-03
# 1.0
# TODO: PUT A YES/NO PROMPT BEFORE RUNNING SCRIPT
#!!!!! EXITS UNLESS YOU MANUALLY COMMENT OUT THE LINE BELOW
exit
@boogah
boogah / Favorite Alfred Workflows.md
Last active December 29, 2017 19:41
My Favorite Alfred Searches & Workflows