Skip to content

Instantly share code, notes, and snippets.

@strarsis
strarsis / guide.md
Last active Feb 4, 2021
Object caching with Bedrock (and Trellis) using Redis
View guide.md

Object caching with Bedrock (and Trellis) using Redis

What is object caching

While nginx microcaching already solves page caching (as of static, rarely changing WordPress pages), the performance for dynamically generated pages (like WooCommerce shop pages and admin backend in general) can benefit greatly from additionally using an object cache. Object caching allows an application (in this case WordPress with its plugins, theme, etc.) to store prepared objects (mostly database queries) in a database and quickly retrieve them, therefore improving the performance of dynamic page generation. Object caching is (usually) transparent, which means that it shouldn't be noticeable by users and developers (except for the performance improvements of course).

Implementations

View bottom-right-negative.svg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View gist:fabc09512eb1771a43a51263b8282fd9
Note: There is a new library as successor to TCPDF, but not everyone already uses it or migrated to it.
Clone the TCPD repository (https://github.com/tecnickcom/TCPDF)
Invoke the PHP command line script `./tools/tcpdf_addfont.php` to convert fonts.
@strarsis
strarsis / instructions.md
Last active Jan 24, 2021
Realtek Gigabyte mainboard HD Audio driver (missing/unailable Realtek HD Audio manager on Windows 10)
View instructions.md

Problem

The Realtek HD Audio manager isn't available on a recent (end 2020) Windows 10 system. The Realtek Audio chipset is on a Gigabyte mainboard.

Solution

  1. Install the Realtek HD Audio driver from Gigabyte, not from official Realtek site. Note: There is no universal Realtek driver (yet), there is an unofficial one on GitHub though, but its installation requires multiple steps, system files/settings modifications, etc. Installation may require one or two subsequent reboots, first the setup uninstalls the existing/old/incorrect Realtek Audrio drivers, then reboots and the setup automatically starts itself (be patient!) after rebooting and logging in to install the new driver.
@strarsis
strarsis / max_width_email.html
Created Sep 25, 2020 — forked from elidickinson/max_width_email.html
Email Template trick: max-width with outlook
View max_width_email.html
<!--[if mso]>
<center>
<table><tr><td width="580">
<![endif]-->
<div style="max-width:580px; margin:0 auto;">
<p>This text will be centered and constrained to 580 pixels even on Outlook which does not support max-width CSS</p>
</div>
<!--[if mso]>
@strarsis
strarsis / datetime.js
Created Jul 2, 2020
Complied DateTime.ts from Litepicker
View datetime.js
var DateTime = /** @class */ (function () {
function DateTime(date, format, lang) {
if (date === void 0) { date = null; }
if (format === void 0) { format = null; }
if (lang === void 0) { lang = 'en-US'; }
if (format) {
this.dateInstance = (DateTime.parseDateTime(date, format, lang));
}
else if (date) {
this.dateInstance = (DateTime.parseDateTime(date));
@strarsis
strarsis / spec.json
Last active May 30, 2020
OpenAPI Generator issue reproducing JSON
View spec.json
{
"openapi": "3.0.0",
"info": {
"title": "Test REST-API",
"version": "1.0"
},
"servers": [
{
"url": "https://api.example.com/v1"
}
View down.svg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View gist:d9fb0329e0b313f4d00b2ec53f11eaa8
Complete name : input.mp4
Format : MPEG-4
Format profile : Base Media / Version 2
Codec ID : mp42 (mp42/mp41/isom/avc1)
File size : 7,07 MiB
Duration : 20s 160 ms
Overall bit rate : 2 943 kb/s
Encoded date : UTC 2017-06-20 10:37:33
Tagged date : UTC 2017-06-20 10:37:33
View bow-contures.svg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.