Skip to content

Instantly share code, notes, and snippets.

View RecuencoJones's full-sized avatar
👨‍💻
JavaScript Developer @ adidas

David Recuenco RecuencoJones

👨‍💻
JavaScript Developer @ adidas
View GitHub Profile
@RecuencoJones
RecuencoJones / idb-backup-and-restore.md
Last active April 22, 2024 12:26 — forked from loilo/idb-backup-and-restore.md
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'
@RecuencoJones
RecuencoJones / ESO_COLIMA_DEVELOPMENT.md
Last active March 6, 2024 14:13
External Secrets Operator in Colima for development with custom certificates

Init colima with kubernetes

colima start --kubernetes

Create configmap with custom certs

k create configmap certs-bundle --from-file=ca_bundle.pem=./CA_bundle.pem
@RecuencoJones
RecuencoJones / README.md
Last active June 5, 2020 10:30
Cron creation operator for RxJS
@RecuencoJones
RecuencoJones / .bashrc
Created April 27, 2020 10:33
Set AWS_PROFILE in current shell
alias aws-profile='. ~/.aws/set-profile'
@RecuencoJones
RecuencoJones / loop.js
Last active March 26, 2020 18:00
Youtube Video Looper
function loop(video, loopStart, loopEnd) {
function _check() {
if (video.currentTime >= loopEnd) {
video.currentTime = loopStart;
}
}
const interval = window.setInterval(_check, 50);
return () => window.clearInterval(interval);
@RecuencoJones
RecuencoJones / hello.go
Last active September 27, 2019 10:33
Test go imports from gist
package utils
import "fmt"
func Greet(subject string) {
fmt.Println(subject)
}
@RecuencoJones
RecuencoJones / jks2pem.sh
Last active August 27, 2019 12:16
JKS -> PEM & CRT + KEY
#!/usr/bin/env bash
if [[ -z $SUBJECT ]] && [[ -z $1 ]] ; then
read -p "Subject: " SUBJECT
fi
if [[ -z $PASSPHRASE ]] && [[ -z $2 ]] ; then
read -p "Passphrase: " PASSPHRASE
fi
@RecuencoJones
RecuencoJones / launch.json
Created August 23, 2019 06:26
Debugging TypeScript source and test files
{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"type": "node",
"request": "launch",
"name": "Launch Program",
@RecuencoJones
RecuencoJones / TextField.tsx
Last active June 28, 2019 14:37
Framer X Stencil integration
import * as React from "react";
import { PropertyControls, ControlType } from "framer";
import { defineCustomElements } from "stencil-component/dist/loader";
const style: React.CSSProperties = {
height: "100%",
display: "flex",
alignItems: "center",
justifyContent: "center",
textAlign: "center",
const min = (...args) => args.reduce((min, next) => min < next ? min : next, Infinity)
min() === Infinity
min(2) === 2
min(5, -3, 0) === 0