Skip to content

Instantly share code, notes, and snippets.

Avatar
:shipit:
ship't

Leland Clemmons Leland

:shipit:
ship't
View GitHub Profile
@Leland
Leland / require-js.md
Created Mar 9, 2021
My notes from a Require.js tutorial in Magento 2
View require-js.md

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.
View env.php
<?php
return array (
'backend' =>
array (
'frontName' => 'admin',
),
'db' =>
array (
'connection' =>
array (
@Leland
Leland / sublime.json
Created Jul 24, 2017
Leland's Quite Nifty Sublime Text Configuration 2: Electric Boogaloo
View sublime.json
{
"binary_file_patterns":
[
"bower_components/**",
"node_modules/*",
"node_modules/**",
"*.jpg",
"*.jpeg",
"*.png",
"*.gif",
@Leland
Leland / sidebar.xml
Created Jul 18, 2017
Add sidebar to Magento 2 CMS page
View sidebar.xml
<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 / gitflow-breakdown.md
Last active Aug 1, 2017 — forked from JamesMGreene/gitflow-breakdown.md
A comparison of using `git flow` commands versus raw `git` commands.
View gitflow-breakdown.md

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

@Leland
Leland / output
Created Oct 18, 2016
PHPCS Output on FoundationPress commit e2a487f
View output
> 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 / oembed-comparison.html
Last active Mar 2, 2016
Comparison of oEmbed formats
View oembed-comparison.html
<!-- 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>