Weekly Web Harvest for 2018-03-11

Candace Jean Andersen on Twitter: “Hey Twitter I’m on a mission: The woman in this photo was an attendee at a 1971 International Conference on Biology of Whales. She is the only woman, & the only one captioned “not identified” in the article I found the p Pretty wild to watch this kind of research play out on Twitter. Temporary Autonomous Zone – Wikipedia It is composed of three sections, “Chaos: The Broadsheets of Ontological Anarchism,” “Communiques of the Association for Ontological Anarchy,” and “The Temporary Autonomous Zone.” –h/t Doug Belshaw MOSQUITO attack allows to exfiltrates data from Air-Gapped computers via leverage connected speakersSecurity Affairs Once again the team demonstrated that separating the computer networks from the Internet is not enough to protect them from attackers. In the past, the same group of researchers demonstrated that it possible to listen to private conversations by reversing headphones connected to a previously infected computer. The MOSQUITO technique establishes a covert ultrasonic transmission between two air-gapped computers using speaker-to-speaker communication. In Britain’s Playgrounds, ‘Bringing in Risk’ to Build Resilience – The New York Times — Ever feel like everything is just a stupid cycle of doom? Educators in Britain, after decades spent in a collective effort to minimize risk, are now, cautiously, getting into the business of providing it. Four years ago, for instance, teachers at […]

H5P embed advanced options showing the dynamic sizing script option.

H5P Default Dynamic Sizing

If you’re running the H5P plugin in WordPress, you might notice that there’s an advanced settings option when you go to embed it. If you click on that you’ll see an additional script to add to enable dynamic sizing of embedded H5P content. I wanted that but that option doesn’t make much sense in our environment. If you read this blog a lot and have an amazing memory, you’ll know I have a plugin that’s network activated where I put little things that make sense but don’t need their own dedicated plugin. This seemed like one that fits that bill. It’s really simple. It asks if the site is running H5P and if the answer is yes, it enqueues the h5p-resizer.js.


Photography – #164

Starbucks mermaid A post shared by @ twwoodward on Mar 8, 2018 at 4:46pm PST #subgenius A post shared by @ twwoodward on Mar 11, 2018 at 12:03pm PDT


Follow the Cursor Arrows in Javascript

Matt came up with a really interesting visual idea where arrows follow the cursor. He found this codepen example which was pretty close to what he envisioned (only with pill shapes). The problem was that this version used Babel, jQuery, and Underscore. That’s good if you know all those pieces but less good if you don’t. I don’t. Could I do this with just plain javascript? Make the Boxes First, I didn’t want to cut and paste a whole bunch of divs (or use pug) so I figured javascript should make them. Since I think I’m funny my arrow boxes are in the arrow class and the div they’re inserted before has the id quiver. I’m making 300 boxes in this example and the CSS sets the arrows as background images. Watch the Cursor This bit watches the body element for the mouse move. The cursorFinder piece gets the X and Y coordinates of the mouse. In this case, we’re also spitting it out at the bottom of the page so we can see what’s going on. It’s pretty much from the W3 example. Now that we can see where the mouse is we need to tilt the divs based on where they are and where the mouse is. Tilting the Divs First, we have to get all the arrow […]

Four people wandering up a large sand dune with a blue sky and some clouds.

WordPress Avoid Running save_post Functions on Trashed Posts

This may be one of those things that everyone knows but it was new to me. I’m also duplicating the information I found in the StackOverflow post because I think it’s good to have information in multiple places where it might be found by other people. Additionally, writing the post makes it easy for me to find later when I forget and the act of writing the post helps get it stuck in my own head. With all of that as the lead up . . . A common way to trigger events in WordPress is the save_post action. It runs any time the post is created, published, or updated. What I found out though was that it also runs when you try to delete the post. That makes sense. It is an update and it’s no big deal if the function is relatively small and/or if you’re not trying to get rid of a ton of posts. My current experiment had both a fairly involved function and a couple hundred posts I wanted deleted. Luckily, I found this post on StackOverflow. Now I can set a simple check at the beginning of the function that looks to make sure it’s the right post type (site) and it’s a trashed post. In either of those cases the function gets skipped.


Weekly Web Harvest for 2018-03-04

