Skip to content

Instantly share code, notes, and snippets.

View samhotchkiss's full-sized avatar

Sam Hotchkiss samhotchkiss

View GitHub Profile
{"globalFilters":"[\"-https:#mail.google.com/*\",\"-https:#reader.google.com/*\",\"*\"]","hotkeys":"[[\"22\",\"j\",\"Next Email\",\"if ( jQuery(\\\".messages-scroll-container .conversation-row.selected\\\").not('.private-hoverlay__child').length > 0 ) {\\njQuery('.conversation-row.selected + .conversation-row').click();\\n} else {\\njQuery(\\\".conversation-row:not(.private-hoverlay__child)\\\").first().click();\\n}\",[\"https://app.hubspot.com/live-messages/*\"]],[\"23\",\"k\",\"Prev Email\",\"jQuery('.conversation-row.selected').prev('.conversation-row').click();\",[\"https://app.hubspot.com/live-messages/*\"]],[\"24\",\"c\",\"Close Email\",\"jQuery( \\\"button:contains('Mark as closed')\\\" ).click();\\njQuery('.conversation-row.unread').click();\",[\"https://app.hubspot.com/live-messages/*\"]],[\"25\",\"a\",\"Assign Email\",\"jQuery('.reassignment-selected-agent').click();\\njQuery(\\\"input[type='search']\\\").val('');\",[\"https://app.hubspot.com/live-messages/*\"]],[\"26\",\"u\",\"Unassigned Messages\"
@samhotchkiss
samhotchkiss / freshpack.sh
Created June 28, 2016 22:21
Creates a fresh install of Jetpack beta
#!/bin/bash
url="https://betadownload.jetpack.me/jetpack.zip"
opt=$1
if [ "rc" == "$1" ]; then
url="https://betadownload.jetpack.me/rc/jetpack.zip"
fi
if [ "repo" == "$1" ]; then
@samhotchkiss
samhotchkiss / wp-multicall-example.xml
Created October 12, 2015 17:43
Example of Multicall in WordPress
<?xml version="1.0"?>
<methodCall>
<methodName>system.multicall</methodName>
<params>
<param>
<value>
<array>
<data>
<value>
<struct><member><name>methodName</name><value><string>wp.getAuthors</string></value></member><member><name>params</name><value><array><data><value><string>1</string></value><value><string>sam</string></value><value><string>a</string></value></data></array></value></member></struct>
@samhotchkiss
samhotchkiss / dance-carlton.php
Created February 28, 2015 00:05
Play a random Carlton Dance gif...
<?php
$dance_options = array(
'http://media.giphy.com/media/BcUeucif6Pmdq/giphy.gif',
'http://media.giphy.com/media/IVORu79kc8sbC/giphy.gif',
'http://media.giphy.com/media/pa37AAGzKXoek/giphy.gif',
'http://media.giphy.com/media/eS8KpVTznwBpe/giphy.gif',
'http://media.giphy.com/media/XHsnuaGQsSuPu/giphy.gif',
'http://media.giphy.com/media/ojFNRsqDe6YnK/giphy.gif',
'http://media.giphy.com/media/oFJZofr6WA57W/giphy.gif',
'http://media.giphy.com/media/K9N8ErSzG2dj2/giphy.gif'
@samhotchkiss
samhotchkiss / meta.php
Created October 29, 2014 00:08
Proposed Modifications to register_meta()
<?php
/**
* Register meta key
*
* @since 3.3.0
*
* @param string $meta_type Type of meta
* @param string $meta_key Meta key
* @param string|array $sanitize_callback A function or method to call when sanitizing the value of $meta_key.
* @param string|array $auth_callback Optional. A function or method to call when performing edit_post_meta, add_post_meta, and delete_post_meta capability checks.
@samhotchkiss
samhotchkiss / gist:6438586
Created September 4, 2013 15:26
Transmit make MySQL dump right there
cd YOUR/PATH && mysqldump -u YOUR_USERNAME -pYOUR_PASSWORD YOUR_DB_NAME >dbdump1s7816.sql
@samhotchkiss
samhotchkiss / htaccess force download
Created August 19, 2013 19:06
This forces download of .fnm files
<FilesMatch "\.(?i:fnm)$">
Header set Content-Disposition attachment
</FilesMatch>
@samhotchkiss
samhotchkiss / gitignore-for-wp
Created August 9, 2013 01:35
Basic Gitignore for WordPress
# This is a template .gitignore file for git-managed WordPress projects.
#
# Fact: you don't want WordPress core files, or your server-specific
# configuration files etc., in your project's repository. You just don't.
#
# Solution: stick this file up your repository root (which it assumes is
# also the WordPress root directory) and add exceptions for any plugins,
# themes, and other directories that should be under version control.
#
# See the comments below for more info on how to add exceptions for your