Skip to content

Instantly share code, notes, and snippets.

View muhammedfurkan's full-sized avatar
🙃

M.Furkan muhammedfurkan

🙃
View GitHub Profile
@bot.on(admin_cmd(pattern="goup ?(.*)"))
async def goup(event):
await event.edit("`Progressing`")
input_str = event.pattern_match.group(1)
reply = await event.get_reply_message()
if reply:
file_name = await event.client.download_media(
reply.media,
Config.TMP_DOWNLOAD_DIRECTORY
)
import logging
import aiohttp
from sample_config import Config
from userbot import bot
from userbot.util import admin_cmd
logging.basicConfig(format='[%(levelname) 5s/%(asctime)s] %(name)s: %(message)s',
level=logging.WARNING)
logger = logging.getLogger(__name__)
@muhammedfurkan
muhammedfurkan / main.c
Created January 15, 2021 18:08
Write a C program that saves the name,surname,midterm grade,final grade information of 10 students entered on the keyboard into a file named "notes.txt"
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#define BUFFER_SIZE 500
int main()
{
// buffer to store data in buffer between writing to file
char buffer[BUFFER_SIZE];
char ch; // To store single character
int numStudents;
@muhammedfurkan
muhammedfurkan / FastTelethon.py
Created April 28, 2022 08:22 — forked from painor/FastTelethon.py
This will increase the download/upload speed when using telethon
# copied from https://github.com/tulir/mautrix-telegram/blob/master/mautrix_telegram/util/parallel_file_transfer.py
# Copyright (C) 2021 Tulir Asokan
import asyncio
import hashlib
import inspect
import logging
import math
import os
from collections import defaultdict
from typing import Optional, List, AsyncGenerator, Union, Awaitable, DefaultDict, Tuple, BinaryIO
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from __future__ import print_function
import sys
if (sys.version_info < (3, 0)):
# Python 3 code in this block
print('Python v3.5 or above required for Instaloader module at the moment. Exiting...')
quit()
@muhammedfurkan
muhammedfurkan / StreamTapeAPI.py
Last active April 30, 2022 12:08
StreamTapeAPI with python fully async
import asyncio
import hashlib
import aiohttp
from pyonize import pyonize
class StreamTapeAPI():
def __init__(self, login, key):
def prettyjson(obj, indent=2, maxlinelength=80):
"""Renders JSON content with indentation and line splits/concatenations to fit maxlinelength.
Only dicts, lists and basic types are supported"""
items, _ = getsubitems(obj, itemkey="", islast=True,
maxlinelength=maxlinelength - indent, indent=indent)
return indentitems(items, indent, level=0)
def getsubitems(obj, itemkey, islast, maxlinelength, indent):
@muhammedfurkan
muhammedfurkan / js-turkish-to-english.js
Created June 17, 2022 08:09 — forked from enginkartal/js-turkish-to-english.js
Javascript Turkish character to english characters change
String.prototype.turkishtoEnglish = function () {
return this.replace('Ğ','g')
.replace('Ü','u')
.replace('Ş','s')
.replace('I','i')
.replace('İ','i')
.replace('Ö','o')
.replace('Ç','c')
.replace('ğ','g')
.replace('ü','u')
@muhammedfurkan
muhammedfurkan / odev1.py
Last active June 21, 2022 18:45
odev 1 çözüm
data = {
"pazartesi": 0,
"sali": 0,
"carsamba": 0,
"persembe": 0,
"cuma": 0,
"cumartesi": 0,
"pazar": 0,
"toplam": 0,
}
@muhammedfurkan
muhammedfurkan / example.com
Created September 26, 2022 06:39
NGINX installation with Let's Encrypt
server {
root /var/www/html;
index index.html index.htm index.nginx-debian.html;
server_name example.com;
include /etc/nginx/mime.types;
}
server {
if ($host = example.com) {