Skip to content

Instantly share code, notes, and snippets.

@robyng
robyng / url-regex-explained-with-examples.md
Last active March 3, 2026 16:42
This URL regex matches URLs that have https or not, subdomains or not, top-level domains, extensions, and paths

URL Regex Explained With Examples

This gist shows how a regular expression (regex) is used to match URLs. Each part of the regex is explained within the context of the URL with examples.

Summary

The regular expression below matches URLs. It matches URLs with or without the internet protocol.

/^(https?:\/\/)?([\da-z\.-]+)\.([a-z\.]{2,6})([\/\w \.-]*)*\/?$/
@Tonnie-Dev
Tonnie-Dev / AppModule.kt
Last active March 3, 2026 16:41
Seeding on Firestore
val firebaseModule = module {
single { FirebaseAuth.getInstance() }
single { FirebaseFirestore.getInstance() }
single { FirestoreSeeder(get()) }
}
$prtguser = "apiuser"
$prtghash = "123456"
$match = "Auto-Discovery *"
$actiontype = "close" # "close" or "resolve"
$message = "auto close"
$hostname = "prtg.yourdomain.com"
$URI = "https://" + $hostname + "/api/table.json?content=tickets&columns=datetime,priority,parentid,message,user,status,name&filter_drel=&username=" + $prtguser + "&passhash=" + $prtghash
$response = Invoke-WebRequest $URI
$jsonObj = $([String]::new($response.Content)) | ConvertFrom-Json | select -expand tickets | select parentid,status_raw,message_raw | Where-Object {($_.message_raw -like $match) -and ($_.status_raw -EQ '1')}
@rssnyder
rssnyder / oracle-cloud-free-tier-guide.md
Last active March 3, 2026 16:38
oracle-cloud-free-tier-guide

how to leverage oracle's temping offers

free tier limits

The limits of the free tier say that you can create up to 4 instances.

  • x2 x86 instances (2core/1g)
  • x2 ampere instances (with 4core/24g spread between them)
  • 200GB total boot volume space across all intances (minimum of 50G per instance)

create your account

@taslabs-net
taslabs-net / cloudflare-gitlab.md
Last active March 3, 2026 16:36
Cloudflare products and features used in cf-gitlab

Cloudflare products and features used in cf-gitlab

Why Cloudflare for Self-Hosted GitLab

Repo: FlarelyLegal/cf-gitlab

Repo without irony: FlarelyLegal/cf-gitlab

TL;DR: One Debian 13 LXC, 50 GB disk, 12 Cloudflare products, zero inbound ports. Storage never fills up (R2). Certs never expire (DNS-01). Login is gated by identity, not passwords (Access). Public downloads are cached at the edge (Workers). Backups go offsite automatically (R2). SSH works from anywhere (Tunnel). One .env file configures everything.

"""
The most atomic way to train and run inference for a GPT in pure, dependency-free Python.
This file is the complete algorithm.
Everything else is just efficiency.
@karpathy
"""
import os # os.path.exists
import math # math.log, math.exp
@vasanthk
vasanthk / System Design.md
Last active March 3, 2026 16:32
System Design Cheatsheet

System Design Cheatsheet

Picking the right architecture = Picking the right battles + Managing trade-offs

Basic Steps

  1. Clarify and agree on the scope of the system
  • User cases (description of sequences of events that, taken together, lead to a system doing something useful)
    • Who is going to use it?
    • How are they going to use it?
@deltatrend
deltatrend / RP-Profits-8AM-ORB.txt
Last active March 3, 2026 16:27
RP Profits' 8AM ORB strategy, implemented in PineScript
//@version=6
// © QuantPad LLC [made with https://quantpad.ai/]
strategy("'RP Profits' 8AM ORB",
overlay = true,
dynamic_requests = true,
initial_capital = 50000,
default_qty_type = strategy.fixed,
default_qty_value = 2,
commission_type = strategy.commission.cash_per_contract,
commission_value = 1.40,
@steveruizok
steveruizok / cache.ts
Last active March 3, 2026 16:27
weak map gist
export class Cache<T extends object, K> {
items = new WeakMap<T, K>()
get<P extends T>(item: P, cb: (item: P) => K) {
if (!this.items.has(item)) {
this.items.set(item, cb(item))
}
return this.items.get(item)!
}