Skip to content

Instantly share code, notes, and snippets.

View MasterGroosha's full-sized avatar

Aleksandr MasterGroosha

View GitHub Profile
@MasterGroosha
MasterGroosha / config.py
Created October 31, 2018 22:41
Simple Telegram Desktop version checker. Notifications are sent to Telegram channel of your choice.
# -*- coding: utf-8 -*-
# Bot token, obtain from @BotFather
token = "1234567890:AAabcdefghzzzzzzzzz"
# Vedis database file name (created automatically)
db_name = "data.vdb"
# ID of target channel
channel = -1001234567890
@MasterGroosha
MasterGroosha / TelegramConfigWatcher.py
Last active October 14, 2017 17:40
Watch Telegram server config change.
# -*- coding: utf-8 -*-
import re
import ujson
import telebot
from telethon import TelegramClient
from telethon.tl.functions.help import GetConfigRequest
from vedis import Vedis
bot = telebot.TeleBot("token") # Your Telegram bot token
@MasterGroosha
MasterGroosha / wface.c
Created August 9, 2017 18:20
Pebble watchface condensed
#include <pebble.h>
static Window *s_main_window;
static TextLayer *s_time_layer;
static TextLayer *s_date_layer;
static GFont s_time_font;
static GFont s_date_font;
static char date_text[32];
#NoEnv
#SingleInstance force
SendMode Input
SetWorkingDir %A_ScriptDir%
#Include AHKHID.ahk
;Set up the constants
AHKHID_UseConstants()
#NoEnv ; Recommended for performance and compatibility with future AutoHotkey releases.
; #Warn ; Enable warnings to assist with detecting common errors.
SendMode Input ; Recommended for new scripts due to its superior speed and reliability.
SetWorkingDir %A_ScriptDir% ; Ensures a consistent starting directory.
#SingleInstance force
ShowHelp()
{
Gui, New, 2 ; Creates a new unnamed and unnumbered GUI.
@MasterGroosha
MasterGroosha / VkNoAdsInFeed.user.js
Last active August 29, 2015 14:21
Remove Ads in user's feed in Vk.com
// ==UserScript==
// @name Vk HateAds
// @namespace none
// @version 1.1
// @description Remove ads inside user's feed in Vk.com
// @author Master_Groosha
// @match https://*vk.com/*
// @grant none
// ==/UserScript==
/*************
* lasers.js *
*************
*
* Time to unleash the killer lasers! Each laser will kill you
* unless you have the appropriate color. Too bad you can't
* see which color corresponds to which laser!
*/
function getRandomInt(min, max) {
/**************************
* exceptionalCrossing.js *
**************************
*
* Sorry, old friend, but I'm afraid I can't share
* co-authorship on this paper. You've done a very
* good job getting this Algorithm for me. The bit
* with the keys was especially clever! I wouldn't
* have thought of it myself. But then, of course,
* that's why you were here in the first place.
/********************
* crispsContest.js *
********************
*
* The Algorithm is almost in our grasp!
* At long last, we will definitively establish
* that 3SAT is solvable in polynomial time. It's
* been a long, strange journey, but it will all be
* worth it.
*
/*
* robotMaze.js
*
* The blue key is inside a labyrinth, and extracting
* it will not be easy.
*
* It's a good thing that you're a AI expert, or
* we would have to leave empty-handed.
*/