Disabling Gutenberg on certain templates

Using a plugin

The Classic Editor plugin is great for disabling Gutenberg site-wide, but is not a good choice for selectively using it on certain pages.

Gutenberg Ramp lets you disable Gutenberg on a per-post-type basis. You could use Gutenberg for posts, but keep the classic editor for pages.

Using a filter

We can use the use_block_editor_for_post_type filter for more fine-grained control. It passes two parameters:

  • $can_edit, boolean, whether Gutenberg should be used to edit
  • $post_type, string
Read More

Creative Coding with Canvas & WebGL – Course

Learn to use Canvas and WebGL with ThreeJS in this JavaScript course on Creative Coding! Tour the vast landscape of graphics programming on the web. Learn about generative art, interactive animations, 3D graphics with ThreeJS, and custom shaders in GLSL. These are the fundamental concepts behind creative development work, including VR/AR apps, games, art installations, interactive web experiences, and various other forms of computational arts.

This course and others like it are available as part of our Frontend Masters video subscription.

RFS (Responsive Font Size)

Just found out about RFS and it sounds really handy.

Responsive Font Size (RFS) is an engine that automatically calculates and updates the font-size property on elements based on the dimensions of the browser viewport.

It’s compatible with Sass, Less, Stylus and PostCSS, so it plugs into just about any stack. You can compile Bootstrap 4 with it too simply by changing $enable-responsive-font-sizes to true (see below). In BS5 this will be enabled by default. See this CSS Tricks article.

How does it work?

Read More

Watering plants with a Raspberry Pi

Ask HN: What do you do with your Raspberry Pi?

Plant watering

The pi runs a reddit bot that reads the votes, and can switch on a pump to water. It also collects data about sunlight, moisture, temp and humidity to help inform the decision about watering. Despite many people’s preconceptions about the goodness of the internet, I must admit that they do a wonderful job caring for my plant!

website: http://www.takecareofmyplant.com

subreddit w/ voting: http://old.reddit.com/r/takecareofmyplant (also has a lot of info if you want to do it yourself)

Similar project:

Raspberry pi is automatically uploading video of each watering to YouTube (https://www.youtube.com/channel/UCtl442fLi6KAOowkw_w83rA/vid…) and informing me with summary (incl. watering duration, soil moisture level, temperature, humidity, light level etc.).

I’m using a cheap submersible water pump controlled via relay by a python script running on raspberry pi. Water pump is connected to a clear vinyl tube for water distribution to the plant.

Availability of water level at source is checked by a non-contact liquid level sensor.

Triggers for watering plant are defined as follows: 1. There is water in tank / source (checked by non-contact liquid level sensor) 2. Soil moisture level is below certain threshold (measured by 2 soil moisture capacity sensors embedded in the plant) 3. Watering duration is determined by current soil moisture level; Python script activates relay to run the pump for the right duration. 4. Same python script also: – activates camera to record watering (+2s buffer to have all on the video) via usb cam connected to the pi (leveraging opencv lib) – uploads recorded video automatically to youtube channel (if pi has internet connection) – summarizes watering event and sends me notification with link to the recording and other helpful stats (temp, humidity, moisture level etc.) – saves all metrics to sqllite db for future reference

Key parts I ended up using for the project: 1. Water pump: https://www.amazon.com/gp/product/B01LWXV7DE/ref=ppx_yo_dt_b…

2. Non-contact Liquid Level Sensor -XKC-Y25-NPN: https://www.amazon.com/gp/product/B07D3246BH/ref=ppx_yo_dt_b…

3. Gikfun Capacitive Soil Moisture Sensor: https://www.amazon.com/gp/product/B07H3P1NRM/ref=ppx_yo_dt_b…

4. Relay: https://www.amazon.com/KeeYees-Channel-Indicator-Arduino-Ras… (though I just bought my when visiting Fry’s)