Skip to content

Instantly share code, notes, and snippets.

View whyisjake's full-sized avatar
✈️

Jake Spurlock whyisjake

✈️
View GitHub Profile
@whyisjake
whyisjake / import_podcasts.php
Last active March 29, 2021 17:30
WP-CLI script to import posts from an RSS feed into WordPress. Meant to map to existing posts, and if they don't exist, create new ones.
<?php
WP_CLI::add_command( 'podcast', 'Podcast_Importer' );
/**
* Podcast Importer
*/
class Podcast_Importer extends WP_CLI_Command {
<style>
.time { vertical-align: top; width: 10%; }
.speaker { vertical-align: top; width: 25% }
.desc { vertical-align: top; }
table.schedule tr { margin-bottom 20px; }
table.schedule tr td { padding: 20px 10px; }
table.schedule.min tr td { padding: 10px; }
table.schedule tr:nth-child(odd) {
background-color: #eee;
}
<style>
.container {
width: 300px;
}
.window {
width: 300px;
float: left;
}
.prev {
left: -300px;
@whyisjake
whyisjake / 0_reuse_code.js
Last active August 29, 2015 14:11
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
<?php
// This is the ideal post, based on the current pointer.
$ideal = $query->posts[ $index ]->ID;
if ( in_array( $ideal, $used ) ) {
// If it is in the array, update the index to the next.
// What this doesn't have, is a way to go 2+...
$index++
}
// Grab the post.
<?php
/**
* Number Tower
*/
$rows = array(
array( 21, 24, 0, 9, 0, 0, 2 ),
array( 45, 30, 0, 11, 9, 0 ),
array( 75, 0, 0, 20, 0 ),
array( 0, 0, 0, 38 ),
@whyisjake
whyisjake / phpconsole.sublime-snippet
Created December 4, 2014 19:42
PHP Console Add this to ~/Library/Application Support/Sublime Text 2/Packages/User
<snippet>
<content><![CDATA[?><script>console.log(<?php echo json_encode( \$${1:this} ); ?>);</script><?php]]></content>
<tabTrigger>phpconsole</tabTrigger>
<scope>source.php</scope>
<description>PHP Console</description>
</snippet>
@whyisjake
whyisjake / phpconsole.sublime-snippet
Created September 22, 2014 20:57
Little Sublime Text snippet to take a PHP object, and output as JSON, and then console.log() it.
<snippet>
<content><![CDATA[<script>console.log(<?php echo json_encode( ${1:\$this} ); ?>);</script>]]></content>
<tabTrigger>phpconsole</tabTrigger>
<scope>source.php</scope>
<description>PHP Console</description>
</snippet>
<?php
// The date to start on.
$current_year = date( 'Y' );
// This doesn't matter that much, but it will
// make the page load a little faster if you
// know exactly what the range is.
$ending_year = 2000;
@whyisjake
whyisjake / DbKJr.markdown
Created June 17, 2014 00:10
A Pen by Jake Spurlock.