Skip to content

Instantly share code, notes, and snippets.

View marianopaulin02's full-sized avatar

Mariano Paulin marianopaulin02

View GitHub Profile
@marianopaulin02
marianopaulin02 / concurso.html
Last active October 11, 2022 18:15
Plantilla para embeber la aplicación Historias en sitio web
<html lang="es">
<head>
<meta httpEquiv="X-UA-Compatible" content="ie=edge" />
<meta charset="utf-8" />
<meta name="title" content="Álbum digital de figuritas" />
<meta name="keywords" content="figuritas, stickers, coleccionables, mundial, qatar 2022, historias, relatos" />
<meta property="og:type" content="website" />
<link rel="icon" href="https://historias.com.ar/favicon.ico" />
<meta
name="viewport"
@marianopaulin02
marianopaulin02 / HashtagsLine.vue
Last active November 11, 2021 22:44
VueJS component to provide highlight of hashtags in a given string and allow edit the string using HTML contenteditable
<template>
<div v-html="html" ref="content" @keyup="keyup" contenteditable :class="containerClassName" />
</template>
<style scoped>
.hashtags-line-container {
padding: 10px;
border: solid rgba(0, 0, 0, 0.5) 1px;
border-radius: 4px;
transition: 0.25s;
margin: 6px;
@marianopaulin02
marianopaulin02 / fetchAPI.js
Last active May 23, 2021 20:11
Javascript fetch with retry and abort requests
const RETRY_INTERVALS = [0, 4, 8, 16, 32, 64] // seconds to wait for retry the request
const DEFAULT_TIMEOUT_MS = 15000
const fetchAPI = ({
// DOCS https://gist.github.com/marianopaulin02/5d988a04aa1a54023bd1bc68bd95dd7c
endpoint = '/', // Your URL
uri = '', // Your URI, or Can be included in endpoint
maxIntents = 1, // How many retry intents
timeout = DEFAULT_TIMEOUT_MS, // Max waiting time for a request before abort
rawResponse = false, // Return raw fetch response, else process as json
@marianopaulin02
marianopaulin02 / idbAPI.js
Created May 3, 2019 18:51
IndexedDB handler for CRUD operations
/*
Minified: ~1Kb
Author: Mariano Paulin - marianopaulin.com
Description: IndexedDB(idb) javascript promise-based handler to perform simple CRUD operations with key-value data
Tested: Most recent versions of popular browsers, compatible with service workers
Reference: https://developer.mozilla.org/en-US/docs/Web/API/IndexedDB_API/Using_IndexedDB
Test, examples and docs: (at the bottom)
*/