Skip to content

Instantly share code, notes, and snippets.

View tlovett1's full-sized avatar

Taylor Lovett tlovett1

View GitHub Profile
@jtsternberg
jtsternberg / git-pre-push.php
Created March 16, 2015 21:07
Run dockunit (but could do with phpunit or any other command) if any php files have changed and are about to be pushed. Rename to `pre-push` and put in the `.git/hooks/` directory.
#!/usr/bin/php
<?php
$lines = file_get_contents( 'php://stdin', 'r' );
if ( empty( $lines ) ) {
exit( 0 );
}
$lines = explode( "\n", $lines );
$lines = explode( ' ', $lines[0] );
@jimbojsb
jimbojsb / gist:1630790
Created January 18, 2012 03:52
Code highlighting for Keynote presentations

Step 0:

Get Homebrew installed on your mac if you don't already have it

Step 1:

Install highlight. "brew install highlight". (This brings down Lua and Boost as well)

Step 2:

@boogah
boogah / WordPress_Unicode_Fix.sql
Last active October 14, 2016 08:11
Run this when you see weird crap in your posts/comments after moving your WordPress install.
update wp_posts set post_content = replace(post_content,'’','\'');
update wp_posts set post_title = replace(post_title,'’','\'');
update wp_comments set comment_content = replace(comment_content,'’','\'');
update wp_postmeta set meta_value = replace(meta_value,'’','\'');
update wp_posts set post_excerpt = replace(post_excerpt,'’','\'');
update wp_posts set post_content = replace(post_content,'…','...');
update wp_posts set post_title = replace(post_title,'…','...');
update wp_comments set comment_content = replace(comment_content,'…','...');
update wp_postmeta set meta_value = replace(meta_value,'…','...');