Promisees · Courtesy of ponyfoo.com Inside Einstein’s head – an explorable explanation of relativistic spacetime The Disconnect – Issue One Please Disconnect from the Internet. This is an offline-only magazine of commentary, fiction, and poetry. Just disable your WiFi to view this issue. Rage against the machine: self-driving cars attacked by angry Californians | Technology | The Guardian The two human-on-robot assaults are not the first time San Franciscans have fought back – physically – against robots. In December, the local SPCA animal shelter removed its 400lb Knightscope security robot from the streets around its building amid backlash from residents and the homeless population who complained the robot was harassing them. While most residents simply complained about the robot’s presence, one person reportedly “put a tarp over it, knocked it over and put barbecue sauce on all the sensors”. The Wire, 10 years on: ‘We tore the cover off a city and showed the American dream was dead’ | Television & radio | The Guardian Greek tragedy for the new millennium,” with sclerotic institutions playing the role of callous, indifferent gods AllSides Bias Rating (ABR) – AllSides –ripe for all kinds of issues The AllSides patented bias detection and display technology drives arguably the world’s most effective and up-to-date bias detection engine. It’s powered by a combination of wisdom-of-the-crowd technology […]


Google Script – Plain Text

Google Sheets often thinks it’s smarter than you. That’s helpful at times and irritating at other times.1 The Google Form to Sheets path is one place where that can come up repeatedly and in ways that are hard to see. For instance, if you use the Time entry on forms, Google Sheets tries to coerce it into a date structure while leaving you seeing just the time in the sheets view. That leads to weird and unpredictable stuff if you’re trying to use Google Scripts to interact with that cell data based on what you see. For instance, this is data from the time entry field as seen on the sheet side. Note the two places you might expect to see truth. Now if we get that same data via Google Script . . . Cell data that you’d expect to just be that time element returns as Sat Dec 30 1899. The time is right though. If you manually change the format of that column to plain text things work . . . but it gets re-set on all subsequent submissions. My solution so far has been the following Google Script set to fire on every new form submission. In my case, I’m changing the format of the latest entry in the spreadsheet in columns F and G to […]


jQuery & the WordPress Rest API – 1st Image as Background

Ordinarily it’s pretty easy to get the featured image from the WordPress API. You just have to remember to add the _embed element like so https://bionicteaching.com/wp-json/wp/v2/posts?_embed But maybe there’s some reason you don’t want to set the featured image but want to get the first image from the body of the post. This chunk of so very uncool jQuery gets the JSON data and finds the first img src URL in the post body. I’ve gone over the basic pieces previously so here’s the portion that differs. It’s just regex searching for anything with the img src pattern and spitting back out the URL. See the Pen antonio – jquery demo by Tom (@twwoodward) on CodePen.


Weather API + Google Sheets

I have many little robot scripts busy saving data to Google Sheets. Here’s one I made based on a little comment from one of my kid’s teachers. It goes to a very kind URL that returns the data structure at the bottom of the page. http://api.wunderground.com/api/YOUR_API_KEY/conditions/q/VA/Richmond.json It’s a pretty nice starter script for anyone wanting to play with an API and Google Scripts. The full Google Script is below and I’ve tried to comment it up pretty thoroughly. I’ll also break it down below for those of you who want to play at home. Get the Data The first variable ‘url’ is the API endpoint we’re getting the data from. Where it says YOUR_API_KEY, you should put your API Key. I recall early on trying to do this stuff I’d get confused when people did different things to indicate that an API Key should go somewhere. People would put it in quotes or surrounded by asterisk or something else. I’d end up confused about what should go there because I had no baseline to judge this against. It’s fairly obvious now but I haven’t forgotten that feeling of basic confusion. Sometimes it helps to be very basic. Google has a nice UrlFetchApp class that you use in Google Script instead of fetch like you’d use in vanilla javascript land. Since […]


Weekly Web Harvest for 2018-02-25

Mitigation of Shock: 6 Steps (with Pictures) The project transports you into a London flat, thirty five years in the future. A future where extreme weather has caused global supply chains to falter. Everyday items are often either out of stock or have become expensive luxuries. In response, living space has been increasingly given over to experimental forms of domestic agriculture. Food computers have been improvised from the detritus of a technological utopia that never quite arrived. apache/incubator-superset: Apache Superset (incubating) is a modern, enterprise-ready business intelligence web application h/t Downes Plotting the Course Through Charted Waters Heat maps, stacked area plots, mosaic plots, choropleths – oh my! There are so many different ways to visually convey relationships and patterns in data! In this workshop on data visualization literacy, you’ll learn to recognize many popular types of charts and how to glean insights from them. The Appendix contains some examples of data visualization as visual essays and it also includes links to resources for learning how to create your own.