Skip to content

Instantly share code, notes, and snippets.

View Nircek's full-sized avatar

Marcin Zepp Nircek

View GitHub Profile
'''
// SRC: https://klimapoint.pl/kalkulator-wilgotnosci-bezwzglednej/ z htmla po prostu
// temp - temperatura w °C (-20 - 50)
// rh - wilgotność względna w % (1 - 100)
function getDP(temp, rh) {
var h = ((Math.log10(rh)-2)/0.4343) + ((17.62*temp)/(243.12+temp));
h = ((243.12*h)/(17.62-h));
return Math.round(h*100)/100;
}
s() { g++ -O2 $1.cpp; for e in $([ -z "$2" ] && echo ./$1/data/sample/*.ans || echo ./$1/data/*/*.ans); do f=${e%.*}; echo $f.in; diff -wyBIEZ $f.ans <(./a.out < $f.in); done }; s bob; # s bob 1
% src: https://www.youtube.com/watch?v=fCzF5gDy60g
1)
\documentclass{article} % albo beamer
\usepackage[margin=1.25in]{geometry}
\usepackage{amsmath, amssymb} % do jakiejkolwiek matmy
\usepackage{graphicx} % do wstawiania obrazków
\begin{document}
\begin{center} \end{center}
@Nircek
Nircek / maze_generator.py
Created August 27, 2022 15:26 — forked from Marwyk2003/maze_generator.py
Maze generation algorithm using iterative dfs
from random import shuffle, randint
from PIL import Image
def generate_maze(X, Y):
'''
Generate a maze and return its walls
Return type (x_walls, y_walls)
x_walls/y_walls - bool array, True = wall, False = no wall
x_walls/y_walls ordered from left to right / top to bottom
'''
openssl genrsa $((1024*16)) | openssl rsa -text
python3 -c "import re;print(int(''.join(re.split('[:\s ]', open(0).read())), 16))"
@Nircek
Nircek / task-roulette.py
Last active March 6, 2022 13:04
Dynamic task roulette
#!/usr/bin/env python3
import random
import shutil
import math
N = 100
bag, weights = [], []
W = shutil.get_terminal_size((80, 20))[0]
class BreakException(Exception):
#!/bin/bash
function confirm() {
# https://stackoverflow.com/a/1885534/6732111
read -p "Is it ok? " -n 1 -r
echo # (optional) move to a new line
if [[ ! $REPLY =~ ^[Yy]$ ]]
then
[[ "$0" = "$BASH_SOURCE" ]] && exit 1 || return 1 # handle exits from shell or function but don't exit interactive shell
fi
}
@Nircek
Nircek / split.py
Last active December 24, 2021 22:46
split audio files not evenly
#!/usr/bin/env python3
# Copyright 2021 Marcin Zepp <nircek-2103@protonmail.com>
# SPDX-License-Identifier: MIT
import sys
import subprocess
import re
import math
opus, oldmagic, quiet, magic = False, False, True, True
SuperBackup -- wyizolowany.zip/New Text Document.txt:$zip2$*0*3*0*9d8b65bd625853b3cdd279cdba545f97*3546*3e8*6834b1c27b44ddde6d3dbff7c736cfb0b6fe4c5fca6fe5238ff214b7e15c81d313375404950301a0f355cb86177ce40579fb38fd5e28291e8c1a50ddb31c8a37d13353d25b0e17728c58d730fea55d4f2f7cba3acc2e439c88f7924193e19d4b2455e2ef8bc171e28c2eb259a2f9b583c439e449af1b3a514ac0b9e93e522afb5ac2430128ce94f28eadb4e54e1b74d44d1cc8da47e57f615a0b9b2ccf061805bcc54c40a1b8b79a0b2b38896c972ff619c2a76d2ee785bb7555da6ab3b9b1ab089591e86b7c6f0ca693a1b7e549d388a63242576606bd5271e065f966e84a371b1a7c9d6b0e007affa668900196f4b39c24f0932ca551b6fb5de07e625d90a1ad930d4cb49844e0f918d497ae9dc8db4b2b9d02abf1ba7a36400efd499590b85a5d8f16def72f0d1c4b49953df839dfa6587f5559ee7a862d53759932fe4006f480fa0540ff06192a38ffe083cb585a3c2f86f56eb66958b460055eb1a86f46700d4bf5e3ff89002922345a75f14e2859799d8746b7d5378c9a9be7c10c74ca78153162275a3c0dd0b31bc95bba36670360f86aee075bc0b9a630faad4bef64c88f397ffbbe3fb92c041df20156aef44b0179768fa7e6adec3cd575e144f604f7715a163f15d766eeb2
@Nircek
Nircek / dancing-deno.svg
Created July 18, 2021 20:50
Dancing dinosaurs
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.