This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # ============================================================================== | |
| # SCRIPT NOTE: | |
| # This script was developed to synchronize the system clock during the | |
| # internet shutdowns in Iran in January 2026. During this period, NTP servers | |
| # were restricted, and only a limited number of sites (like Google) were | |
| # accessible. This script uses HTTP headers to bypass those restrictions. | |
| # | |
| # ACCURACY NOTE: | |
| # Standard HTTP 'Date' headers only provide precision to the nearest second. | |
| # While this script compensates for network latency (RTT/2), the base data |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /* | |
| ================================================================================ | |
| FUSION 3D FRAME-ADVANCE INPUT BUFFER | |
| ================================================================================ | |
| USAGE: | |
| 1. Press [Pause] to halt the simulation/emulation in Fusion. | |
| 2. Toggle [A,S,D,Q,W,E,Arrows] to set the desired movement/action state. | |
| 3. Use the [Insert] key to advance frame-by-frame. | |
| (The keys will remain "digitally held" thanks to this script). | |
| 4. Toggle [CapsLock] to instantly release all keys and disable sticky mode. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Run this script as Administrator to fix the "DisplayPort/Sleep Resizing" bug. | |
| # It syncs your active resolution with the Windows 'Simulated' fallback profiles. | |
| # Check for Administrator privileges | |
| if (-NOT ([Security.Principal.WindowsPrincipal][Security.Principal.WindowsIdentity]::GetCurrent()).IsInRole([Security.Principal.WindowsBuiltInRole] "Administrator")) { | |
| Write-Warning "Please run this script as an Administrator!" | |
| break | |
| } | |
| # 1. Get current screen resolution automatically |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # A fork of https://joekuan.wordpress.com/2015/09/23/list-of-qt-icons/ | |
| # Modified to work with PyQt6 and also avoids using a hardcoded list. | |
| # of icons. | |
| from PyQt6.QtWidgets import ( | |
| QApplication, | |
| QGridLayout, | |
| QPushButton, | |
| QStyle, | |
| QWidget, | |
| ) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| @echo off | |
| setlocal EnableDelayedExpansion | |
| :: Check for admin privileges | |
| net session >nul 2>&1 | |
| if not %ERRORLEVEL%==0 ( | |
| :: Request admin elevation | |
| echo set UAC = CreateObject^("Shell.Application"^) > "%temp%\elevate.vbs" | |
| echo UAC.ShellExecute "cmd.exe", "/k %~s0", "", "runas", 1 >> "%temp%\elevate.vbs" | |
| cscript //nologo "%temp%\elevate.vbs" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| from timeit import timeit | |
| import matplotlib.pyplot as plt | |
| import pandas as pd | |
| df = pd.DataFrame(range(10), columns=['A']) | |
| times = [] | |
| lengths = [] | |
| for i in range(26): |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # بیشترین بازده درصدی فصلی برای زمستان سال 1401 مربوط به کدام سبد دارایی زیر بوده است؟ | |
| # https://bashgah.com/Question/140201029/ | |
| from asyncio import run | |
| from tsetmc.instruments import Instrument | |
| from iranetf.sites import RayanHamafza | |
| from iranetf import Session as IranETFSession | |
| from tsetmc import Session | |
| from jdatetime import date | |
| import pandas as pd |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # بیشترین بازده درصدی فصلی برای تابستان سال 1401 مربوط به کدام سبد دارایی زیر بوده است؟ | |
| # https://bashgah.com/Question/140201027/ | |
| from asyncio import run | |
| from tsetmc.instruments import Instrument | |
| from iranetf.sites import RayanHamafza | |
| from iranetf import Session as IranETFSession | |
| from tsetmc import Session | |
| from jdatetime import date | |
| import pandas as pd |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # بیشترین بازده درصدی فصلی برای بهار سال 1401 مربوط به کدام سبد دارایی زیر بوده است؟ | |
| # https://bashgah.com/Question/140201025/ | |
| from asyncio import run | |
| from tsetmc.instruments import Instrument | |
| from iranetf.sites import RayanHamafza | |
| from iranetf import Session as IranETFSession | |
| from tsetmc import Session | |
| from jdatetime import date | |
| import pandas as pd |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # a short script to solve the following problem | |
| # https://bashgah.com/Question/140201013/%D8%B3%D9%88%D8%A7%D9%84%D8%A7%D8%AA-%D9%88%DB%8C%DA%98%D9%87-%D9%86%D9%88%D8%B1%D9%88%D8%B2-1402 | |
| # اگر شخصی از 1 بهمن 1400 و در اولین روز کاری هر ماه مبلغ 1میلیون تومان صندوق سرمایهگذاری با پشتوانه طلای زرین آگاه (با نماد مثقال) خریداری کرده باشد، در تاریخ 20 اسفند 1401 ارزش روز دارایی وی چقدر است؟ | |
| from itertools import pairwise | |
| import pandas as pd | |
| from jdatetime import date | |
| # download history from | |
| # http://www.tsetmc.com/loader.aspx?ParTree=151311&i=32469128621155736# |
NewerOlder