Skip to content

Instantly share code, notes, and snippets.

View coryzibell's full-sized avatar

Cory Zibell coryzibell

View GitHub Profile

Keybase proof

I hereby claim:

  • I am coryzibell on github.
  • I am coryzibell (https://keybase.io/coryzibell) on keybase.
  • I have a public key ASADyJKhSLyy2GBwj5mnMnFCOzvN4sm95Xi3FUA78NmTZgo

To claim this, I am signing this object:

* {
vertical-align: baseline;
font-weight: inherit;
font-family: inherit;
font-style: inherit;
font-size: 100%;
border: 0 none;
outline: 0;
padding: 0;
margin: 0;
@coryzibell
coryzibell / Markdium-Hack.php
Created May 14, 2019 16:07
Markdium-CraftCMS 3 - Modules and Plugins
Important to note that here we are using a fully qualified namespace to prevent conflicts with other plugins.
So, What Should I Use?
There are three questions that will influence whether or not you should build a plugin or a module:
Can your code be used on other projects? If so, build a plugin.
If the answer to this is yes, you should probably build a plugin. Creating a plugin means you can release it in the plugin store and benefit the community at large, or make money from it. Even if you only use the plugin for yourself or your organization, it's still valuable having portable functionality that can be used in multiple places.
@coryzibell
coryzibell / Markdium-Hack.php
Created May 14, 2019 16:07
Markdium-CraftCMS 3 - Modules and Plugins
This code example is extremely simplified, and is just meant to illustrate that craft is included with a use statement, but not extended.
Plugins
Plugins are extensions on modules. They include all the functionality of modules. Additionally, there is no need to manually include them in composer.json or bootstrap them in the application configuration. Craft handles that. They include the following functionality on top of modules:
Settings: Plugins have a simple settings architecture that allows developers to store settings in the database, and have users access them in the Admin Control Panel, without the developer needing to manually create those views and records.
Installation tracking: Plugins exist as composer packages, but additionally can exist within the CraftCMS plugin store. A plugin can be:
Disabled (exists in the composer dependencies, but is not bootstrapped by Craft)
Installed (exists on the composer dependencies, and is bootstrapped by Craft)
@coryzibell
coryzibell / Markdium-Hack.php
Created May 14, 2019 16:04
Markdium-CraftCMS 3 - Modules and Plugins
This code example is extremely simplified, and is just meant to illustrate that craft is included with a use statement, but not extended.
Plugins
Plugins are extensions on modules. They include all the functionality of modules. Additionally, there is no need to manually include them in composer.json or bootstrap them in the application configuration. Craft handles that. They include the following functionality on top of modules:
Settings: Plugins have a simple settings architecture that allows developers to store settings in the database, and have users access them in the Admin Control Panel, without the developer needing to manually create those views and records.
Installation tracking: Plugins exist as composer packages, but additionally can exist within the CraftCMS plugin store. A plugin can be:
Disabled (exists in the composer dependencies, but is not bootstrapped by Craft)
Installed (exists on the composer dependencies, and is bootstrapped by Craft)
@coryzibell
coryzibell / Markdium-Hack.php
Created May 14, 2019 16:04
Markdium-CraftCMS 3 - Modules and Plugins
Important to note that here we are using a fully qualified namespace to prevent conflicts with other plugins.
So, What Should I Use?
There are three questions that will influence whether or not you should build a plugin or a module:
Can your code be used on other projects? If so, build a plugin.
If the answer to this is yes, you should probably build a plugin. Creating a plugin means you can release it in the plugin store and benefit the community at large, or make money from it. Even if you only use the plugin for yourself or your organization, it's still valuable having portable functionality that can be used in multiple places.
@coryzibell
coryzibell / named-accessible-color-pairs.js
Created March 27, 2019 23:48
Named Accessible Color Pairs
// This array was created by taking all the named css colors, and putting them through this awesome tool:
// https://cloudflare.design/color/ (https://github.com/cloudflare-design/color)
// With WCAG Level AA settings to find accessible, named, CSS colors.
const namedAccessibleColors = [
[ 'aliceblue', 'black' ],
[ 'aliceblue', 'blue' ],
[ 'aliceblue', 'blueviolet' ],
[ 'aliceblue', 'brown' ],
[ 'aliceblue', 'crimson' ],

Keybase proof

I hereby claim:

  • I am coryzibell on github.
  • I am coryzibell (https://keybase.io/coryzibell) on keybase.
  • I have a public key ASAyCHQyMsk96YDa4otH5y6jmAvOSKeKprrrM83SaNgZuwo

To claim this, I am signing this object:

@coryzibell
coryzibell / craftcms_states.json
Created November 1, 2018 14:54
CraftCMS State Dropdown Database Field Value
{"options":[{"label":"Alabama","value":"AL","default":""},{"label":"Alaska","value":"AK","default":""},{"label":"American Samoa","value":"AS","default":""},{"label":"Arizona","value":"AZ","default":""},{"label":"Arkansas","value":"AR","default":""},{"label":"California","value":"CA","default":""},{"label":"Colorado","value":"CO","default":""},{"label":"Connecticut","value":"CT","default":""},{"label":"Delaware","value":"DE","default":""},{"label":"District Of Columbia","value":"DC","default":""},{"label":"Federated States Of Micronesia","value":"FM","default":""},{"label":"Florida","value":"FL","default":""},{"label":"Georgia","value":"GA","default":""},{"label":"Guam","value":"GU","default":""},{"label":"Hawaii","value":"HI","default":""},{"label":"Idaho","value":"ID","default":""},{"label":"Illinois","value":"IL","default":""},{"label":"Indiana","value":"IN","default":""},{"label":"Iowa","value":"IA","default":""},{"label":"Kansas","value":"KS","default":""},{"label":"Kentucky","value":"KY","default":""},{"
@coryzibell
coryzibell / states_hash.json
Created June 21, 2017 19:27 — forked from mshafrir/states_hash.json
US states in JSON form
{
"AL": "Alabama",
"AK": "Alaska",
"AS": "American Samoa",
"AZ": "Arizona",
"AR": "Arkansas",
"CA": "California",
"CO": "Colorado",
"CT": "Connecticut",
"DE": "Delaware",