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
@elisco-latour
elisco-latour / snake_game_pygame
Last active November 28, 2025 08:11
Python Snake Game - PyGame Version
"""
SNAKE GAME - PYGAME VERSION
A graphical implementation of the classic Snake game using Pygame.
Controls: Arrow Keys to move, Q or ESC to quit
"""
import pygame
import random
import sys
import json
import argparse
import sys
def compare_json(obj1, obj2, path=""):
"""
Recursively compares two JSON objects (Python dicts/lists) and returns a list of differences.
Args:
obj1: The first Python object (dict or list).
@elisco-latour
elisco-latour / pytz-time-zones.py
Created May 23, 2021 12:05 — forked from heyalexej/pytz-time-zones.py
list of pytz time zones
>>> import pytz
>>>
>>> for tz in pytz.all_timezones:
... print tz
...
...
Africa/Abidjan
Africa/Accra
Africa/Addis_Ababa
Africa/Algiers
@elisco-latour
elisco-latour / idb-backup-and-restore.md
Created March 25, 2021 21:22 — forked from loilo/idb-backup-and-restore.js
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).

Usage

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

Export Data

import { idb } from 'some-database'
@elisco-latour
elisco-latour / wait-for-images.js
Created February 1, 2021 06:18 — forked from kamilogorek/wait-for-images.js
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;
@elisco-latour
elisco-latour / gutenberg.txt
Created November 7, 2020 14:07 — forked from chrismccoy/gutenberg.txt
Gutenberg Resources
Using Markdown and Localization in the WordPress Block Editor
https://css-tricks.com/using-markdown-and-localization-in-the-wordpress-block-editor/
Gutenberg blocks: Add custom default class names
https://poolghost.com/add-custom-default-class-names-to-gutenberg-blocks/
How to Create a Simple Gutenberg Block Pattern in WordPress
https://speckyboy.com/create-simple-gutenberg-block-pattern-wordpress/
WordPress Block Patterns Resource List
@elisco-latour
elisco-latour / envoi_mail.php
Last active October 2, 2020 15:51
Envoyer un mail avec php
<?php
// Pour comprendre mieux ce code
// aller sur le lien suivant: https://www.php.net/manual/fr/function.mail.php
// Meme le code en dessous provient de la documentation officielle
// Recuperer la valeur du champ fname du formulaire
$fname = htmlspecialchars($_POST["fname"])';
// Recuperer la valeur du champ lname du formulaire
$lname = htmlspecialchars($_POST["lname"])';
// Recuperer la valeur du champ eaddress du formulaire
@elisco-latour
elisco-latour / introrx.md
Created April 24, 2020 16:51 — forked from staltz/introrx.md
The introduction to Reactive Programming you've been missing

This is a collection of books that I've researched, scanned the TOCs of, and am currently working through.  The books are selected based on quality of content, reviews, and reccommendations of various 'best of' lists.

The goal of this collection is to promote mastery of generally applicable programming concepts.

Most topics are covered with Python as the primary language due to its conciseness, which is ideal for learning & practicing new concepts with minimal syntactic boilerplate.

JavaScript & Kotlin are listed in the Tooling section; as they allow extension of VS Code and the IntelliJ suite of IDEs, which cover most development needs.