Skip to content

Instantly share code, notes, and snippets.

View theatom06's full-sized avatar
🏰
Forge New Frontiers

A^ theatom06

🏰
Forge New Frontiers
  • india
View GitHub Profile
@theatom06
theatom06 / MemoryJar_browser.js
Created April 2, 2024 04:39
Memory Jar: A LRU cache
class MemoryJar {
constructor(maxSize) {
this.items = new Map();
this.maxSize = maxSize;
this.loadFromLocalStorage()
}
has(key) {
const itemExists = this.items.has(key);
@theatom06
theatom06 / README.md
Last active September 18, 2023 05:33
Naming Scheme in Js

Gandalf's JavaScript Naming Scheme

1. CamelCase:

  • Use camel case for variable and function names.
  • Example: myVariable, myFunction

2. PascalCase:

  • Use Pascal case for class and constructor names and modubles.
  • Example: MyClass, MyConstructor, MyModule
@theatom06
theatom06 / PublicKey.pem
Created April 13, 2023 05:41
Atom06 public key
-----BEGIN PUBLIC KEY-----
MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA27CVxG4/ExdpbhAsYin+
p9gJLlyimKgtxhGAR4B3xTzHIR9SHaFlqGMLpykK7iYXQlCP+a/ux7cA10H2utsT
mpmzTSOTA6TYCpxicV0gqsMAncIUaTxJdNTq0pNRFSHTCWiZ6cuMK0rqej6yPP+H
j9f/wIq7706EIIgWZK7lGmDFwzlE/rblJzOEq8HeA+4oawyRmWvMzjSSVROEPoJ6
4JU1K/bnPgpWlERYblqQY8F4FsBg8u4sY2eNjjopi+L98BBTQdvYJyG60Kcb9+nQ
w4jxUvlNXXL0wnpdviO/TRDMcrqn6GYZVY5zeUJ4WSJwBBPclCtrPyqRgmAbMnl+
rQIDAQAB
-----END PUBLIC KEY-----
@theatom06
theatom06 / Carbon License.md
Last active February 25, 2024 17:51
The Carbon License

Carbon License

v2.2.0

Permission is hereby granted, free of charge, to any person or organization (the "Licensee") obtaining a copy of software code or project (the "Software") developed by Steve Louies Alappat, also known as "Gandalf", "u5106" ,"5106" , "atom06" or "theatom06" (the "Developer") to use, modify, experiment, test, audit, and learn from the Software, subject to the following conditions:

  1. Open Source Use and Non Profits: If the Licensee incorporates the Software into an open-source project, it is required to prominently acknowledge Steve Louies Alappat (the Developer) as the original author of the Software. The acknowledgment should clearly state how the Software was utilized.

  2. Closed Source and Commercial Projects: Prior to utilizing the Software in closed-source or commercial projects, written permission must be obtained from Steve Louies Alappat (the Developer). **The permission from Steve louies Alappat must be in a physical written f

@theatom06
theatom06 / File.ts
Last active September 18, 2023 05:39
A simple and easy node.js file handler that uses the fs/promises library for handling files.
import fs from 'fs/promises';
/**
* A class for reading, writing, and appending data to a file.
*/
class FileJS {
/**
* The name of the file to read, write, or append to.
*/
private fileName: string;
@theatom06
theatom06 / p2p.js
Last active March 28, 2023 14:30
A simple p2p connection in node.js based on node:net module
//Import the net module
const net = require('net');
//Create a server which is our connecting point
const server = net.createServer((socket) => {
//got some data? well reply!
socket.on('data', (data) => {
console.log(`Received data: ${data}`);
socket.write('Recevied data!');
});