View deploy-laravel-app.sh
This file contains 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 | |
version=`php artisan --version` | |
if [[ ${version} != *"Laravel Framework"* ]]; then | |
echo "Not a Laravel app, exiting." | |
exit; | |
fi | |
# Turn on maintenance mode |
View twitter-timeline-to-rss-feed.php
This file contains 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 | |
/** | |
* Generate an RSS feed from a Twitter user's timeline | |
* Chris Hardie <chris@chrishardie.com> | |
*/ | |
require "/path/to/vendor/autoload.php" ; | |
use Abraham\TwitterOAuth\TwitterOAuth; |
View jch-flickr-fixer.php
This file contains 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: Flickr Fixer | |
* Plugin URI: https://chrishardie.com/ | |
* Description: Find/replace Flickr references | |
* Version: 1.0 | |
* Author: Chris Hardie | |
* Author URI: https://chrishardie.com/ | |
*/ |
View class-api-routes.php
This file contains 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 | |
/** | |
* Class JCHPhotos_Plugin_API_Routes | |
* | |
* Handles API endpoints for looking up Flickr-to-WordPres translation stuff. | |
*/ | |
class JCHPhotos_Plugin_API_Routes { |
View check-for-results.php
This file contains 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 | |
require __DIR__ . '/vendor/autoload.php'; | |
require_once __DIR__ . '/config.php'; | |
$output_messages = array(); | |
$wayneco_results_html = file_get_contents( WAYNECO_RESULTS_URL ); | |
$state_results_html = file_get_contents( STATE_RESULTS_URL ); |
View instagram-to-rss.php
This file contains 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 | |
$target_accounts = array( | |
'bikes_as_transportation', | |
); | |
foreach ( $target_accounts as $target_user ) { | |
$target_user = urlencode( $target_user ); |
View storycorps-to-rss.php
This file contains 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 | |
$storycorps_archive_html = file_get_contents( 'https://api.storycorps.me/wp-json/interviews?filter[places]=richmond,indiana' ); | |
$storycorps_archive = json_decode( $storycorps_archive_html, true ); | |
$xml = new SimpleXMLElement('<rss/>'); | |
$xml->addAttribute("version", "2.0"); | |
$channel = $xml->addChild("channel"); |
View get-facebook-events.php
This file contains 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 | |
/** | |
* Proof of concept, retrieve publicly-available Facebook page event data. | |
* Chris Hardie <chris@chrishardie.com> | |
* | |
* To use, first add Guzzle as a dependency: | |
* $ commposer require guzzlehttp/guzzle | |
* | |
*/ |
View multisite_attachment_url.php
This file contains 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: Multisite Domain Mapping Attachment URL Fixes | |
* Description: Update attachment URLs to use mapped domain and remove mention of "sites" path. | |
* Author: Chris Hardie | |
* | |
* Rewrite attachment URLs (and related srcset URLs) to the non-multisite, mapped domain version if a domain is mapped | |
* Requires that the related nginx config that maps the non-multisite URL to the multisite URL be in place | |
**/ | |
add_filter( 'wp_get_attachment_url', 'jch_attachment_url_with_domain_mapping' ); |
View rss.pl
This file contains 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
#!/usr/bin/perl | |
use XML::RSS; | |
use strict; | |
my @event_array = <SQL MAGIC GOES HERE>; | |
my $rss = new XML::RSS; | |
$rss->channel( title => 'Your Title Here', link => 'https://...', | |
description => 'Your description here.' ); |
NewerOlder