Skip to content

Instantly share code, notes, and snippets.

View JoeSz's full-sized avatar

Joe JoeSz

View GitHub Profile
@JoeSz
JoeSz / jQueryPluginPatterns.js
Created July 5, 2019 08:00 — forked from addyosmani/jQueryPluginPatterns.js
jQuery Plugin Patterns
/*
A (very) WIP collection of optimized/recommended jQuery plugin patterns
from @addyosmani, @cowboy, @ajpiano and others.
Disclaimer:
-----------------------
Whilst the end-goal of this gist is to provide a list of recommended patterns, this
is still very much a work-in-progress. I am not advocating the use of anything here
until we've had sufficient time to tweak and weed out what the most useful patterns
@JoeSz
JoeSz / is_rest.php
Created March 1, 2019 16:24 — forked from matzeeable/is_rest.php
Checks if the current request is a WP REST API request.
<?php
if (!function_exists('is_rest')) {
/**
* Checks if the current request is a WP REST API request.
*
* Case #1: After WP_REST_Request initialisation
* Case #2: Support "plain" permalink settings
* Case #3: URL Path begins with wp-json/ (your REST prefix)
* Also supports WP installations in subfolders
*
@JoeSz
JoeSz / regexCheatsheet.js
Created January 15, 2019 07:53 — forked from sarthology/regexCheatsheet.js
A regex cheatsheet 👩🏻‍💻 (by Catherine)
let regex;
/* matching a specific string */
regex = /hello/; // looks for the string between the forward slashes (case-sensitive)... matches "hello", "hello123", "123hello123", "123hello"; doesn't match for "hell0", "Hello"
regex = /hello/i; // looks for the string between the forward slashes (case-insensitive)... matches "hello", "HelLo", "123HelLO"
regex = /hello/g; // looks for multiple occurrences of string between the forward slashes...
/* wildcards */
regex = /h.llo/; // the "." matches any one character other than a new line character... matches "hello", "hallo" but not "h\nllo"
regex = /h.*llo/; // the "*" matches any character(s) zero or more times... matches "hello", "heeeeeello", "hllo", "hwarwareallo"
@JoeSz
JoeSz / index.html
Created September 23, 2018 18:54 — forked from CodeMyUI/index.html
Material Design - Transformation
<div class="wrapper">
<div class="content">
<div class="img"></div>
<div class="text">
<div class="line title"></div>
<div class="line subtitle"></div>
</div>
</div>
</div>

Highlight keywords of text on hover

Just a little experiment. When hovering over the article with your mouse, some keywords from the text should be easy readable while the rest should be darker.

A Pen by Bas Groothedde on CodePen.

License.

@JoeSz
JoeSz / blog-cards.markdown
Created September 23, 2018 18:50 — forked from CodeMyUI/blog-cards.markdown
Blog Cards
@JoeSz
JoeSz / wp-query-ref.php
Created September 17, 2018 20:13 — forked from luetkemj/wp-query-ref.php
WP: Query $args
// This gist is now maintained on github at https://github.com/luetkemj/wp-query-ref
<?php
/**
* WordPress Query Comprehensive Reference
* Compiled by luetkemj - luetkemj.github.io
*
* CODEX: http://codex.wordpress.org/Class_Reference/WP_Query#Parameters
* Source: https://core.trac.wordpress.org/browser/tags/4.9.4/src/wp-includes/query.php
*/
@JoeSz
JoeSz / plugin_boilerplate.php
Created August 29, 2018 08:08
Singleton Plugin Boilerplate
<?php
/**
* Main MyPlugin Class.
*
* @class MyPlugin
* @version 1.0.0
*
* @link http://disq.us/p/16xxdcj
*/