Skip to content

Instantly share code, notes, and snippets.

View georgestephanis's full-sized avatar

George Stephanis georgestephanis

View GitHub Profile
<?php
/**
* A colophon-generating method for WordPress Special Projects Sites.
*
* team51_credits( 'separator= | ' );
*
* @param array $args {
* Optional. An array of arguments.
*
@georgestephanis
georgestephanis / LotJ_Cargo_Scraper.xml
Last active May 28, 2022 03:10
LotJ Cargo Analysis Plugin for Mushclient
<?xml version="1.0" encoding="iso-8859-1" ?>
<!DOCTYPE muclient>
<muclient>
<plugin name="LotJ_Cargo_Scraper" author="@Daljo" id="e95b128bc53345a4a39b29b4" language="Lua" purpose="Scrape cargo data." requires="4.73" version="0.1" save_state="y">
<description trim="y">
<![CDATA[
-- Cargo Scraper / Exporter --
]]>

Your First Block

To make things simple, we're going to make a semi-structured way to display a mailing address.

We're going to start with a file tree that looks like this:

address-block
  ├ blocks
  | ├ address.jsx
@georgestephanis
georgestephanis / external-links-new-tab.js
Last active February 1, 2022 16:33
Tiny WordPress plugin for how to force external links to open in a new tab.
// ==UserScript==
// @name OGLAF Keyboard Navigation
// @namespace http://tampermonkey.net/
// @version 0.1
// @description Add left/right arrow keyboard navigation.
// @author You
// @match https://www.oglaf.com/*
// @icon https://static.oglaf.com/favicon.png
// @grant none
// ==/UserScript==
<?php
// Plugin name: Jetpack Infinite Scroll for Single Posts
/**
* Infinite scroll needs to be filtered to function on non-archive pages.
*/
function jisfsp_archive_supported( $supported, $settings ) {
if ( is_singular( 'post' ) ) {
return true;
jQuery(document).on( 'ready', function($){
$('.categorychecklist').on( 'click', 'input[type="checkbox"]', function(){
if ( ! $(this).is( ':checked' ) ) return;
$(this).closest( 'ul.children' )
.parentsUntil( '.categorychecklist', 'li' )
.children( 'label' )
.children( 'input[type="checkbox"]' )
.prop( 'checked', true );
});
@georgestephanis
georgestephanis / index.php
Created March 29, 2021 15:22
`off-with-its-head` theme
<?php
if ( ! headers_sent() ) {
nocache_headers();
header( 'X-Robots-Tag: noindex, nofollow, noarchive, nosnippet' );
wp_safe_redirect( admin_url() );
}
?>
<!DOCTYPE html>
<?php
/**
* Plugin Name: Multisite Login Consolidation
* Author: georgestephanis
* License: GPLv2+
* Requires PHP: 7
* Network: true
*/