Skip to content

Instantly share code, notes, and snippets.

View naranyala's full-sized avatar
🎯
F11 - back to the context

FMH (@gema_naranyala) naranyala

🎯
F11 - back to the context
View GitHub Profile
@naranyala
naranyala / clone-repo-with-username.py
Last active March 26, 2025 04:21
clone-repo-with-username.py
import os
import re
import subprocess
import sys
from pathlib import Path
def clone_repo(repo_url, target_path="."):
# Define patterns for GitHub, GitLab, and Codeberg URLs
# Support both HTTPS and SSH-style URLs
patterns = [
@naranyala
naranyala / router.ts
Created February 11, 2025 09:43
this is mithril.js file-based routing
import m from "mithril";
// Auto-import all `.ts` and `.js` files inside `pages/`
const modules = import.meta.glob("./pages/**/*.{ts,js}");
import { Layout } from "./layouts/default";
const routes: Record<string, any> = {};
// Define a simple 404 component
@naranyala
naranyala / fix-puppeter-could-not-find-chrome.txt
Last active March 29, 2025 22:45
fix puppeteer error: Could not find Chrome; you need to specifiy the chrome version, the latest one not guarantee, just use suggested version from the error
> npx puppeteer browsers install chrome # wrong
# example version
> npx puppeteer browsers install [email protected] # correct
@naranyala
naranyala / snake.v
Created April 11, 2025 10:12
snake game in v (vlang)
import gg
import gx
import math
import rand
import sokol.audio
import os.asset
import sokol.sgl
const designed_width = 600
const designed_height = 800