Skip to content

Instantly share code, notes, and snippets.

@nacin
nacin / issues.css
Created October 16, 2015 06:02
User style for GitHub issues to show the issue owner's name, rather than a 4-pixel avatar. Inspired by @mdickers47.
.issues-listing .table-list-issues .issue-title {
width: 700px;
}
.issues-listing .table-list-issues .table-list-cell-avatar {
width: auto;
}
.issues-listing .table-list-issues .table-list-cell-avatar img {
content: "";
}
.issues-listing .table-list-issues .table-list-cell-avatar img::before{
@nacin
nacin / attach.sh
Last active August 29, 2015 13:56
#!/bin/sh
# In order for this to work, you needed to have committed to
# https://plugins.svn.wordpress.org and have this in your Mac OS X keychain.
# In lieu of a ticket number, it also accepts the format "12345.3.diff"
# which will replace a previous diff of that name.
# Edit this
SVN_USER='nacin'
<!DOCTYPE html>
<head>
<meta charset="utf-8" />
</head>
<body>
<form>
<input type="text" name="log" />
<input type="password" name="pwd" />
<input type="submit" />
@nacin
nacin / london-contribute.md
Created November 24, 2013 12:40
WordCamp London 2013 Contributor Day Notes from the introduction to contributing to core.
@nacin
nacin / auto-update.php
Last active March 11, 2019 17:17
This is how @dd32 and I test automatic background updates in WordPress 3.7. Then just do example.com/?wp_maybe_auto_update. (If you use a checkout of develop.svn.wordpress.org, you can run this on the `build` directory, then simply run `grunt copy` between updates to copy over the latest code from `src`. This is how we are able to make adjustmen…
<?php
// Add this as a mu-plugin.
if ( isset( $_GET['wp_maybe_auto_update'] ) ) {
add_filter( 'automatic_updates_is_vcs_checkout', '__return_false' );
add_action( 'template_redirect', function() {
$time = date( 'r' );
echo "Starting... $time<br />";
delete_site_option( 'auto_core_update_failed' );
@nacin
nacin / functions.php
Created September 23, 2013 14:00
Removes 'Private:' and 'Protected' from the start of post titles.
<?php
function nacin_remove_private_protected_from_titles( $format ) {
return '%s';
}
add_filter( 'protected_title_format', 'nacin_remove_private_protected_from_titles' );
add_filter( 'private_title_format', 'nacin_remove_private_protected_from_titles' );
<?php
/*
* Plugin Name: Hacky Taxonomy Archives
* Description: Don't use this on a live site, plz. Proof of concept for Aaron Holbrook.
* Author: Andrew Nacin
*/
add_action( 'template_redirect', function() {
global $wp_rewrite;
$taxonomy = 'fruits';
@nacin
nacin / gist:5533549
Last active December 17, 2015 02:08 — forked from rlerdorf/gist:5530518
PemFTP
--------------------------------
File : wp-admin/includes/class-ftp.php:508
Reason : UseUndeclaredVariable
Snippet : $arg
Line : return $this->_list(($arg?" ".$arg:"").($pathname?" ".$pathname:""), "NLST", "nlist");
--------------------------------
File : wp-admin/includes/class-ftp.php:508
Reason : UseUndeclaredVariable
Snippet : $arg
<?php
//** Redirect if not logged in
add_action( 'template_redirect', function() {
if ( ! is_user_logged_in() ) {
wp_redirect( wp_login_url() );
exit;
}
} );
@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