Skip to content

Instantly share code, notes, and snippets.

View elisco-latour's full-sized avatar
🏠
Working from home

Eli elisco-latour

🏠
Working from home
View GitHub Profile
/**
* 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) {
@chrismccoy
chrismccoy / gutenberg.txt
Last active September 26, 2025 12:19
Gutenberg Resources
Eliminate All Blocks from Editor
wp.data.dispatch( 'core/block-editor' ).resetBlocks([]);
How to Use WordPress Block Builder to Create Custom Page Layouts Easily
https://www.webfactoryltd.com/blog/how-to-use-wordpress-block-builder-to-create-custom-page-layouts-easily/
How to Extend or Create Variations for WordPress Blocks
https://getbutterfly.com/how-to-extend-or-create-variations-for-wordpress-blocks/
How to disable and lock Gutenberg blocks
@heyalexej
heyalexej / pytz-time-zones.py
Created November 16, 2016 09:14
list of pytz time zones
>>> import pytz
>>>
>>> for tz in pytz.all_timezones:
... print tz
...
...
Africa/Abidjan
Africa/Accra
Africa/Addis_Ababa
Africa/Algiers
@PurpleBooth
PurpleBooth / README-Template.md
Last active March 12, 2026 19:44
A template to make good README.md

Project Title

One Paragraph of project description goes here

Getting Started

These instructions will get you a copy of the project up and running on your local machine for development and testing purposes. See deployment for notes on how to deploy the project on a live system.

Prerequisites

@staltz
staltz / introrx.md
Last active March 10, 2026 03:48
The introduction to Reactive Programming you've been missing
@kamilogorek
kamilogorek / wait-for-images.js
Created February 5, 2014 08:49
Wait for all images to load before executing callback
'use strict';
module.exports = function (element, callback) {
var allImgsLength = 0;
var allImgsLoaded = 0;
var allImgs = [];
var filtered = Array.prototype.filter.call(element.querySelectorAll('img'), function (item) {
if (item.src === '') {
return false;
@Ceekay0
Ceekay0 / single.php
Last active July 21, 2021 04:36
Wordpress: Show related posts by tag. The tag the snippet is looking for needs to be setup in the WP admin interface using the custom value keyword = your_tag Output is as unordered list with links. Snippet is fully i8n compatible You can use this in any Wordpress Template, not just single.php
<?php
/** SHOW RELATED POSTS BY TAG, TAG IS INDICATED BY CUSTOM PROPERTY keyword => tag **/
/** check for custom property **/
$key = 'keyword';
$keyword = get_post_meta($post->ID, $key, true);
if ($keyword != '') {
/** set max number of posts **/
$num_posts = '4';
/** setup the query array **/