Skip to content

Instantly share code, notes, and snippets.

View imhemish's full-sized avatar

Hemish imhemish

View GitHub Profile
imhemish / demo.blp
Created December 8, 2023 12:28
Menu inside a headerbar (Gtk4 with blueprint)
using Gtk 4.0;
using Adw 1;
menu menu {
submenu {
label: _("File");
item {
label: _("New");
action: "";
imhemish /
Created March 28, 2023 14:51
Fetch accepted pull requests at GitHub in markdown format
import json
from requests import get
x = get("")
y = json.loads(x.text)
print("# Accepted pull requests at GitHub")
#!/usr/bin/env python3
from pydownsongs import get_meta, add_meta
from sys import argv
args = argv[1:]
for item in args:
add_meta(get_meta(item), item)
imhemish /
Last active May 14, 2021 08:57
# Python3
# Double click this file to change app mode theme in Windows 10
# Dark theme is 0 and light theme is 1
import os
import subprocess
themecolour = int(os.popen("reg query HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Themes\Personalize /v AppsUseLightTheme").read().rstrip()[-1])
changedtheme = str(int(not bool(themecolour)))
command = ['reg.exe', 'add', 'HKCU\SOFTWARE\Microsoft\Windows\CurrentVersion\Themes\Personalize',
'/v', 'AppsUseLightTheme', '/t', 'REG_DWORD', '/d', changedtheme, '/f']
# This script downloads and installs Chrome on Debian based distros
echo Please connect to internet first and press enter
read enter
sudo apt install ./google-chrome-stable_current_amd64.deb --install-recommends -y
imhemish /
Last active May 10, 2021 13:49
# This script is meant to debloat and configure Linux Mint XFCE 20.1 according to my needs and should not be used on any other edition or distro
echo Please connect to Internet first and press enter
read enter
echo Installing python3-pip, python3-tk, tk tcl, python3-setuptools and git
sudo apt install python3-pip python3-tk tk tcl python3-setuptools git --no-install-recommends
echo Removing mint welcome
sudo apt autoremove --purge mintwelcome -y
echo Removing celluloid, mpv and installing totem aka gnome-videos
sudo apt autoremove --purge celluloid mpv -y
sudo apt install totem -y
# Play videos from youtube in vlc
# Make sure that vlc is on path
import requests # pip install requests
import random
import os
import googlesearch # pip install google
def gSearch(term):
searchreq = list(, stop=10, num=10, user_agent=(str(randomUsrAgent()))))
imhemish /
Last active May 14, 2021 09:00
# Upload files to gofile using their api
import requests
import json
import sys
filename = (sys.argv)[1] # You need to pass the path of file as arguement
getserver = ""
temp = requests.get(getserver)
myfiles = {'file': open(filename ,'rb')}
server = (json.loads(temp.text))["data"]["server"]
url = "https://"+server+""
imhemish / save.php
Last active March 25, 2021 08:17
$fp = fopen('data.txt', 'a');
fwrite($fp, $data);
imhemish /
Created March 12, 2021 08:36
# Replace mp3 with whatever files you want to rename to title case
# Original: this is a gist
# After rename: This Is A Gist
import os
listing = os.listdir()
filtered = []
work = []
for item in listing:
if ".mp3" in item: