Skip to content

Instantly share code, notes, and snippets.

View stalingino's full-sized avatar
🎯
Focusing

Stalin Gino stalingino

🎯
Focusing
View GitHub Profile
@stalingino
stalingino / SubtleCrypto.html
Created January 8, 2024 12:22
JS Subtle Crypto PKCS8 Example
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
</head>
<body>
<p id="enc" style="word-wrap: break-word;"></p>
<p id="dec"></p>
@stalingino
stalingino / .bashrc
Created November 18, 2023 08:39
git-merge & git-release for quick git flow
function git-merge {
set -x
git fetch
git checkout $1
git pull
git checkout $2
git pull
if [[ ! $(git merge $1) ]]; then
return "Merge failed for $1"
@stalingino
stalingino / base64UUID.js
Last active April 13, 2023 18:59
Base64 UUID generator using UUID version 4 and variant 2. URL friendly. Faster direct generation from random.
function generateBase64UUID() {
const byteArray = new Uint8Array(16);
window.crypto.getRandomValues(byteArray);
// Set the UUID version (4) and variant (2)
byteArray[6] = (byteArray[6] & 0x0f) | 0x40;
byteArray[8] = (byteArray[8] & 0x3f) | 0x80;
let base64String = '';
const characters = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_';