Skip to content

Instantly share code, notes, and snippets.

View JosXa's full-sized avatar
💙

Joscha Götzer JosXa

💙
View GitHub Profile
@JosXa
JosXa / upgraderequirements.py
Created February 5, 2018 14:00
Upgrade all packages in requirements.txt
#!/bin/python3
"""
Small utility to upgrade all packages in a requirements.txt file in the current directory to the latest version as determined by a CLI call to `pip show {package}`.
"""
import sys
import re
import subprocess
filename = 'requirements.txt'
def echo(update, context: HandlerContext):
"""
Assumes that the context acts as a random-access key-value store so that the user can add
his or her own objects to be accessible in every callback
"""
# Automatically extracts the current peer in order to send formatted messages
context['formatter'].send_success("This has a green :white_checkmark: emoji") # ✅
context['formatter'].send_action_hint("Lightbulb business") # 💡
from pyrogram import Client
from tests.bots import get_userbot, get_bot
"""
Run this file with python3.5+ in order to log in to Pyrogram with a Telegram user account
interactively, creating a Pyrogram "session" file (json) in the process.
It will try to log into the provided account like every regular Telegram client does,
and you will be prompted for the login code.
import json
from abc import ABCMeta, abstractmethod
from pprint import pprint
from typing import List, TypeVar
import apiai
from dateutil.parser import parse
from core.understanding import MessageUnderstanding
from model import User
@JosXa
JosXa / HelloWorld.java
Created July 30, 2018 15:21 — forked from lolzballs/HelloWorld.java
Hello World Enterprise Edition
import java.io.FileDescriptor;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.OutputStream;
import java.io.PrintStream;
public class HelloWorld{
private static HelloWorld instance;
public static void main(String[] args){
instantiateHelloWorldMainClassAndRun();
@JosXa
JosXa / HelloWorld.java
Created July 30, 2018 15:21 — forked from lolzballs/HelloWorld.java
Hello World Enterprise Edition
import java.io.FileDescriptor;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.OutputStream;
import java.io.PrintStream;
public class HelloWorld{
private static HelloWorld instance;
public static void main(String[] args){
instantiateHelloWorldMainClassAndRun();
using System;
using System.Security.Cryptography.X509Certificates;
using System.Text;
using System.Text.RegularExpressions;
using System.Threading.Tasks;
using JetBrains.Annotations;
using Microsoft.Azure.Services.AppAuthentication;
using Microsoft.Azure.KeyVault;
namespace MyNamespace
import asyncio
from asyncio import CancelledError, Future
from dataclasses import dataclass
from datetime import datetime, timedelta
from typing import Optional
from haps import Inject
from pyrogram import filters
from app.clients.botclient import BotClient
# -*- coding: utf-8 -*-
""":mod:`itertools` is full of great examples of Python generator
usage. However, there are still some critical gaps. ``iterutils``
fills many of those gaps with featureful, tested, and Pythonic
solutions.
Many of the functions below have two versions, one which
returns an iterator (denoted by the ``*_iter`` naming pattern), and a
shorter-named convenience form that returns a list. Some of the
following are based on examples in itertools docs.
C:\Users\INT002327\AppData\Local\pypoetry\Cache\virtualenvs\josxabot-c3BmTbt9-py3.8\Scripts\python.exe C:/projects/josxabot/app/modules/vokabeltrainer/parser/pars.py
2. Word(german='Abfahrt', word_type=<WordType.noun: 'Nomen'>, gender=<Gender.female: 'die'>, plural=None, examples=['Vor der Abfahrt rufe ich an.'])
2. Word(german='Absender', word_type=<WordType.noun: 'Nomen'>, gender=<Gender.male: 'der'>, plural=None, examples=['Da ist ein Brief für dich ohne Absender.'])
2. Word(german='Adresse,-en', word_type=<WordType.noun: 'Nomen'>, gender=<Gender.female: 'die'>, plural=None, examples=['Können Sie mir seine Adresse sagen?'])
2. Word(german='Alter', word_type=<WordType.noun: 'Nomen'>, gender=<Gender.neutral: 'das'>, plural=None, examples=['Alter: 26 Jahre.'])
1. Word(german='Angebot,', word_type=<WordType.noun: 'Nomen'>, gender=<Gender.neutral: 'das'>, plural='-e', examples=['Heute sind Sportschuhe im Angebot.'])
2. Word(german='Anfang', word_type=<WordType.noun: 'Nomen'>, gender=<Gender.male: 'der'>, plural