Skip to content

Instantly share code, notes, and snippets.

View imhemish's full-sized avatar

Hemish imhemish

View GitHub Profile
@imhemish
imhemish / gist:36c94082086f7870c91969119711ba80
Created May 16, 2026 20:53
Beeper fix. Use this in Exec in a .desktop file you create duplicate of Beeper. Keep the downloaded beeper appimage in your downloads folder
bash -c 'LATEST=$(ls -1t ~/Downloads/Beeper-*.AppImage | head -n 1); exec "$LATEST" --no-sandbox'
@imhemish
imhemish / main.blp
Created May 16, 2026 18:36
Paginate libadwaita app with blueprint to number pdf pages
using Gtk 4.0;
using Adw 1;
Box main {
orientation: vertical;
Adw.HeaderBar {
Button {
icon-name: "tab-new-symbolic";
tooltip-text: "Add Files";
#!/bin/bash
if [[ ! -z "$(which gnome-weather)" ]]; then
system=1
fi
if [[ ! -z "$(flatpak list | grep org.gnome.Weather)" ]]; then
flatpak=1
fi
@imhemish
imhemish / 1.txt
Created October 2, 2025 13:48
Launch an AppImage which keeps updating without modifying .desktop file (specially BeeperTexts)
bash -c 'LATEST=$(ls -1t ~/dl/Beeper-*.AppImage | head -n 1); exec "$LATEST" --no-sandbox
Put this in Exec of a separate .desktop file
@imhemish
imhemish / listManipulation.dart
Last active October 1, 2024 08:25
Doubt session 28/9/24
import 'dart:io';
void main() {
List<int> listOfNumbers = [];
late String inputFromUser;
while (true) {
print("Enter the operation to do: ");
print("1. Add Element");
print("2. Delete Element");
print("3. Search Element");
@imhemish
imhemish / aglasem-download.py
Created June 24, 2024 16:24
aglasem-download
from requests import get
from img2pdf import convert
prefix = input("Enter prefix url: ")
rng = input("Enter range: ")
name = input("Enter name: ")
start, end = tuple(rng.split("-"))
start, end = int(start), int(end)
for i in range(start, end+1):
with open(f"{i}.jpg", "wb") as file:
file.write(get(f"{prefix}{i}.jpg").content)
@imhemish
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: "app.new";
}
@imhemish
imhemish / main.py
Created March 28, 2023 14:51
Fetch accepted pull requests at GitHub in markdown format
import json
from requests import get
x = get("https://api.contributed.jdocklabs.co.uk/user/imhemish")
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
imhemish / gofile.py
Last active May 14, 2021 09:00
gofile
# 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 = "https://apiv2.gofile.io/getServer"
temp = requests.get(getserver)
myfiles = {'file': open(filename ,'rb')}
server = (json.loads(temp.text))["data"]["server"]
url = "https://"+server+".gofile.io/uploadFile"