This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| { | |
| "name": "your-github-name/your-repo", | |
| "license": "GPLv3", | |
| "minimum-stability": "dev", | |
| "prefer-stable": true, | |
| "authors": [ | |
| { | |
| "name": "Your Name", | |
| "email": "your@email.com" | |
| }, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| # Generate a Markdown change log of pull requests from commits between two tags | |
| # Author: Russell Heimlich | |
| # URL: https://gist.github.com/kingkool68/09a201a35c83e43af08fcbacee5c315a | |
| # HOW TO USE | |
| # Copy this script to a directory under Git version control | |
| # Make the script executable i.e. chmod +x changelog.sh | |
| # Run it! ./changelog.sh | |
| # Check CHANGELOG.md to see your results |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| var gulp = require('gulp'); | |
| var del = require('del'); | |
| gulp.task('clean:min-css', function () { | |
| // Delete all *.min.css files in the CSS directory so we don't get duplicates | |
| return del([ | |
| 'css/*.min.css' | |
| ]); | |
| }); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| function rh_404_overrides() { | |
| global $wp_query, $wpdb; | |
| if( $wp_query->is_404 && isset( $wp_query->query_vars['pagename'] ) && !empty( $wp_query->query_vars['pagename'] ) ) { | |
| $query = "SELECT `ID` FROM `" . $wpdb->posts . "` WHERE `guid` LIKE '%" . $wp_query->query_vars['pagename'] . "%' LIMIT 0,1;"; | |
| $post_id = intval( $wpdb->get_var( $query ) ); | |
| if( $url = get_permalink( $post_id ) ) { | |
| wp_redirect( $url, 301 ); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| function goddard_breadcrumbs( $post_id = FALSE ) { | |
| global $post; | |
| if( $post_id ) { | |
| $post = get_post( $post_id ); | |
| } | |
| if( !$post && !is_404() && !is_search() ) { | |
| return false; | |
| } | |
| $crumbs = array( |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| jQuery(document).ready(function($) { | |
| //Set-up some constants. | |
| var scrollTimeout; | |
| var scrollUsePushStateInstead = false; //Set to true to make the history stack of the browser include every point when posts were loaded. It's kind of annoying. | |
| var scrollDelay = 200; //Milliseconds | |
| var scrollLoading = false; | |
| var triggerOffset = $(document).height() - $('article').eq(-4).offset().top; //The point of this is to do one calculation up front instead of multiple calculations every time the infinite scroll is triggered. | |
| // Simple feature detection for History Management (borrowed from Modernizr) | |
| function supportsHistory() { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| /* | |
| Plugin Name: Pew Archive Filters | |
| Description: Adds re-write rules and helper functions that make filtering archives by year and/or a taxonomy possible. | |
| Version: 0.2 | |
| Author: Russell Heimlich | |
| Author URI: http://www.russellheimlich.com | |
| */ | |
| function pew_archive_filter_rewrite_rules( $wp_rewrite ) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| /** | |
| * Helper conditionals to run code in certain environments. | |
| */ | |
| if ( ! defined( 'RH_ENV' ) ) { | |
| $hostname = $_SERVER['HTTP_HOST']; | |
| if ( isset( $_SERVER['HTTP_X_FORWARDED_HOST'] ) && ! empty( $_SERVER['HTTP_X_FORWARDED_HOST'] ) ) { | |
| $hostname = $_SERVER['HTTP_X_FORWARDED_HOST']; | |
| } |