Skip to content

Instantly share code, notes, and snippets.

View marklchaves's full-sized avatar
🏄‍♂️

mark l chaves marklchaves

🏄‍♂️
View GitHub Profile
@rxaviers
rxaviers / gist:7360908
Last active May 19, 2025 08:41
Complete list of github markdown emoji markup

People

:bowtie: :bowtie: 😄 :smile: 😆 :laughing:
😊 :blush: 😃 :smiley: ☺️ :relaxed:
😏 :smirk: 😍 :heart_eyes: 😘 :kissing_heart:
😚 :kissing_closed_eyes: 😳 :flushed: 😌 :relieved:
😆 :satisfied: 😁 :grin: 😉 :wink:
😜 :stuck_out_tongue_winking_eye: 😝 :stuck_out_tongue_closed_eyes: 😀 :grinning:
😗 :kissing: 😙 :kissing_smiling_eyes: 😛 :stuck_out_tongue:
@studiopress
studiopress / nav-extras.php
Last active September 11, 2023 21:24
Modify the nav extras.
<?php
//* Do NOT include the opening php tag shown above. Copy the code shown below.
add_filter( 'wp_nav_menu_items', 'theme_menu_extras', 10, 2 );
/**
* Filter menu items, appending either a search form or today's date.
*
* @param string $menu HTML string of list items.
* @param stdClass $args Menu arguments.
*
@basham
basham / css-units-best-practices.md
Last active March 10, 2025 20:57
CSS Units Best Practices

CSS units

Recommendations of unit types per media type:

Media Recommended Occasional use Infrequent use Not recommended
Screen em, rem, % px ch, ex, vw, vh, vmin, vmax cm, mm, in, pt, pc
Print em, rem, % cm, mm, in, pt, pc ch, ex px, vw, vh, vmin, vmax

Relative units

Relative units

@danieliser
danieliser / custom.js
Last active July 14, 2022 22:58
Use this to convert form values into a url, then change the iFrame src inside a Popup Maker popup, before opening the popup.
(function ($, document) {
// Customize these variables.
// ----------------------------------
var popupID = 123,
form = $('#form'),
// ------------------------------
// End Customizations.
baseURL = form.attr('action'),
popup = $('#pum-' + popupID),
iframe = popup.find('iframe').eq(0);
@lupin72
lupin72 / gist:91b7f744beb0478c805e9a26b504b753
Created June 2, 2018 15:33
How to block Monterinsights' Google Analytics Cookies with iubenda Cookie Solution for GDPR
function block_monsterinsights_cookies($attr) {
$attr['type'] = "text/plain";
$attr['class'] = '_iub_cs_activate';
return $attr;
}
add_filter('monsterinsights_tracking_analytics_script_attributes', 'block_monsterinsights_cookies', 10);
@gaearon
gaearon / minification.md
Last active January 28, 2025 19:19
How to Set Up Minification

In production, it is recommended to minify any JavaScript code that is included with your application. Minification can help your website load several times faster, especially as the size of your JavaScript source code grows.

Here's one way to set it up:

  1. Install Node.js
  2. Run npm init -y in your project folder (don't skip this step!)
  3. Run npm install terser

Now, to minify a file called like_button.js, run in the terminal:

/**
* Export all data from an IndexedDB database
*
* @param {IDBDatabase} idbDatabase The database to export from
* @return {Promise<string>}
*/
export function exportToJson(idbDatabase) {
return new Promise((resolve, reject) => {
const exportObject = {}
if (idbDatabase.objectStoreNames.length === 0) {
@webtoffee-git
webtoffee-git / functions.php
Last active December 9, 2022 14:10
Add more scripts to the default script blocker list using WebToffee GDPR Cookie Consent plugin
function scripts_list() {
$scripts = array(
array(
'id' => 'googletranslator',
'label' => 'GoogleTranslator',
'key' => array('translate.google.com/translate_a/element.js'),
'category' => 'analytics',
'status' => 'yes'
),
);
@selimslab
selimslab / get_gists.py
Last active December 23, 2023 15:52 — forked from leoloobeek/get_gists.py
Download all gists of a user
import sys
from subprocess import call
import json
import os
import requests
def download_gists(gists: list):
for gist in gists:
call(["git", "clone", gist["git_pull_url"]])
@marklchaves
marklchaves / popup_name_sc.php
Last active September 29, 2022 22:38
Make a shortcode for a popup's name (not the title)
<?php // Ignore this first line when copying to your child theme's functions.php file.
/**
* Make a shortcode for a popup's name (not the title)
*
* Note: The popup's internal name is actually the CPT's title.
* The internal name is different from the popup's title.
*
* The popup's title is optional. If you enter a popup title,
* it displays as the heading of your popup (external title).