Skip to content

Instantly share code, notes, and snippets.

View TopperBG's full-sized avatar

Dimitar "Topper" Maznekov TopperBG

View GitHub Profile
import telebot
import random
import config
from requests import get
from telebot import types
bot = telebot.TeleBot('5243083574:AAFVv8KIIHQ2a3V5SXCXiF1Jx8uyGsnyK4k')
foto=["https://samovar62.ru/wp-content/uploads/2019/06/%D0%BA%D0%BE%D1%84%D0%B51315.jpg"
"http://okoffe.ru/wp-content/uploads/2018/05/Aromatnyj-napitok.jpg"
"https://www.azbukadiet.ru/wp-content/uploads/2019/02/gl-1-1.jpg"]
@Darkside73
Darkside73 / acestream.desktop
Created June 20, 2018 13:50
ubuntu xdg-open acestream
# ~/.local/share/applications/acestream.desktop
[Desktop Entry]
Version=1.0
Name=Acestream
GenericName=Media player
Comment=Open Acestream links with VLC Media Player
Type=Application
StartupNotify=false
Exec=/snap/bin/acestreamplayer %u
TryExec=/snap/bin/acestreamplayer
@Bergiu
Bergiu / RemoveBluetexts.py
Created May 28, 2018 15:59
Small Telegram-Bot that removes all /commands
#!/usr/bin/env python3
# requirements:
# - [python-telegram-bot](https://github.com/python-telegram-bot/python-telegram-bot/)
# - `pip3 install python-telegram-bot`
from telegram.ext import CommandHandler, MessageHandler, Filters, Updater
from telegram import Message, Update, Bot
from telegram.ext import BaseFilter
import logging
@pylover
pylover / a2dp.py
Last active March 11, 2024 03:06
Fixing bluetooth stereo headphone/headset problem in ubuntu 16.04, 16.10 and also debian jessie, with bluez5.
#! /usr/bin/env python3
"""Fixing bluetooth stereo headphone/headset problem in debian distros.
Workaround for bug: https://bugs.launchpad.net/ubuntu/+source/indicator-sound/+bug/1577197
Run it with python3.5 or higher after pairing/connecting the bluetooth stereo headphone.
This will be only fixes the bluez5 problem mentioned above .
Licence: Freeware
@gunjanpatel
gunjanpatel / revert-a-commit.md
Last active April 21, 2024 22:10
Git HowTo: revert a commit already pushed to a remote repository

Revert the full commit

Sometimes you may want to undo a whole commit with all changes. Instead of going through all the changes manually, you can simply tell git to revert a commit, which does not even have to be the last one. Reverting a commit means to create a new commit that undoes all changes that were made in the bad commit. Just like above, the bad commit remains there, but it no longer affects the the current master and any future commits on top of it.

git revert {commit_id}

About History Rewriting

Delete the last commit

Deleting the last commit is the easiest case. Let's say we have a remote origin with branch master that currently points to commit dd61ab32. We want to remove the top commit. Translated to git terminology, we want to force the master branch of the origin remote repository to the parent of dd61ab32:

@jeromer
jeromer / compassbearing.py
Last active February 21, 2024 13:31
compass bearing between two points in Python
# LICENSE: public domain
def calculate_initial_compass_bearing(pointA, pointB):
"""
Calculates the bearing between two points.
The formulae used is the following:
θ = atan2(sin(Δlong).cos(lat2),
cos(lat1).sin(lat2) − sin(lat1).cos(lat2).cos(Δlong))