Skip to content

Instantly share code, notes, and snippets.

Avatar

Phil Kurth mishterk

View GitHub Profile
@mishterk
mishterk / 0_reuse_code.js
Created Jul 9, 2014
Here are some things you can do with Gists in GistBox.
View 0_reuse_code.js
// 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
Created Jan 13, 2015
The first commented line is your dabblet’s title
View dabblet.css
/**
* The first commented line is your dabblet’s title
*/
background: #f06;
background: linear-gradient(45deg, #f06, yellow);
min-height: 100%;
@mishterk
mishterk / dabblet.css
Last active Aug 29, 2015
The first commented line is your dabblet’s title
View dabblet.css
/**
* 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 Nov 26, 2016
Divi hacks, mods, fixes, etc
View basic-custom-module-recipe.php
<?php
add_action( 'et_builder_ready', function () {
class MyCustomModule extends ET_Builder_Module {
function init()
@mishterk
mishterk / interpolation-example.php
Last active Jan 30, 2017
A quick example of interpolation in PHP (for Ben)...
View interpolation-example.php
<?php
// Quick PHP interpolation example...
class Person {
public $name = '';
public function getName()
{
@mishterk
mishterk / implementation.php
Created Mar 7, 2017
Simple examples of static class methods and name-spaced functions
View implementation.php
<?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 Sep 29, 2017
BEM style example
View generated-style.css
.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 Jan 14, 2018
Some test data. Throw the CPT registration in functions.php
View book-cpt-test.json
{
"name": "books",
"relationship": {
"type": "post",
"post_type": "book"
},
"columns": [
{
"name": "author",
"acf_field_name": "author"
@mishterk
mishterk / working-with-js.js
Last active Feb 7, 2018
iFrames: tricks, reference, etc
View working-with-js.js
// 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 Feb 20, 2018
ACF Custom Database Tables plugin: Table definition JSON example for post type of 'post'
View example-table-definition-for-post-post-type.json
{
"name": "post_metadata",
"columns": [
"post_layout",
"read_time",
"show_stats"
]
}
You can’t perform that action at this time.