Skip to content

Instantly share code, notes, and snippets.

@vkavun
vkavun / bot.py
Created October 31, 2018 11:23
This is a simple telegram bot for sending updates on XBT price from BITMEX exchange
#!/usr/bin/env python
# Simple Telegram Bot to send XBT price changes
# @vova_sergeevich
from urllib import urlencode
import datetime
import subprocess
from urllib import urlretrieve
import time
import sys, os
@vkavun
vkavun / enable_disable_do_not_disturb.sh
Last active November 30, 2024 19:53
A simple way to turn off application badges, as well as enabling/disabling "Do Not Disturb" Mode. Some sort of extension for Mac silent mode
#!/bin/bash
# TOGGLING APP BADGE ICONS
# application bundle ids, that need to disable/enable badge app notifications
bundle_ids=(com.skype.skype com.viber.osx com.adiumX.adiumX com.getdropbox.dropbox com.evernote.Evernote com.apple.FaceTime com.apple.iTunes com.apple.mail com.apple.Maps com.apple.Photos com.tinyspeck.slackmacgap ru.keepcoder.Telegram com.shazam.mac.Shazam)
# "Usernoted" = "user notifications daemon", getting its PID.
pid=$(ps aux | grep -i [u]sernoted | awk '{print $2}')
# Finding notification center db
@vkavun
vkavun / app.py
Created December 4, 2014 11:09
Flask server, that logs/dumps all http requests
from flask import Flask, request, current_app
from logging.handlers import RotatingFileHandler
import logging
app = Flask(__name__)
@app.route('/', defaults={'path': ''}, methods=["GET", "POST", "PUT", "DELETE"])
@app.route('/<path:path>', methods=["GET", "POST", "PUT", "DELETE"])
def catchall(path):
app.logger.info('PATH - ' + str(path))