Skip to content

Instantly share code, notes, and snippets.

View ethernick's full-sized avatar

Nick Kempinski ethernick

View GitHub Profile
ethernick / wp_activitypub_conditional_shortcode
Last active June 4, 2024 21:59
Here's a little short code I use to add some conditional magic for federating content. Use case: If the post is short, just post the content - no title; no permalink.
function conditional_shortcode($atts, $content, $tag){
global $post;
$atts = shortcode_atts(
array( 'length' => 400, 'condition' => 'gt' ),

Keybase proof

I hereby claim:

  • I am ethernick on github.
  • I am ethernick ( on keybase.
  • I have a public key whose fingerprint is E6A2 939B 1EA8 06FE 122B 6728 2742 2FC5 0E85 69D6

To claim this, I am signing this object:

ethernick / playlist.js
Last active August 29, 2015 14:18
Auido Aether Playlist
// Create a new database using an array
var playlist = [
url: "",
rotation: 20,
label: "new"
url: "",
rotation: 20,
ethernick / metamarkdown.php
Last active August 29, 2015 13:58
Extend PHP Fat-Free (F3) with MetaMarkdown. Setting a global 'meta' var that can be used later on.
class MetaMarkdown extends Markdown {
protected function meta($txt) {
$pattern = '/^([A-Za-z]+)\:\s*\t*(.+)$/m';
//$pattern = '/^(.*)\:(?\s*)(?\t*)(.+)(\r\n|\n)/';
//echo $txt;
$txt = preg_replace_callback(
function($expr) {