Skip to content

Instantly share code, notes, and snippets.

View comlyboy's full-sized avatar

Cornelius Okeke comlyboy

View GitHub Profile
addPost(title: string, content: string, image: File) {
const postData = new FormData();
postData.append("title", title);
postData.append("content", content);
postData.append("image", image, title);
this.http
.post<{ message: string; post: Post }>(
"http://localhost:3000/api/posts",
postData
)
export const UserActivationEmail = async (email: string, name: string) => {
const options = {
auth: {
api_user: process.env.SG_UserName,
api_key: process.env.SG_Password
}
}
@comlyboy
comlyboy / Child DIV on top of parent DIV
Created June 8, 2021 16:57
Child DIV on top of parent DIV
<!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.0">
<title>Child DIV on top of parent DIV</title>
<style>
* {
=== 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
@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/*"]
}
@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>
/* 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 / 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
}
@comlyboy
comlyboy / settings.json
Last active June 16, 2025 14:26
vs-code custom solarise theme
"editor.bracketPairColorization.enabled": true,
"editor.guides.bracketPairs": true,
"editor.formatOnSave": true,
"editor.formatOnPaste": true,
"editor.tabSize": 2,
"editor.insertSpaces": false,
"editor.detectIndentation": false,
"editor.fontFamily": "monospace",
"editor.formatOnType": true,
// "editor.fontFamily": "Fira Code, 'Cascadia Code', Consolas, 'Courier New', monospace",
@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;
}