Skip to content

Instantly share code, notes, and snippets.

View waltspence's full-sized avatar

Walt Spence waltspence

View GitHub Profile
@waltspence
waltspence / sharify.php
Created November 20, 2016 02:02
Sharify Wordpress Function
<?php
/**
* Sharify (Social Buttons for Single Posts)
*
*@package AwesomeWP
*@since AwesomeWP 1.0.0
*/
function sharify_social_sharing_buttons($content) {
if ( is_single() ) {
@waltspence
waltspence / .bashrc
Created November 20, 2016 01:55
.bashrc
# ~/.bashrc: executed by bash(1) for non-login shells.
# see /usr/share/doc/bash/examples/startup-files (in the package bash-doc)
# for examples
# If not running interactively, don't do anything
case $- in
*i*) ;;
*) return;;
esac
@waltspence
waltspence / functions.php
Created October 27, 2016 22:08
Clean WP Header
/************
* Clean up *
*************/
// Remove WP Emojis
remove_action('wp_head', 'print_emoji_detection_script', 7);
remove_action('wp_print_styles', 'print_emoji_styles');
// Remove really simple discovery link
remove_action('wp_head', 'rsd_link');
@waltspence
waltspence / docker-wordpress.sh
Created August 12, 2016 07:35 — forked from tatemz/docker-wordpress.sh
A quick way to get a WordPress installation up and running with Docker
#!/bin/bash
mkdir wordpress-site && cd wordpress-site
touch docker-compose.yml
cat > docker-compose.yml <<EOL
my-wpdb:
image: mariadb
ports:
@waltspence
waltspence / keybase.md
Created July 31, 2016 16:21
Keybase.io Verification

Keybase proof

I hereby claim:

  • I am waltspence on github.
  • I am waltspence (https://keybase.io/waltspence) on keybase.
  • I have a public key whose fingerprint is B59F 45AC 03AA D9AC 5763 37C8 6D3F 29CC 8D8F 0EE1

To claim this, I am signing this object:

@waltspence
waltspence / giphy.js
Created July 26, 2016 04:12 — forked from nealrs/giphy.js
use the giphy api to search for & add an animated gif to a webpage.
// on page load, search for & display a random gif matching your search term using the Giphy API.
// usage:
// include giphy.js in your <head>
// set q to your search term (e.g. "brunch")
// add <span id = "giphyme"></span> wherever you want to display the image. -- FYI, it will be centered.
// big ups to the Giphy crew (giphy.com)
// 2014 - Neal Shyam [@nealrs | nealshyam.com]
document.addEventListener('DOMContentLoaded', function () {
q = "finger guns"; // search query
@waltspence
waltspence / .bashrc
Created June 27, 2016 17:54
bashrc for bash aliases, paths, etc.
# ~/.bashrc: executed by bash(1) for non-login shells.
# see /usr/share/doc/bash/examples/startup-files (in the package bash-doc)
# for examples
# If not running interactively, don't do anything
case $- in
*i*) ;;
*) return;;
esac
@waltspence
waltspence / Werwerwerwerk
Last active October 31, 2017 06:06
Create a project directory quickly in bash
alias werwerwerwerk="cd $HOME/Projects/current && mkdir werk_$(date +%F-%T)"
@waltspence
waltspence / bashcommand.sh
Created June 21, 2016 02:58
RSS 2 JSON example
curl http://rss2json.com/api.json?rss_url=http://feeds.feedburner.com/alistapart/main > my.json
@waltspence
waltspence / webhooks.js
Created June 20, 2016 08:17 — forked from ryandotsmith/webhooks.js
Chain.com Webhooks Example
/*
Chain's Webhooks system will send an HTTP request
to our app with an event type of 'address-transaction'.
The body of the request will contain Chain's transaction
object. We can use this payload to do whatever we want!
*/
app.post('/', function (req, res) {
if (req.body['event'] == 'address-transaction') {
sendSMS(req.body.transaction)
res.send('OK\n');