Skip to content

Instantly share code, notes, and snippets.


mark l chaves marklchaves

View GitHub Profile
selimslab /
Last active Jun 18, 2021 — forked from leoloobeek/
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"]])
webtoffee-git / functions.php
Last active Apr 27, 2021
Add more scripts to the default script blocker list using WebToffee GDPR Cookie Consent plugin
View functions.php
function scripts_list() {
$scripts = array(
'id' => 'googletranslator',
'label' => 'GoogleTranslator',
'key' => array(''),
'category' => 'analytics',
'status' => 'yes'
loilo /
Last active Sep 24, 2021
Back up and restore an IndexedDB database

Back up and restore an IndexedDB database

This gist is an ES module which provides functions to import and export data from an IndexedDB database as JSON. It's based on Justin Emery's indexeddb-export-import package, but applies some adjustments that reflect better on the current browser landscape (i.e. better developer ergonomics but no support for Internet Explorer).


For each of the provided functionalities, you need a connected IDBDatabase instance.

Export Data

import { idb } from 'some-database'
gaearon /
Last active Sep 23, 2021
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:

lupin72 / gist:91b7f744beb0478c805e9a26b504b753
Created Jun 2, 2018
How to block Monterinsights' Google Analytics Cookies with iubenda Cookie Solution for GDPR
View gist:91b7f744beb0478c805e9a26b504b753
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);
basham /
Last active Sep 25, 2021
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

studiopress / nav-extras.php
Last active Jun 3, 2020
Modify the nav extras.
View 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.
rxaviers / gist:7360908
Last active Sep 26, 2021
Complete list of github markdown emoji markup
View gist:7360908


: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: