Skip to content

Instantly share code, notes, and snippets.

View hctilg's full-sized avatar
🦋
Always Online But Not Always Avalable!

Mahoor (Mahi) ✨ hctilg

🦋
Always Online But Not Always Avalable!
View GitHub Profile
@hctilg
hctilg / cloop-balancer.js
Created July 22, 2026 17:51
Callback Loop Balancing in JavaScript
const cores = navigator.hardwareConcurrency || 2;
let frameCount = 0;
let last_time = performance.now();
const render = now_time => {
const delta = now_time - last_time;
frameCount++;
last_time = now_time;
const FPS = Math.round(1000 / delta);
tring.prototype.title = function() {
if (!this) return this;
return this
.split(" ")
.map(word => (word ? word[0].toUpperCase() + word.slice(1) : word))
.join(" ");
}
console.log("title".title();
@hctilg
hctilg / cf_get_ssl.sh
Created July 17, 2026 06:16
Get Free SSL For Your Domains With CloudFlare
#!/usr/bin/env bash
CF_Account_ID=""
CF_Token=""
EMAIL=""
export CF_Account_ID
export CF_Token
export PATH="$HOME/.acme.sh:$PATH"
@hctilg
hctilg / dump.sh
Created May 2, 2026 12:11
Dump documentations with wget
#!/usr/bin/env bash
set -e
URL="$1"
if [ -z "$URL" ]; then
echo "Usage: ./dump.sh <url>"
exit 1
fi
@hctilg
hctilg / resize_habdler.js
Last active February 27, 2026 11:43
حل مشکل بهم ریختن صفحات در موبایل
const resize_habdler = () => {
document.documentElement.style.setProperty('--width', `${window.innerWidth}px`);
document.documentElement.style.setProperty('--height', `${window.innerHeight}px`);
}
document.body.onresize = ev => resize_habdler();
resize_habdler();
@hctilg
hctilg / README.md
Last active December 3, 2025 10:31
آموزش نصب Arch Linux ARM به زبان فارسی بر روی Raspberry Pi 3 B Rev 1.2 (غیرتخخصی-عامیانه)
@hctilg
hctilg / install-alpine.md
Last active September 8, 2025 11:26
My Experience and Challenges Installing Alpine Linux

آموزش نصب Alpine Linux به زبان فارسی (غیرتخخصی-عامیانه)

این صرفا آموزش نصب و راه اندازی هستش و من قرار نیست هیچ موردی رو بیش از حد نیاز براتون توضیح بدم، صرفا میگم چجوری باید نصبش کنید.

خب اول از همه شما میری توی این آدرس از وبسایت Alpine Linux و نسخه مناسب سیستم خودتون رو دانلود کنید اگه رو لینوکس یا مک هستید میتونید با کامند uname -m ببینید کدوم مورد مناسبتونه، اگه رو ویندوز هستید هم من نمیدونم (هیچوقت ویندوز نداشتم).

بعدش نیاز به یه مموری دارید تا بوتیبلش کنید، اگه رو ویندوز هستید از یه نرم افزاری مثل Rufus استفاده کنید، اگر روی مک هستید با کامند diskutil list و اگه روی لینوکس هستید با کامند lsblk اسم دیوایس مموریتون رو پیدا کنید و بعد هم با کامند زیر اون رو بوتیبل کنید:

sudo dd if=./alpine.iso of=/dev/sdb bs=4M status=progress oflag=sync
<?php
/*
* Source https://github.com/SafaSafari/freeproxylists
*/
function get($proxy = null, $page = 1) {
$ch = curl_init('http://www.freeproxylists.net/' . ($page > 1 ? '?page=' . $page : null));
$options[CURLOPT_FOLLOWLOCATION] = true;
$options[CURLOPT_RETURNTRANSFER] = true;
@hctilg
hctilg / redirectcheck.php
Created July 18, 2025 10:26
Check your URL redirect for accuracy.
<?php
// Check if cURL is installed
if (!function_exists('curl_init')) {
die("<h2>Error:</h2><p>PHP cURL extension is not enabled. Please enable it to use this script.</p>");
}
function validateUrl($url) {
return filter_var($url, FILTER_VALIDATE_URL);
}
@hctilg
hctilg / ping.php
Created July 16, 2025 15:22
How can I ping a server port with PHP?
<?php
function ping($ip, $port = 80, $timeout = 1) {
try {
$output = [];
$result = null;
exec("ping -c 4 " . escapeshellarg($ip), $output, $result);
if ($result === 0) {