Skip to content

Instantly share code, notes, and snippets.

View slntopp's full-sized avatar

Mikita Iwanowski slntopp

View GitHub Profile
@slntopp
slntopp / 1-setup.md
Created July 30, 2024 19:40 — forked from troyfontaine/1-setup.md
Signing your Git Commits on MacOS

Methods of Signing Git Commits on MacOS

Last updated March 13, 2024

This Gist explains how to sign commits using gpg in a step-by-step fashion. Previously, krypt.co was heavily mentioned, but I've only recently learned they were acquired by Akamai and no longer update their previous free products. Those mentions have been removed.

Additionally, 1Password now supports signing Git commits with SSH keys and makes it pretty easy-plus you can easily configure Git Tower to use it for both signing and ssh.

For using a GUI-based GIT tool such as Tower or Github Desktop, follow the steps here for signing your commits with GPG.

@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
Last active May 14, 2024 13:19
VS Code Regex to Replace On With Expect clause (mockery)

Find and replace all mock.On to Expecter

Find all:

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

Replace with:

@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);