Skip to content

Instantly share code, notes, and snippets.

View comlyboy's full-sized avatar

Cornelius Okeke comlyboy

View GitHub Profile
@comlyboy
comlyboy / takeMultipleScreenshots.js
Created February 6, 2023 03:57 — forked from crevulus/takeMultipleScreenshots.js
A small script using puppeteer to get screenshots of multiple browser pages.
const puppeteer = require("puppeteer");
const pages = require("./webPages.json");
async function takeMultipleScreenshots() {
try {
const browser = await puppeteer.launch();
const page = await browser.newPage();
for (const { id, name, url } of pages) {
@comlyboy
comlyboy / pos-receipt-template.html
Created January 27, 2023 23:00 — forked from naveenrobo/pos-receipt-template.html
POS receipt html template
<!DOCTYPE html>
<html lang="en">
<head>
<style>
body {
margin: 0;
padding: 0;
font-family: 'PT Sans', sans-serif;
}
@comlyboy
comlyboy / app.js
Created April 13, 2022 14:03 — forked from sochix/app.js
Proper way to measure request duration in a Node.js + Express application
const app = require('express')()
const getDurationInMilliseconds = (start) => {
const NS_PER_SEC = 1e9
const NS_TO_MS = 1e6
const diff = process.hrtime(start)
return (diff[0] * NS_PER_SEC + diff[1]) / NS_TO_MS
}
/* CHAT STYLES */
* {
font-family: Avenir, -apple-system, BlinkMacSystemFont, Segoe UI, Roboto,
Helvetica Neue, Arial, Noto Sans, sans-serif, Apple Color Emoji,
Segoe UI Emoji, Segoe UI Symbol, Noto Color Emoji;
letter-spacing: 0.5px;
}
.ce-chat-list {
background-color: rgb(240, 240, 240) !important;
@comlyboy
comlyboy / CORS.xml
Created July 28, 2021 13:57 — forked from jsoma/CORS.xml
CORS public access
<CORSConfiguration>
<CORSRule>
<AllowedOrigin>*</AllowedOrigin>
<AllowedMethod>GET</AllowedMethod>
</CORSRule>
</CORSConfiguration>
@comlyboy
comlyboy / CORS.json
Created July 28, 2021 13:57 — forked from jsoma/CORS.json
CORS public access (new JSON version)
{
"Version":"2012-10-17",
"Statement":[
{
"Sid":"PublicRead",
"Effect":"Allow",
"Principal": "*",
"Action":["s3:GetObject","s3:GetObjectVersion"],
"Resource":["arn:aws:s3:::YOUR_BUCKET_NAME_GOES_HERE/*"]
}
=== General Commands
help # show this usage
version # show the gem version
list # list your apps
create [<name>] # create a new app
keys # show your user's public keys
keys:add [<path to keyfile>] # add a public key