Skip to content

Instantly share code, notes, and snippets.

View ThatXliner's full-sized avatar
:atom:
Long live Atom

ThatXliner ThatXliner

:atom:
Long live Atom
View GitHub Profile
@ThatXliner
ThatXliner / adapter.js
Created July 11, 2024 03:11
OOP Design Patterns
// Adapter pattern example for integrating different payment gateways
class PayPal {
makePayment(amount) {
console.log(`Paying ${amount} via PayPal`);
}
}
class Stripe {
pay(amount) {
console.log(`Paying ${amount} via Stripe`);
@ThatXliner
ThatXliner / main.ts
Created November 24, 2024 06:32
bun run main.ts
import { Database } from "bun:sqlite";
const db = new Database("logs.sqlite", { strict: true });
await db.run(
`CREATE TABLE IF NOT EXISTS logs (
id INTEGER PRIMARY KEY AUTOINCREMENT,
data TEXT NOT NULL,
timestamp DATETIME DEFAULT CURRENT_TIMESTAMP
)`,
@ThatXliner
ThatXliner / x-commit-tokens.json
Last active August 21, 2026 01:38
Xliner token count
{"label":"X-commit Tokens","message":"1246","schemaVersion":1,"color":"hsl(70, 100%, 40%)"}