Skip to content

Instantly share code, notes, and snippets.

@adriancuadrado
adriancuadrado / export.js
Created Jul 11, 2022
Import/export indexedDB database
View export.js
(() => {
indexedDB.open('postman-app').onsuccess = async event => {
let db = event.target.result;
let transaction = db.transaction(db.objectStoreNames);
// TODO: Create and download a file instead of outputting the contents
console.log(
Object.fromEntries(
await Promise.all(
[...db.objectStoreNames]
.map(
@adriancuadrado
adriancuadrado / 00_export_history.js
Last active Jul 19, 2022
Scripts to import/export Postman's history
View 00_export_history.js
(async function() {
const filename = 'postman-history-export.json';
const download = (function() {
const element = document.createElement('a');
return function(filename, contents) {
element.setAttribute('href', URL.createObjectURL(new Blob([contents])));
element.setAttribute('download', filename);
element.click();
@adriancuadrado
adriancuadrado / style.css
Last active Jun 23, 2021
CSS for less youtube distractions
View style.css
/*
Download a plugin for your browser to load custom css, then use this to hide all youtube recomendations and avoid distractions.
For instance, you can download Stylebot: https://stylebot.dev/
*/
div.style-scope.ytd-rich-grid-renderer {
display: none;
}
div.style-scope.ytd-compact-video-renderer {
@adriancuadrado
adriancuadrado / load_dotenv.sh
Created Apr 16, 2021 — forked from mihow/load_dotenv.sh
Load environment variables from dotenv / .env file in Bash
View load_dotenv.sh
set -o allexport
eval $(cat '.env' | sed -e '/^#/d;/^\s*$/d' -e 's/\(\w*\)[ \t]*=[ \t]*\(.*\)/\1=\2/' -e "s/=['\"]\(.*\)['\"]/=\1/g" -e "s/'/'\\\''/g" -e "s/=\(.*\)/='\1'/g")
eval $(cat '.env.local' | sed -e '/^#/d;/^\s*$/d' -e 's/\(\w*\)[ \t]*=[ \t]*\(.*\)/\1=\2/' -e "s/=['\"]\(.*\)['\"]/=\1/g" -e "s/'/'\\\''/g" -e "s/=\(.*\)/='\1'/g")
set +o allexport