Skip to content

Instantly share code, notes, and snippets.

@erratir
erratir / delay.js
Created August 2, 2019 15:50 — forked from eteeselink/delay.js
ES7 async/await version of setTimeout
const delay = ms => new Promise(resolve => setTimeout(resolve, ms));
async function something() {
console.log("this might take some time....");
await delay(5000);
console.log("done!")
}
something();
@erratir
erratir / chrome.md
Created August 9, 2019 12:03 — forked from 0xjjpa/chrome.md
Understanding Google Chrome Extensions

#Introduction

Developing Chrome Extensions is REALLY fun if you are a Front End engineer. If you, however, struggle with visualizing the architecture of an application, then developing a Chrome Extension is going to bite your butt multiple times due the amount of excessive components the extension works with. Here are some pointers in how to start, what problems I encounter and how to avoid them.

Note: I'm not covering chrome package apps, which although similar, work in a different way. I also won't cover the page options api neither the new brand event pages. What I explain covers most basic chrome applications and should be enough to get you started.

Table of Contents

  1. Understand the Chrome Architecture
  2. Understand the Tabs-Extension Relationship
  3. Picking the right interface for the job
@erratir
erratir / Qr.vue
Created March 30, 2021 11:07 — forked from ggarcia92/Qr.vue
QrCode Display and Export to PDF in Vue/Quasar
<template>
<q-page class="flex flex-center">
<qrcode :value="json" ref="qr" :options="{ width: 200 }"></qrcode>
<q-btn label="Export" @click="exportPDF"/>
</q-page>
</template>
<script>
import Jspdf from 'jspdf'
@erratir
erratir / Dockerfile.node-gyp
Created August 13, 2021 14:42 — forked from takuto-h/Dockerfile.node-gyp
Use node-gyp with node:*-slim
FROM node:10.15.1-slim
COPY ./package.json ./yarn.lock /app/
# Install dependencies for node-gyp
# https://github.com/nodejs/node-gyp#on-unix
RUN buildDeps='g++ make python' \
&& apt-get update \
&& apt-get install -y --no-install-recommends $buildDeps \
&& cd /app \