Skip to content

Instantly share code, notes, and snippets.

View montchr's full-sized avatar
I may be slow to respond.

chris montgomery montchr

I may be slow to respond.
View GitHub Profile
@montchr
montchr / readme.md
Last active December 21, 2015 11:28
Enqueuing styles for WP child theme

Parent

Line 9 of lib/enqueue-sass.php:

Currently:

wp_register_style( 'esemci-stylesheet', get_template_directory_uri() . '/css/style.css', array(), '', 'all' );
@montchr
montchr / gist:6773291
Last active December 24, 2015 08:49
Inline block CSS grid system in PHP loop http://codepad.viper-7.com/MdpMjx
<?php
$list = array("foo", "bar", "baz");
?>
<div class="grid">
<!--
<?php foreach ($list as $item) { ?>
--><span class="grid__item one-third"><?php echo $item; ?></span><!--
<?php } ?>
-->
@montchr
montchr / nowplaying-textexpander.applescript
Last active December 3, 2024 11:25
A script for TextExpander that displays info about the currently playing track in iTunes. Borrowed and modified from Andrew Harrison's script: http://andrew.harrison.org/uploads/2008/12/itunes.txt
-- A nice applescript for displaying what's playing in iTunes as follows:
-- Song by Artist on Album
-- 00:00/00:00
-- Original by Andrew Harrison • [email protected] • http://andrew.harrison.org
-- Modified slightly by Chris Montgomery <[email protected]>
-- Some parts from Doug's Applescript for iTunes. see below.
-- First things first, we're going to check if iTunes is running:
@montchr
montchr / 0_reuse_code.js
Created March 9, 2014 17:14
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
@montchr
montchr / README.md
Created March 11, 2014 02:47
Webdev Resources

Web development on a Mac

Requirements

  • Mac OS X 10.8.4+

Prep

  1. Install the latest version of Xcode 5 (currently 5.0.2) from Downloads for Apple Developers or,
#!/bin/bash
# works with a file called VERSION in the current directory,
# the contents of which should be a semantic version number
# such as "1.2.3"
# this script will display the current version, automatically
# suggest a "minor" version update, and ask for input to use
# the suggestion, or a newly entered value.
#!/bin/bash
# Functions ==============================================
# return 1 if global command line program installed, else 0
# example
# echo "node: $(program_is_installed node)"
program_is_installed () {
# set to 1 initially
local return_=1
#!/bin/sh
libs=( "/usr/local/lib/libmacfuse_i32.2.dylib" \
"/usr/local/lib/libosxfuse_i32.2.dylib" \
"/usr/local/lib/libosxfuse_i64.2.dylib" \
"/usr/local/lib/libmacfuse_i64.2.dylib" \
"/usr/local/lib/libosxfuse_i32.la" \
"/usr/local/lib/libosxfuse_i64.la" \
"/usr/local/lib/pkgconfig/osxfuse.pc" )
<?php
/**
* Generates a domain-mapping safe URL on WordPress.com
* Core's ajaxurl uses admin_url() which returns *.wordpress.com which doesn't work for the front-end on domain-mapped sites.
* This works around that and generates the correct URL based on context.
*/
function my_admin_ajax_url( $path = '' ) {
if ( is_admin() )
$url = admin_url( 'admin-ajax.php' );
else
@montchr
montchr / SMC-User-Migration.md
Last active August 29, 2015 14:01
Get a list of WordPress usernames and the number of posts attributed to them on the current site.

Export Users (Live WPEngine Site)

  1. Go to the specific site's Dashboard and click Users → Export User Data.
  • Select the following user meta fields to export:
    • Description
    • First name
    • Last name
    • LDAP login
    • Nickname
  • Change format to CSV.