Skip to content

Instantly share code, notes, and snippets.

View mb6ockatf's full-sized avatar

Walter White mb6ockatf

View GitHub Profile
#!/usr/bin/env python3
from requests import post
from itertools import permutations
from string import ascii_lowercase, digits
import sys
from telethon import TelegramClient
from telethon.tl.functions.users import GetFullUserRequest
import asyncio
@mb6ockatf
mb6ockatf / tyler_durden.list
Created May 11, 2024 13:22
list of Tyler Durden's citations for fortune-mod
The things you own end up owning you
-- Tyler Durden
%
It's only after we've lost everything that we're free to do anything
-- Tyler Durden
%
Reject the basic assumptions of civilization—especially the importance of
material possessions
-- Tyler Durden
%
@mb6ockatf
mb6ockatf / grayscale.py
Last active April 13, 2024 12:53
convert image to grayscale
#!/usr/bin/env python3
from PIL import Image
img = Image.open('image.jpg').convert('L')
img.save('greyscale.jpg')
@mb6ockatf
mb6ockatf / 3.py
Last active April 13, 2024 09:08
#!/usr/bin/env python3
def is_n_digit(number: int, digits: int) -> bool:
return len(str(abs(number))) == digits
file = open("17.txt", "r")
numbers = list(map(int, file.readlines()))
max_strange_num = 0
for element in numbers:
if not str(element).endswith("15"):
@mb6ockatf
mb6ockatf / logarithm.jl
Created March 23, 2024 09:02
use newton method to count logarithms; monte-carlo method to compute pi digits; compute square roots with given precision
#!/usr/bin/julia
using Test
const EPS = 1e-11
function log_core(base::Float64, n::Float64)
x = 1
step = 1
while step > EPS
while base ^ x < n
@mb6ockatf
mb6ockatf / .gitattributes
Last active June 8, 2024 22:00
github linguist no more ignores certain languages
*.md linguist-documentation=false
*.md linguist-detectable
*.adoc linguist-documentation=false
*.adoc linguist-detectable
*.rst linguist-documentation=false
*.rst linguist-detectable
*.sql linguist-documentation=false
*.sql linguist-detectable
*.creole linguist-documentation=false
*.creole linguist-detectable
@mb6ockatf
mb6ockatf / iss.sh
Created March 21, 2024 15:52
iss coords writer in bash
while [ 1 ]
do
p=$(date +%Y)/$(date +%m)/$(date +%d)/$(date +%H)
mkdir -p $p
out=$p/$(date +%s).txt
curl "http://api.open-notify.org/iss-now.json" > $out
git add -A
git commit -m "changed $(date +%s)"
git push
date
for file in *.jpg.jpg; do
mv -- "$file" "${file%.jpg.jpg}.jpg"
done
#!/usr/bin/julia
const eps = 1e-40;
function log_2(n::Int64)
x = 1;
previous = 0;
while abs(2 ^ x - n) > eps
println(x);
x = (x + n / x) / 2;
@mb6ockatf
mb6ockatf / pool.c
Last active February 11, 2024 14:10
strstr does not work properly
#include <stdio.h>
#include <string.h>
char tracks[][80] = {
"I left my heart in Harvard Med School",
"Newark, Newark - a wonderful town",
"Dancing with a Dork",
"From here to maternity",
"The girl from Iwo Jima",
};