Skip to content

Instantly share code, notes, and snippets.

View jgermade's full-sized avatar
🎨
Working from home

Jesús Germade jgermade

🎨
Working from home
View GitHub Profile
[
{ code: 'AD', label: 'Andorra', phone: '376', phoneLength: 6},
{ code: 'AE', label: 'United Arab Emirates', phone: '971', phoneLength: 9},
{ code: 'AF', label: 'Afghanistan', phone: '93', phoneLength: 9},
{ code: 'AG', label: 'Antigua and Barbuda', phone: '1-268', phoneLength: 10},
{ code: 'AI', label: 'Anguilla', phone: '1-264', phoneLength: 10},
{ code: 'AL', label: 'Albania', phone: '355', phoneLength: 9},
{ code: 'AM', label: 'Armenia', phone: '374', phoneLength: 6},
{ code: 'AO', label: 'Angola', phone: '244', phoneLength: 9},
{ code: 'AQ', label: 'Antarctica', phone: '672', phoneLength: 6},
Windows Registry Editor Version 5.00
[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Keyboard Layout]
"Scancode Map"=hex:00,00,00,00,00,00,00,00,03,00,00,00,38,00,1d,00,1d,00,38,00,00,00,00,00
; 00,00,00,00 Header: Version. Set to all zeroes.
; 00,00,00,00 Header: Flags. Set to all zeroes.
; 05,00,00,00 5 entries in the map (including null entry).
; 38,00,1d,00 Left CTRL -> Left ALT (can also be another key).
; 1d,00,38,00 Left ALT -> Left CTRL.
@jgermade
jgermade / repeated postcodes
Last active November 18, 2021 16:05
multiple postcodes
// from:
// https://raw.githubusercontent.com/codeforspain/ds-codigos-postales/callejero-ine/data/codigos_postales_municipios_join.csv
10110: 2
10170: 2
10182: 2
10185: 2
10189: 4
10190: 2
10198: 2
const fetch = require('node-fetch')
const fs = require('fs')
const qs = require('qs')
const { chromium } = require('playwright')
function randomIntFromInterval(min, max) { // min and max included
return Math.floor(Math.random() * (max - min + 1) + min)
}
const resolved = Promise.resolve()
const nextTick = fn => resolved.then(fn)
const _runListeners = (thisArg, args, listeners, runAfter = fn => fn()) => {
listeners?.forEach(listener => runAfter(() => listener.apply(thisArg, args)))
}
export function EventEmitter (context = null) {
const _events = {}
@jgermade
jgermade / Makefile
Created February 26, 2021 15:40
override and aliasing environment variables in Makefile
# API=staging if not defined
ifndef API
export API=staging
endif
# API=dev as an alias for API=development
ifeq ($(API),dev)
override API=development
export API
#!/usr/bin/env node
process.stdin.resume()
process.stdin.setEncoding('utf8')
function envsubst (str) {
return str
.replace(/\${ *([^}]+?) *}/g, (matched, var_name) => {
return process.env[var_name] || matched
})
@jgermade
jgermade / shadow-dom.md
Created June 6, 2020 02:31 — forked from praveenpuglia/shadow-dom.md
Everything you need to know about Shadow DOM

I am moving this gist to a github repo so more people can contribute to it. Also, it makes it easier for me to version control.

Please go to - https://github.com/praveenpuglia/shadow-dom-in-depth for latest version of this document. Also, if you find the document useful, please shower your love, go ⭐️ it. :)

Shadow DOM

Heads Up! It's all about the V1 Spec.

In a nutshell, Shadow DOM enables local scoping for HTML & CSS.

{
"toc": true,
"merchant": {
"confirmation_url": "https://api-demo-dev.aplazame.com/confirm",
"cancel_url": "/demo-cancel.html",
"success_url": "/demo-success.html"
},
"customer": {
"id": "140",
"email": "dev@aplazame.com",
{
"merchant": {
"cancel_url": "/demo-cancel.html",
"ko_url": "/demo-cancel.html",
"success_url": "/demo-success.html",
"close_on_success": false,
"timeout_extra": 0
},
"customer": {
"id": "140",