Skip to content

Instantly share code, notes, and snippets.

View slntopp's full-sized avatar
🚙

Mikita Iwanowski slntopp

🚙
View GitHub Profile
@slntopp
slntopp / ttf-to-png.py
Last active February 19, 2024 15:47
Convert ttf pack into (png) images, quick
from PIL import Image, ImageFont, ImageDraw
characters = "abcdefghijklmnopqrstuvwxyz0123456789"
capitalized_characters = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
special_characters = ".:(*!?{}})#$%*&-+@"
special_characters_names = {
".": "period",
":": "colon",
"(": "left_parenthesis",
"*": "asterisk",
@slntopp
slntopp / pattern.md
Created February 16, 2024 16:31
VS Code Regex to Replace On With Expect clause (mockery)

Find all:

On\("(.+)",\s

Replace with:

EXPECT().$1(
@slntopp
slntopp / BASH.md
Created January 28, 2022 12:53
Some well-known bash tricks I tend to forget sometimes

Files Manipulation

Editing

Filter file for unique lines

awk '!a[$0]++' file

Keybase proof

I hereby claim:

  • I am slntopp on github.
  • I am slnt_opp (https://keybase.io/slnt_opp) on keybase.
  • I have a public key ASD9bj1mdsh-i_CXeEPjSodKMyWvBZ_5QGuNlnz2TI8P8Qo

To claim this, I am signing this object:

@slntopp
slntopp / kata.cpp
Last active July 13, 2021 12:24
Codewars Kata Attempt | Number of Proper Fractions with Denominator d | C++
unsigned long long properFractions(unsigned long long n) {
if(n == 1) return 0;
unsigned long long d = n;
for(unsigned long long i = 2; i * i <= d; i++) {
if(d % i == 0) {
n = n / i * (i - 1);
while(d % i == 0) d /= i;
}
}
if (d > 1) n = n / d * (d - 1);