Skip to content

Instantly share code, notes, and snippets.

View goldenapples's full-sized avatar

Nathaniel Taintor goldenapples

  • Human Made
  • Philadelphia, PA
View GitHub Profile
@goldenapples
goldenapples / sqlprofiles
Created March 10, 2017 21:28
Comparison of SQL query performance before and after change
mysql> SELECT SQL_CALC_FOUND_ROWS wp_posts.ID FROM wp_posts LEFT JOIN wp_postmeta AS sq1 ON ( wp_posts.ID = sq1.post_id AND sq1.meta_key = '_wp_attached_file' ) WHERE 1=1 AND (((wp_posts.post_title LIKE '%AAPL%') OR (wp_posts.post_excerpt LIKE '%AAPL%') OR (wp_posts.post_content LIKE '%AAPL%') OR ( sq1.meta_value LIKE '%AAPL%' ))) AND wp_posts.post_type = 'attachment' AND ((wp_posts.post_status = 'inherit' OR wp_posts.post_status = 'private')) GROUP BY wp_posts.ID ORDER BY wp_posts.post_date DESC LIMIT 0, 40;
+--------+
| ID |
+--------+
| 844868 |
| 844279 |
| 843458 |
| 840260 |
| 839870 |
| 837818 |
<div>
<a href="#" class="fusion-twitter" data-trigger="click" data-category="share-events" data-action="twitter-share" data-label="http://interactive.fusion.net/refugee-camps/" >
<svg id="twitter" width="30px" height="30px" viewBox="0 0 512 512">
<path d="M492,109.5c-17.4,7.7-36,12.9-55.6,15.3c20-12,35.4-31,42.6-53.6c-18.7,11.1-39.4,19.2-61.5,23.5 C399.8,75.8,374.6,64,346.8,64c-53.5,0-96.8,43.4-96.8,96.9c0,7.6,0.8,15,2.5,22.1c-80.5-4-151.9-42.6-199.6-101.3c-8.3,14.3-13.1,31-13.1,48.7c0,33.6,17.2,63.3,43.2,80.7C67,210.7,52,206.3,39,199c0,0.4,0,0.8,0,1.2c0,47,33.4,86.1,77.7,95c-8.1,2.2-16.7,3.4-25.5,3.4c-6.2,0-12.3-0.6-18.2-1.8c12.3,38.5,48.1,66.5,90.5,67.3c-33.1,26-74.9,41.5-120.3,41.5c-7.8,0-15.5-0.5-23.1-1.4C62.8,432,113.7,448,168.3,448C346.6,448,444,300.3,444,172.2c0-4.2-0.1-8.4-0.3-12.5 C462.6,146,479,129,492,109.5z" />
</svg>
</a>
<a href="#" class="fusion-facebook" data-trigger="click" data-category="share-events" data-action="facebook-share" data-label="http://interactive.fusion.net/refugee-camps/" >
<s
We can't make this file beautiful and searchable because it's too large.
ID,url,Headline,Section,Author,"Pub Date","Word Count","Publishing Checklist Total",Hat,"Featured Image","Featured Image Credit","Section Tag","At Least Four Tags","Why Fusion?","Social Packaging","Google News Keywords, SEO Hed &amp; Deck","Edit URL for Keywords","Link to 3 Fusion articles","Internal Links First Paragraph","Internal Links Total","Complete Record?"
315047,http://fusion.net/story/315047/donald-trump-hillary-clinton-week-in-social-media/,"Clinton embraces gay pride; Trump embraces all things 'independent'",News,"Kate Stohr",2016-07-01T19:51:23+00:00,355,9,Yes,Yes,Yes,Yes,Yes,Yes,Yes,Yes,Yes,No,0,0,Yes
321206,http://fusion.net/story/321206/vaginal-rejuventation-stem-cell-therapy/,"'Vaginal-rejuvenation' stem cell therapy is probably bogus, but people in Beverly Hills are still paying for it","Real Future","Kristen V. Brown",2016-07-01T19:48:10+00:00,531,8,Yes,Yes,Yes,Yes,Yes,No,Yes,Yes,Yes,No,0,0,Yes
321108,http://fusion.net/story/321108/nypd-muslim-beard-masood-syed/,"NYPD reinstates Muslim offi
meta_id post_id meta_key meta_value
733568 164786 bitly_url http://fus.in/1KV8p14
733569 164786 fusion_first_author 74055225
733570 164786 _edit_lock 1436563229:74055225
733571 164786 _edit_last 74055225
733576 164786 geo_public 0
733577 164786 fusion_production a:4:{s:14:"featured_media";a:4:{s:19:"featured_media_type";s:5:"image";s:14:"featured_video";N;s:18:"featured_rich_text";s:0:"";s:24:"image_vertical_alignment";s:6:"center";}s:13:"layout_design";a:1:{s:8:"subtitle";s:0:"";}s:3:"ads";a:5:{s:7:"ad_flag";s:0:"";s:13:"freewheel_tag";s:0:"";s:16:"freewheel_status";s:7:"enabled";s:12:"polar_status";s:7:"enabled";s:12:"teads_status";s:7:"enabled";}s:13:"recirculation";a:1:{s:17:"speed_bump_recirc";s:7:"enabled";}}
733578 164786 fusion_distribution a:5:{s:8:"facebook";a:3:{s:5:"title";s:0:"";s:11:"description";s:0:"";s:5:"image";i:164882;}s:7:"twitter";a:4:{s:10:"share_text";s:0:"";s:5:"title";s:0:"";s:11:"description";s:0:"";s:5:"image";i:164882;}s:9:"pinterest";a:2:{s:11:"description";s:0:"";s:5:"image";N;}
It was four in the afternoon,
and the fast little night animals
were turning around in the dark places.
The song making flying animals
were easily hurt
and the little green round animals from home yelled
Watch out for the scare-you animal, my son!
Its mouth that bites, its hands that catch.
diff --git a/Users/nathaniel.taintor/Downloads/zurb-responsive-tables-0d34bc6/responsive-tables.js b/assets/js/src/responsive-tables.js
old mode 100755
new mode 100644
index 1a862f1..28c5595
--- a/Users/nathaniel.taintor/Downloads/zurb-responsive-tables-0d34bc6/responsive-tables.js
+++ b/assets/js/src/responsive-tables.js
@@ -1,67 +1,77 @@
-$(document).ready(function() {
- var switched = false;
- var updateTables = function() {
1,30c1,25
< var $ = require('jquery');
<
< /**
< * Makes tables wider that the viewport "responsive" by setting their first
< * column as fixed position and allowing the remaining columns to be scrollable
< * horizontally.
< *
< * Based off code from http://zurb.com/playground/responsive-tables
< * Modified to be usable in our browserify system, and also to check the table
@goldenapples
goldenapples / gist:52b3b7e4542d4554dac7
Created May 15, 2015 19:42
Speed Bumps API concept
// This should be all a theme has to do to register a speed bump and get it inserted
register_speed_bump(
'polar', // speedbump ID, just a hook in case it needs to be disabled on case-by-case basis anywhere else
10, // priority. WP uses priority integers like this a lot to look
// through arrays. The $_speed_bumps array would be sorted by
// priority and looped through, so that the speed bumps with the
// lowest priority get inserted first.
array(
// $args array. See http://codex.wordpress.org/wp_parse_args for an

Keybase proof

I hereby claim:

  • I am goldenapples on github.
  • I am goldenapples (https://keybase.io/goldenapples) on keybase.
  • I have a public key whose fingerprint is BD90 5A03 201A 2D18 C45D E759 2D1A 5757 81B4 F009

To claim this, I am signing this object:

@goldenapples
goldenapples / deploy.sh
Created September 21, 2012 17:55
BASH script for deploying WordPress content changes from staging to production
#!/bin/bash
# A BASH script for deploying WordPress content changes
# from staging to production. Note: this works for me because both my
# staging and production share the same plugins folder, and I have permissions
# on all the appropriate directories to allow the user running the script to
# perform all the actions in here. May need tweaking for other setups.
STAGING_DIR="/var/www/staging-wpsite"
PRODUCTION_DIR="/var/www/wpsite"
STAGING_DB="staging_wpsite"
PRODUCTION_DB="wpsite"