Skip to content

Instantly share code, notes, and snippets.

@mishterk
mishterk / 0_reuse_code.js
Created July 9, 2014 01:37
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
@mishterk
mishterk / dabblet.css
Last active August 29, 2015 14:13
The first commented line is your dabblet’s title
/**
* The first commented line is your dabblet’s title
*/
background: #f06;
background: linear-gradient(45deg, #f06, yellow);
min-height: 100%;
@mishterk
mishterk / dabblet.css
Created January 13, 2015 03:45
The first commented line is your dabblet’s title
/**
* The first commented line is your dabblet’s title
*/
background: #f06;
background: linear-gradient(45deg, #f06, yellow);
min-height: 100%;
@mishterk
mishterk / basic-custom-module-recipe.php
Last active November 26, 2016 06:06
Divi hacks, mods, fixes, etc
<?php
add_action( 'et_builder_ready', function () {
class MyCustomModule extends ET_Builder_Module {
function init()
@mishterk
mishterk / interpolation-example.php
Last active January 30, 2017 05:25
A quick example of interpolation in PHP (for Ben)...
<?php
// Quick PHP interpolation example...
class Person {
public $name = '';
public function getName()
{
@mishterk
mishterk / implementation.php
Created March 7, 2017 04:34
Simple examples of static class methods and name-spaced functions
<?php
include 'utility-class.php';
include 'utility-functions.php';
// using a static class method
$processed = UtilityClass::methodOne( 'some data' );
@mishterk
mishterk / generated-style.css
Last active September 29, 2017 02:55
BEM style example
.Post{}
.Post__title{}
.Post__content{}
.Post--is-highlighted .Post__title{} // now we are using the cascade to override styling when that block is at a particular state
@mishterk
mishterk / book-cpt-test.json
Created January 14, 2018 07:04
Some test data. Throw the CPT registration in functions.php
{
"name": "books",
"relationship": {
"type": "post",
"post_type": "book"
},
"columns": [
{
"name": "author",
"acf_field_name": "author"
@mishterk
mishterk / working-with-js.js
Last active February 7, 2018 20:25
iFrames: tricks, reference, etc
// create the iFrame
var iFrame = document.createElement('iframe');
// set iFrame's source
iFrame.src = "javascript:false"; // add some URL here
// inject iFrame into current (parent) doc before first script tag
var where = document.getElementsByTagName('script')[0];
where.parentNode.insertBefore(iFrame, where);
@mishterk
mishterk / example-table-definition-for-post-post-type.json
Created February 20, 2018 18:58
ACF Custom Database Tables plugin: Table definition JSON example for post type of 'post'
{
"name": "post_metadata",
"columns": [
"post_layout",
"read_time",
"show_stats"
]
}