Skip to content

Instantly share code, notes, and snippets.

@woodwardtw
woodwardtw / catalog.css
Last active January 27, 2023 13:08
Middlebury Canvas Catalog Custom CSS
h1,
h2,
h3,
h4,
h5,
.h1 {
font-family: Domine, georgia, serif;
}
#app-header {
@woodwardtw
woodwardtw / config.json
Last active August 16, 2023 12:37
IIIF manifest in themes > theme name > asset > universal viewer - update on Aug 16 to hide top bar tools (which failed)
{
"options": {
"bookmarkThumbHeight": 150,
"bookmarkThumbWidth": 90,
"leftPanelEnabled": true,
"limitLocales": true,
"minWidthBreakPoint": 610,
"navigatorEnabled": true,
"openTemplate": "http://universalviewer.io?manifest={0}",
"overrideFullScreen": false,
@woodwardtw
woodwardtw / example-pything-dooo.py
Created August 19, 2022 14:38
just a poc showing how the php stuff might get written around the csv data
# full path
data = open("../../test/test.php", "w")
phpheader = ["<?php \n", "defined( 'ABSPATH' ) || exit; \n", "$bar = '"]
data.writelines(phpheader)
# regular csv stuff to populate the variable
section.part header h1, section.front-matter header h1.entry-title, section.back-matter header h1.entry-title,
.front-matter h5,
.part h5,
.chapter h5,
.back-matter h5,
body#tinymce.wp-editor h5,
.front-matter h2,
.part h2,
.chapter h2,
.back-matter h2,
@woodwardtw
woodwardtw / escape-the-panopticon.js
Created July 1, 2022 18:36
bookmarklet to download Panopto videos in playlist
javascript: (() => {var tableRows = document.querySelector('.session-list').querySelectorAll('tr');tableRows.forEach((row) => {if(row.dataset){var dlUrl = 'https://midd.hosted.panopto.com/Panopto/Podcast/Download/'+row.dataset.id+'.mp4?mediaTargetType=videoPodcast';window.open(dlUrl);}});})();
<?php
//simple GF merge field modifier that replaces the space with a dash
add_filter( 'gform_merge_tag_filter', function ( $value, $merge_tag, $modifier, $field, $raw_value, $format ) {
if ( $merge_tag != 'all_fields' && $modifier == 'urlmaker' ) {
$value = str_replace(" ", "-", $value);
}
return $value;
}, 10, 6 );
@woodwardtw
woodwardtw / gf_to_events_calendar.php
Last active June 30, 2022 19:22
makes a live event that does require manual update
<?php
add_action( 'gform_after_submission_3', function ( $entry ) {
if ( ! function_exists( 'tribe_create_event' ) ) {
return;
}
$start_date = rgar( $entry, '2' );
$start_time = rgar( $entry, '3' );
$end_date = rgar( $entry, '4' );
$end_time = rgar( $entry, '5' );
@woodwardtw
woodwardtw / sensus.php
Created June 17, 2022 12:15
index builder for sensus access data
<h1>SensusAccess Stats Index</h1>
<?php
function create_file_name($string){
$name = str_replace('middlebury-report-','', $string);
$name = substr($name,0,10);
return $name;
}
$files = scandir('.');
@woodwardtw
woodwardtw / functions.php
Created June 15, 2022 19:56
messed up river functions
<?php
/**
* UnderStrap functions and definitions
*
* @package UnderStrap
*/
// Exit if accessed directly.
defined( 'ABSPATH' ) || exit;
#intro .intro-inner {
padding: 30px;
}
#main .entry-content p {
font-size: 1.5rem;
}
.intro-special {
padding: 70px;