Skip to content

Instantly share code, notes, and snippets.

View Leland's full-sized avatar
:shipit:
ship't

Leland Clemmons Leland

:shipit:
ship't
View GitHub Profile
@Leland
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="https://player.vimeo.com/video/157320165" frameborder="0" webkitallowfullscreen="" mozallowfullscreen="" allowfullscreen="" data-ratio="NaN" data-width="0" data-height="0" style="display: block; margin: 0px; width: 0px; height: 0px;"></iframe>
</div>
</div>
<!-- No Content width specified; Shortcodes disabled -->
<div class="jetpack-video-wrapper">
<iframe src="https://player.vimeo.com/video/157320165" 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>
@Leland
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
----------------------------------------------------------------------
FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
@Leland
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">
<arguments>
<argument name="block_id" xsi:type="string">replace_with_your_block_id</argument>
</arguments>
</block>
</referenceContainer>
@Leland
Leland / sublime.json
Created July 24, 2017 23:09
Leland's Quite Nifty Sublime Text Configuration 2: Electric Boogaloo
{
"binary_file_patterns":
[
"bower_components/**",
"node_modules/*",
"node_modules/**",
"*.jpg",
"*.jpeg",
"*.png",
"*.gif",
@Leland
Leland / gitflow-breakdown.md
Last active August 1, 2017 01:22 — forked from JamesMGreene/gitflow-breakdown.md
A comparison of using `git flow` commands versus raw `git` commands.

Initialize

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

<?php
return array (
'backend' =>
array (
'frontName' => 'admin',
),
'db' =>
array (
'connection' =>
array (
@Leland
Leland / require-js.md
Created March 9, 2021 21:12
My notes from a Require.js tutorial in Magento 2

Require.js

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.
@Leland
Leland / renameHTML.sh
Created November 16, 2021 18:56
Rename HTML files to their <title>
#!/bin/bash
set -eu -o pipefail
for f in *.html ; do
mv -v "$f" "$(ggrep -oP '<title>\K.+?</title>' "$f" | sed 's#</title>##').html"
done
exit 0