Skip to content

Instantly share code, notes, and snippets.

View mishankov's full-sized avatar
💻
hacking

Denis Mishankov mishankov

💻
hacking
  • Alfa-Bank
  • Moscow
View GitHub Profile
@mishankov
mishankov / macro.nim
Created November 25, 2023 21:08
Nim macro play
import macros, strutils
macro route(path: untyped, s: untyped): untyped =
let pathParts = path.strVal().split("/")
let functionName = pathParts[1]
var pathVars: seq[string] = @[]
for pathPart in pathParts:
if pathPart.startsWith("{"):
@mishankov
mishankov / telegram.py
Last active December 27, 2020 12:14
Class with base methods for Telegram API
import requests
class Bot:
def __init__(self, token):
self.token = token
self.url = "https://api.telegram.org/bot{}".format(self.token)
def get_me(self):
@mishankov
mishankov / pushover.py
Created August 3, 2019 07:46
Pushover api wrapper
import requests
class Pushover:
def __init__(self, token):
self.token = token
self.message_url = 'https://api.pushover.net/1/messages.json'
def send_message(self, user, message, title=None, url=None, url_title=None, html=0, token=None):
params = dict(