Skip to content

Instantly share code, notes, and snippets.

View MatthewEppelsheimer's full-sized avatar

Matthew Eppelsheimer MatthewEppelsheimer

View GitHub Profile
@MatthewEppelsheimer
MatthewEppelsheimer / enable-back-end-tablepress-shortcodes.php
Last active August 28, 2015 16:50
Enable TablePress shortcodes in WordPress' administrative back-end
<?php
/**
* Support TablePress shortcodes in the administrative back-end
*
* Hook to `admin_init`.
*
* @author Matthew Eppelsheimer
*/
function rli_support_tablepress_shortcodes_in_admin() {
@MatthewEppelsheimer
MatthewEppelsheimer / get_post_thumbnail_without_dimensions.php
Created September 11, 2015 17:56
Return a WordPress image thumbnail without image dimensions
/**
* Get an HTML img element representing an image attachment
* Based on wp_get_attachment_image(), without height and width.
*
* While $size will accept an array, it is better to register a size with
* add_image_size() so that a cropped version is generated. It's much more
* efficient than having to find the closest-sized image and then having the
* browser scale down the image.
*
* @since 2.0

Keybase proof

I hereby claim:

  • I am mattheweppelsheimer on github.
  • I am mattepp (https://keybase.io/mattepp) on keybase.
  • I have a public key ASA_tiocasAaFuFN0-RMDvcnHHVRNbVJe_qQSRPi02IQvQo

To claim this, I am signing this object:

@MatthewEppelsheimer
MatthewEppelsheimer / what-is-software-architecture.md
Created August 15, 2018 22:34
EARLY DRAFT: What is Software Architecture Really

inbox / things to add to this:

  • Consider your “distribution boundaries”. Are you gluing separate components together? Be aware of performance tradeoffs for monolithic vs distributed systems. source.
    • “Every remote call travels on the cyber equivalent of a horse and carriage.”
  • How fine/coarse-grained are your interfaces? The more distributed, the coarser your interfaces should be
    • “All sorts of places in the system will change shape to minimize remote calls.”
  • Introduce public vs private methods.
  • Conflict between REST structural model and the need for “coarse-grained” interfaces at remote boundaries.
    • The “remote facade” pattern (same source) is a way to work around this: Certain objects that explicitly (unavoidably, to anyone using them)
@MatthewEppelsheimer
MatthewEppelsheimer / parse-caught-error.ts
Last active December 9, 2021 19:38
TypeScript function to extract message from an error of unknown type, useful in catch blocks UNTESTED
/**
* Detect type of caught error and return its message, optionally running type-specific callbacks
*
* @example
* catch (err) {
* const { message } = parseCaughtError(err);
* console.log(message);
* }
*
* @NOTE Returns an option, to ease iterating to return other properties when needed e.g. stack