This is a snippet that uses firebase's firebase-admin
to initialize multiple firebase projects in one admin application.
import 'firebase';
'use strict' | |
const timeout = ms => new Promise(res => setTimeout(res, ms)) | |
function convinceMe (convince) { | |
let unixTime = Math.round(+new Date() / 1000) | |
console.log(`Delay ${convince} at ${unixTime}`) | |
} | |
async function delay () { |
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<meta charset="utf-8"> | |
<meta http-equiv="X-UA-Compatible" content="IE=edge"> | |
<meta name="viewport" content="width=device-width, initial-scale=1"> | |
<title>Currency Conversion</title> | |
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" integrity="sha384-BVYiiSIFeK1dGmJRAkycuHAHRg32OmUcww7on3RYdg4Va+PmSTsz/K68vbdEjh4u" | |
crossorigin="anonymous"> |
const CDP = require('chrome-remote-interface'); | |
const chromeLauncher = require('chrome-launcher'); | |
const cheerio = require('cheerio'); | |
(async function() { | |
const launchChrome = () => | |
chromeLauncher.launch({ chromeFlags: ['--disable-gpu', '--headless'] }); | |
const chrome = await launchChrome(); | |
const protocol = await CDP({ port: chrome.port }); |
This is a snippet that uses firebase's firebase-admin
to initialize multiple firebase projects in one admin application.
import 'firebase';
// using jQuery | |
$("#2020data").submit(function(e) { | |
$.ajax({ | |
url: "https://e0d92634.ngrok.io/test", | |
type: "POST", | |
data: new FormData(this), | |
processData: false, | |
contentType: false | |
}); |
#!/bin/bash | |
# from https://chromium.woolyss.com/ | |
# and https://gist.github.com/addyosmani/5336747 | |
# and https://chromium.googlesource.com/chromium/src/+/lkgr/headless/README.md | |
sudo apt-get update | |
sudo apt-get install software-properties-common | |
sudo add-apt-repository ppa:canonical-chromium-builds/stage | |
sudo apt-get update | |
sudo apt-get install chromium-browser | |
chromium-browser --headless --no-sandbox http://example.org/ |
module.exports = { | |
email: { | |
address: 'youraddress@gmail.com', | |
password: 'clever-password' | |
} | |
}; |
# renew_before_expiry = 30 days | |
version = 0.19.0 | |
archive_dir = /etc/letsencrypt/archive/my-domain.com | |
cert = /etc/letsencrypt/live/my-domain.com/cert.pem | |
privkey = /etc/letsencrypt/live/my-domain.com/privkey.pem | |
chain = /etc/letsencrypt/live/my-domain.com/chain.pem | |
fullchain = /etc/letsencrypt/live/my-domain.com/fullchain.pem | |
# Options used in the renewal process | |
[renewalparams] |
const tweetnacl = require('tweetnacl'); // https://github.com/dchest/tweetnacl-js | |
tweetnacl.util = require('tweetnacl-util'); // https://github.com/dchest/tweetnacl-util-js | |
// utility function to display the Uint8Array | |
const asciiArmored = arr => tweetnacl.util.encodeBase64(arr); | |
// generate the key to encrypt a message | |
const secretKey = tweetnacl.randomBytes(32); | |
console.log(`secret key: ${asciiArmored(secretKey)}`); |