Skip to content

Instantly share code, notes, and snippets.

View Leland's full-sized avatar

Leland Clemmons Leland

View GitHub Profile

Seek inspiration

JUNE 24, 2013


1962 : I was six, at my grandmother’s house, eating pancakes and watching my favorite show on TV. Captain Kangaroo was talking to Mr. Moose about something not quite visible just off the right side of the screen. My grandmother entered the room. She looked at the big console television, tilted her head, and then tweaked the horizontal-position knob. The image shifted a bit to the left, revealing more at the right side. I sat in awe, jaw dropped, gaze transfixed.

When she left the room, I was all over that knob. If you turned it far enough, what would happen? Could you see off the edges of the set? Could you see the cameraman? Could you see yourself? My brain exploded with questions.

Leland /
Created November 16, 2021 18:56
Rename HTML files to their <title>
set -eu -o pipefail
for f in *.html ; do
mv -v "$f" "$(ggrep -oP '<title>\K.+?</title>' "$f" | sed 's#</title>##').html"
exit 0
Leland /
Created March 9, 2021 21:12
My notes from a Require.js tutorial in Magento 2


How the Require.js system works

  • It is a system that allows Javascript on the frontend to be load async

    • The amount of JS that blocks render is fairly small
    • And the remaining JS that's needed can be loaded at a low priority
  • It's also a way to manage dependencies on JS modules

    • Concating every single bit of JS into one big file resolves race conditions, but means that frontend users download a TON of JS.
return array (
'backend' =>
array (
'frontName' => 'admin',
'db' =>
array (
'connection' =>
array (
Leland / sublime.json
Created July 24, 2017 23:09
Leland's Quite Nifty Sublime Text Configuration 2: Electric Boogaloo
Leland / sidebar.xml
Created July 18, 2017 15:35
Add sidebar to Magento 2 CMS page
<referenceContainer name="sidebar.additional">
<block class="Magento\Cms\Block\Block" name="replace_with_your_block_id">
<argument name="block_id" xsi:type="string">replace_with_your_block_id</argument>
Leland /
Last active August 1, 2017 01:22 — forked from JamesMGreene/
A comparison of using `git flow` commands versus raw `git` commands.


gitflow git
git flow init git init
git commit --allow-empty -m "Initial commit"
git checkout -b develop master

Connect to the remote repository

gitflow | git

Leland / output
Created October 18, 2016 15:29
PHPCS Output on FoundationPress commit e2a487f
> foundationpress@2.7.1 phpcs /wp-content/themes/FoundationPress
> gulp phpcs
[11:27:18] Using gulpfile /wp-content/themes/FoundationPress/gulpfile.js
[11:27:18] Starting 'phpcs'...
[11:27:20] PHP Code Sniffer found a problem in /wp-content/themes/FoundationPress/archive.php
FILE: /wp-content/themes/FoundationPress/archive.php
Leland / oembed-comparison.html
Last active March 2, 2016 23:39
Comparison of oEmbed formats
<!-- No Content width specified; Shortcodes enabled -->
<div class="jetpack-video-wrapper">
<div class="embed-vimeo" style="text-align: center;">
<iframe src="" frameborder="0" webkitallowfullscreen="" mozallowfullscreen="" allowfullscreen="" data-ratio="NaN" data-width="0" data-height="0" style="display: block; margin: 0px; width: 0px; height: 0px;"></iframe>
<!-- No Content width specified; Shortcodes disabled -->
<div class="jetpack-video-wrapper">
<iframe src="" frameborder="0" webkitallowfullscreen="" mozallowfullscreen="" allowfullscreen="" data-ratio="0.562" data-width="500" data-height="281" style="display: block; margin: 0px; width: 500px; height: 281px;"></iframe>