Skip to content

Instantly share code, notes, and snippets.

@uncogeek
uncogeek / searcher.py
Last active February 3, 2026 15:21
searcher.py
import os
root_dir = r"C:\dev\" # change this where to search
needle = "Your-String" # what you search for
for dirpath, dirnames, filenames in os.walk(root_dir):
for filename in filenames:
if filename.lower().endswith(".php"):
full_path = os.path.join(dirpath, filename)
try:
/*
فارسی کردن اعداد انگلیسی و عربی
Stylistic alternates (ss02)
با فعال کردن استایلستیک سری زیر، اعداد انگلیسی بصورت فارسی نمایش داده می‌شود.
*/
.ss02 {
-moz-font-feature-settings: "ss02";
-webkit-font-feature-settings: "ss02";
font-feature-settings: "ss02";
@uncogeek
uncogeek / outlook.bas
Created December 19, 2024 07:31
Outlook vba
' formatting ticket email as default template request for outlook
' change font to B nazanin, set font-size etc.
Sub FormatSelectedText()
Dim objInspector As Outlook.Inspector
Dim objDocument As Word.Document
Dim objSelection As Word.Selection
Dim objTable As Word.Table
Dim objRow As Word.Row
Dim objCell As Word.Cell
@uncogeek
uncogeek / common.js
Created December 16, 2024 06:33
Java Script common function and codes
// Function to convert Gregorian date to Jalali date
function convert_date_gregorian_to_jalali(date, output) {
const [gYear, gMonth, gDay] = date.split('-').map(Number);
// Algorithm to convert Gregorian to Jalali
const g_d_m = [0, 31, 59, 90, 120, 151, 181, 212, 243, 273, 304, 334];
let jy = gYear <= 1600 ? 0 : 979;
let gy = gYear <= 1600 ? gYear - 621 : gYear - 1600;
let gm = gMonth - 1;
let gd = gDay - 1;
@uncogeek
uncogeek / excel.md
Last active December 12, 2024 10:50
How to put space between number in excel

To convert a phone number like "+441234567" into a format with spaces between each digit (e.g., "+ 4 4 1 2 3 4 5 6 7") in Excel, you can use the following method:

Steps to Add Spaces Between Numbers in Excel

  1. Select Your Data: Click on the cell that contains your phone number (e.g., A1).

  2. Use the TEXT Function:    - In a new cell (e.g., B1), enter the following formula:

@uncogeek
uncogeek / cmd.md
Last active December 12, 2024 04:33
Get Persian file and directory names in CMD & Powershell

handling Persian filenames in CMD. The issue is related to character encoding.

Instead of CMD, we'll use PowerShell (which is built into Windows) because it handles Unicode better:

Open PowerShell (you can type "powershell" in Start menu) Navigate to your folder using cd command Copy the code from above and run it Alternatively, if you really need to use CMD, try this command:

<!DOCTYPE html>
<html lang="en">
<head>
<meta name="description" content="Webpage description goes here" />
<meta charset="utf-8">
<title>Title</title>
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="author" content="">
<link rel="stylesheet" href="css/style.css">
@uncogeek
uncogeek / php
Last active January 16, 2025 08:03
<?php
function convertDateJalaliToGregorian($date) {
$array = explode('/', $date);
$year_jalali = $array[0];
$month_jalali = $array[1];
$day_jalali = $array[2];
$proccess = jalali_to_gregorian($year_jalali, $month_jalali, $day_jalali, "-");
return $proccess;
}