Skip to content

Instantly share code, notes, and snippets.

Andrew Nacin nacin

Block or report user

Report or block nacin

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@nacin
nacin / issues.css
Created Oct 16, 2015
User style for GitHub issues to show the issue owner's name, rather than a 4-pixel avatar. Inspired by @mdickers47.
View issues.css
.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{
View attach.sh
#!/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'
View 1password.html
<!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 Nov 24, 2013
WordCamp London 2013 Contributor Day Notes from the introduction to contributing to core.
View london-contribute.md
@nacin
nacin / auto-update.php
Last active Mar 11, 2019
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…
View auto-update.php
<?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 Sep 23, 2013
Removes 'Private:' and 'Protected' from the start of post titles.
View functions.php
<?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' );
View hacky-taxonomy-archives.php
<?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';
View gist:5533549
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
View prying-eyes.php
<?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 Mar 21, 2016
A script that leverages Trac XML-RPC (I know, I know) to upload patches. Usage: `trac-attach.sh 12345`
View trac-attach.sh
#!/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
You can’t perform that action at this time.