Skip to content

Instantly share code, notes, and snippets.

View cogdog's full-sized avatar

Alan Levine cogdog

View GitHub Profile
@cogdog
cogdog / oe-contries.html
Created May 31, 2018 17:03
Ontario Extend Map Animation
<html>
<head>
<title>Countries Visited By Ontario Extenders</title>
<style>
body
{
background-color: #81d4fa;
margin: 0;
@cogdog
cogdog / functions.php
Created September 14, 2018 14:06
SPLOT Writer functions
<?php
/* tru-writer theme functions
Lives and forks at http://github.com/cogdog/truwriter
Much of the magic happens here. Edit your own discretion, peril, unless you
find a coding error, and by all means please fork this to the github repo
thus you are deemed an honorary SPLOT knight.
We suggest putting your own extra groovy code in incldes/custom-functions.php
@cogdog
cogdog / wp-posted-today.php
Created January 14, 2019 02:56
shortcode to output all posts published on current date
/* outputs a list of all posts published in the current day in previous years
This will be done up properly as plugin, this is just current code inserted
in functions.php for CogDogBlog - see demo at https://cogdogblog.com/this-day
Inspired by John Johnston's version
https://gist.github.com/troutcolor/ed3c72ea54a0ee8c814382eb24806cee
*/
add_action( 'init', 'cdb_postedtoday_shortcode' );
@cogdog
cogdog / form.php
Created July 2, 2019 21:50
Get Tinymce text editor contents
/* php form creation
<?php if ( trucollector_option('caption_field') == 's'):?>
<input id="wRichText" type="hidden" value="0">
<textarea name="wText" id="wText" rows="4" tabindex="4"><?php echo stripslashes( $wText );?></textarea><p style="font-size:0.8rem">To create hyperlinks use this shortcode<br /><code>[link url="http://www.themostamazingwebsiteontheinternet.com/" text="the coolest site on the internet"]</code><br />If you omit <code>text=</code> the URL will be the link text.</p>
@cogdog
cogdog / splotbox-extender-splotca.php
Last active July 5, 2021 05:30
Version of the SPLOT Extender in use at SPLOT.ca/box
<?php
/*
Plugin Name: SPLOTbox Extender
Plugin URI: https://github.com/cogdog/splotbox-extender
Description: With some elbow grease manual coding, you can extend the functionality of a SPLOTbox site to support more media sites than the original theme.
Version: 0.61
License: GPLv2
Author: Alan Levine
Author URI: https://cog.dog
*/
@cogdog
cogdog / gist:107a02f6dac2e15b2e4e1306d7e17d94
Created January 13, 2020 15:34
VVV Provision Fail Log1
Bringing machine 'default' up with 'virtualbox' provider...
==> default: Importing base box 'ubuntu/trusty64'...
==> default: Matching MAC address for NAT networking...
==> default: Checking if box 'ubuntu/trusty64' version '20190514.0.0' is up to date...
==> default: Setting the name of the VM: vagrantly_f801a52a224
==> default: Clearing any previously set forwarded ports...
==> default: Clearing any previously set network interfaces...
@cogdog
cogdog / gist:ab8117cf21d9fbe57c8df6336ac63c26
Created January 13, 2020 15:36
VVV Provision Log Fail 2
cogdog:vagrantly cogdog$ vagrant up --provision
__ ___ ___ __ ____
\ \ / \ \ / \ \ / / |___ \
\ \ / / \ \ / / \ \ / / __) |
\ V / \ V / \ V / / __/
\_/ \_/ \_/ |_____|
Varying Vagrant Vagrants v2.1.0-master
Docs: https://varyingvagrantvagrants.org/
Contribute: https://github.com/varying-vagrant-vagrants/vvv
@cogdog
cogdog / accordion.md
Last active May 21, 2021 17:57
GitHub Does Accordions!

Can I Haz Accordions

What Are Accordions For?

The H5P documentation spells it out nicely:

Reduce the amount of text presented to readers by using this responsive accordion. Readers decide which headlines to take a closer look at by expanding the title. Excellent for providing an overview with optional in-depth explanations.

@cogdog
cogdog / altChecker.js
Last active November 22, 2021 00:44 — forked from bennettscience/altChecker.js
Mod
/* Modified version of Brian Bennett's bookmarklet for blurring
images in a page lacking alt descriptions, added class for missing alts */
// code version
(function() {
'use strict';
function addCssRule(rule) {
var head, style;
head = document.querySelector('head');
@cogdog
cogdog / fetch.php
Last active February 22, 2023 00:55
Fetch Mastodon Mentions with PHP
<?php
// Mastodon account details, hardwired for dev, add yours as needed
$creds = [
'account' => '', //username in form @[email protected]
'host' => '', // url without trailing slash e.g. https://instance.social
'url' => '', // user account URL https://instance.social/@user
'token' => '', // access token created in Edit Profile-> Development
'getcount' => 10 // number of posts to get,max=30
];
?>