Skip to content

Instantly share code, notes, and snippets.

brew install php-code-sniffer
composer global require wp-coding-standards/wpcs
phpcs --config-set installed_paths ~/.composer/vendor/wp-coding-standards/wpcs/
inderpreet99 / wp-import-automatch-users.js
Last active May 2, 2016
During WP Import, run the following script in Chrome DevTools console to assign authors automatically. Make jQuery contains case-insensitive for best results:
View wp-import-automatch-users.js
jQuery('#authors li').each(function(index) {
var user = jQuery(this).find('strong').text();
var re = /^(.*)\s\(([\w\s]*)\)/;
var match = user.match(re);
var name = match[1];
var username = match[2];
console.log('user: ' + user);
var usermap = jQuery(this).find('select');
var select_username = jQuery(usermap).find('option:contains("' + username + '")').attr('selected', true);
if ( select_username.length == 0 ) {
inderpreet99 / finder-open-iterm-here.scpt
Last active Mar 1, 2020 — forked from cowboy/finder-open-iterm-here.scpt
Finder Open iTerm Here: Drop a folder on this script (or just run it) to open a new iTerm window there. If the selected item isn't a folder, it will open the item's parent folder. Great when bound to a hotkey in FastScripts or added to the Finder Sidebar. Works with iTerm2-v3 (2.9)
View finder-open-iterm-here.scpt
* Finder Open iTerm Here - v1.0.2 - 4/14/2011
* Copyright (c) 2011 "Cowboy" Ben Alman
* Dual licensed under the MIT and GPL licenses.
tell application "Finder"