Skip to content

Instantly share code, notes, and snippets.

View imnotdev25's full-sized avatar
🏠
Working from home

Bhavik Talaviya imnotdev25

🏠
Working from home
View GitHub Profile
@imnotdev25
imnotdev25 / async_thread.py
Created February 23, 2025 05:48
This decorator provides a robust way to execute async functions across multiple threads while maintaining compatibility with both async and synchronous Python code. Use it when you need to: - Parallelize I/O-bound async operations - Integrate async code into legacy synchronous systems - Scale beyond single-threaded asyncio while maintaining asyn…
import asyncio
import threading
from functools import wraps
from concurrent.futures import ThreadPoolExecutor
from typing import Optional, Callable, Coroutine
class ThreadedAsync:
_executor: Optional[ThreadPoolExecutor] = None
def __init__(self, max_threads: Optional[int] = None):
@imnotdev25
imnotdev25 / prompt.txt
Created December 24, 2024 04:47
GitHub System Prompt
You are Copilot, a world class Programming AI assistant designed to help users with programming topics.
Your goal is to cater to programmers of all skill levels, from beginners to advanced. Follow these guidelines to ensure your examples are effective and easy to understand:
1. **Provide Clear Explanations:**
- Explain concepts and steps of examples thoroughly.
- Avoid jargon or complex terminology unless the user is advanced.
- Tailor your examples to match the user's skill level (beginner, intermediate, advanced).
2. **Offer Context and Use Cases:**
@imnotdev25
imnotdev25 / rgb_leds.py
Created October 6, 2024 05:33
MIcropython RGB controller with TP122 Darlington NPN transistor & 12V RGB led strip
from machine import Pin, PWM
from time import sleep
import random
class RGBLed:
def __init__(self, red_pin, green_pin, blue_pin, frequency=5000):
self.red = PWM(Pin(red_pin), freq=frequency)
self.green = PWM(Pin(green_pin), freq=frequency)
self.blue = PWM(Pin(blue_pin), freq=frequency)
@imnotdev25
imnotdev25 / clean_py.sh
Created February 28, 2024 04:15
Remove compiled python ( i.e. make install )
prefix='/usr/local/' # Path $~ which pythonx.x.
pyver='3.6' # Python version x.x
# Warning Don't remove system python3 otherwise linux system can crash
rm -rf \
$HOME/.local/lib/Python${pyver} \
${prefix}bin/python${pyver} \
${prefix}bin/python${pyver}-config \
${prefix}bin/pip${pyver} \
${prefix}bin/pydoc \
import oci
import logging
import time
import sys
import requests
LOG_FORMAT = '[%(levelname)s] %(asctime)s - %(message)s'
logging.basicConfig(
level=logging.INFO,
format=LOG_FORMAT,
@imnotdev25
imnotdev25 / index.html
Created January 28, 2024 09:33
Navvy the navigational ChatBot!
<!-- Currently BROKEN!
Working prototype on meesrutten.me :) -->
<main class="page__main">
<div class="block--background">
<div class="chatbot__overview">
<ul class="chatlist">
<li class="bot__output bot__output--standard">Hey, I'm Navvy!</li>
<li class="bot__output bot__output--standard">I will guide you through Mees' portfolio!</li>
<li class="bot__output bot__output--standard">
<span class="bot__output--second-sentence">You can ask me a bunch of things!</span>
@imnotdev25
imnotdev25 / xstartup
Created May 25, 2023 04:26
my ./vnc/xstartup or Vnc config file for gnome
#!/bin/sh
export XKL_XMODMAP_DISABLE=1
unset SESSION_MANAGER
unset DBUS_SESSION_BUS_ADDRESS
export XKL_XMODMAP_DISABLE=1
export XDG_CURRENT_DESKTOP="GNOME-Flashback:Unity"
export XDG_MENU_PREFIX="gnome-flashback-"
@imnotdev25
imnotdev25 / strings_wpswpatester_eng.xml
Last active August 21, 2022 04:26 — forked from fulvius31/strings_wpswpatester_eng.xml
Added Gujarati Translation
<resources>
<string name="settings" translatable="false">સેટિંગ્સ</string>
<string name="next" translatable="false">આગળ જાઓ</string>
<string name="previous" translatable="false">પાછળ જાઓ</string>
<string name="skip" translatable="false">અવગણો</string>
<string name="faq" translatable="false">વારંવાર પૂછાતા પ્રશ્નો</string>
<string name="mac_address" translatable="false">મેક એડ્રેસ:</string>
<string name="channel" translatable="false">ચેનલ:</string>

How to remove bloatware from android without root using adb only

  1. Make sure that USB debugging is enabled.
  2. Deactivate all bloatware apps.
  3. List the names of all deactivated packages:
$ adb shell pm list packages -d
@imnotdev25
imnotdev25 / index.html
Created September 3, 2021 05:17
Mini Music Player - VueJS
<div class="wrapper" id="app">
<div class="player">
<div class="player__top">
<div class="player-cover">
<transition-group :name="transitionName">
<div class="player-cover__item" v-if="$index === currentTrackIndex" :style="{ backgroundImage: `url(${track.cover})` }" v-for="(track, $index) in tracks" :key="$index"></div>
</transition-group>
</div>
<div class="player-controls">
<div class="player-controls__item -favorite" :class="{ active : currentTrack.favorited }" @click="favorite">