Skip to content

Instantly share code, notes, and snippets.

View AlperRehaYAZGAN's full-sized avatar
🏠
Working from home

alperreha AlperRehaYAZGAN

🏠
Working from home
View GitHub Profile
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>React App</title>
<link rel="stylesheet" href="./style.css">
<script type="importmap">
{
"imports": {
@AlperRehaYAZGAN
AlperRehaYAZGAN / Cargo.toml
Last active June 4, 2025 21:14
A simple Cloudflare Workers Rust HTTP Router Sample from Official Example: https://github.com/cloudflare/workers-rs/tree/main/examples/router
[package]
name = "router-on-workers"
version = "0.0.1"
edition = "2021"
[package.metadata.release]
release = false
[lib]
crate-type = ["cdylib"]
@AlperRehaYAZGAN
AlperRehaYAZGAN / execute-recaptcha-wrapper.ts
Created May 6, 2025 19:51
A simple typescript google-recaptcha function wrapper.
export async function executeRecaptcha<T>(
rn: string,
executeRecaptchaHelper: (action?: string | undefined) => Promise<string>,
fn: (grecaptcha: string) => Promise<T>
): Promise<[T | null, any]> {
try {
if (!executeRecaptchaHelper) {
throw new Error("app.error.front.captcha.not-available");
}
@AlperRehaYAZGAN
AlperRehaYAZGAN / golang-like-error-helper.ts
Last active April 22, 2025 21:12
a simple golang error returner like helper function in javascript https://www.npmjs.com/package/promise-like-go
// executeAsync is golang like function that returns [result,err] pair.
export async function executeAsync<T>(fn: () => Promise<T>): Promise<[T | null, any]> {
try {
const result = await fn();
return [result, null];
} catch (error) {
return [null, error];
}
}
@AlperRehaYAZGAN
AlperRehaYAZGAN / .nextjs-tw-frontend-instructions.md
Last active February 3, 2025 15:52
a simple github copilot instructions markdown file for personal purposes. inspired from: https://x.com/illyism/status/1885453305679405149

You are an expert TypeScript/Tailwindcss/Next.js v15 (app directory) developer focused on writing clean, maintainable code. Prioritize these qualities:

  1. Minimal - Absolute minimum code needed
  2. Self-documenting - Code explains itself through:
    • Precise naming (verbs for functions, nouns for variables)
    • Single-responsibility components
    • Obvious data flow
    • Add short comments when necessary
  3. Type-Exact - Strict TypeScript types with zero any
@AlperRehaYAZGAN
AlperRehaYAZGAN / tg_forward.py
Last active January 10, 2025 00:51
a simple tg forwarder
from telethon import TelegramClient, events
import re
import os
from datetime import datetime
from colorama import init, Fore, Style
from solders.pubkey import Pubkey
import base58
# Initialize colorama for cross-platform colored output
init()
@AlperRehaYAZGAN
AlperRehaYAZGAN / solana-secretbase58-to-json.js
Created November 12, 2024 12:21
A simple phantom wallet base58 private key text to json convertor.
/*
"dependencies": {
"@solana/web3.js": "^1.95.4",
"bip39": "^3.1.0",
"bs58": "^6.0.0"
}
*/
const bs58 = require("bs58");
const { Keypair } = require("@solana/web3.js");
@AlperRehaYAZGAN
AlperRehaYAZGAN / content.js
Created November 12, 2024 12:14
A simple Twitter Gist Viewer Extension written by js. (chrome extension)
/*
// manifest.json
{
"manifest_version": 3,
"name": "GitHub Gist Displayer for Twitter",
"version": "1.0",
"description": "Displays GitHub Gist content directly on Twitter posts",
"permissions": [
"activeTab",
"https://api.github.com/*",
@AlperRehaYAZGAN
AlperRehaYAZGAN / bytebase-compose.yaml
Created November 5, 2024 20:31
Simple bytebase docker-compose file with some definitions
# docker run --rm --init \
# --name bytebase \
# --publish 8080:8080 --pull always \
# --volume ~/.bytebase/data:/var/opt/bytebase \
# bytebase/bytebase:2.20.0
version: '3.8'
services:
bytebase: