This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <!-- I was recently asked what license this code is under. Since it is fairly trivial code, | |
| I don't really feel it "deserves" a "real" license, so I am hereby placing it in the public domain. | |
| In countries where this is not posible, I am placing it under Creative Commons CC0 | |
| (https://creativecommons.org/publicdomain/zero/1.0/), which is basically just a more formal way of | |
| putting it in the public domain for people who like to be sure. | |
| If you want to credit me anyway, that is of course fine with me :) --> | |
| <!DOCTYPE html> | |
| <html> | |
| <body> | |
| <div id="renderDiv" style='font-family:"Lucida Console", Monaco, monospace' /> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| let | |
| moz_overlay = import (builtins.fetchTarball | |
| "https://github.com/oxalica/rust-overlay/archive/master.tar.gz"); | |
| nixpkgs = import <nixpkgs> { overlays = [ moz_overlay ]; }; | |
| in { pkgs ? nixpkgs }: | |
| pkgs.mkShell { | |
| name = "rust env"; | |
| buildInputs = with pkgs; [ | |
| (rust-bin.stable.latest.default.override { | |
| # extensions = [ "rust-src" ]; # for rust-analyzer |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| ''' | |
| // 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; | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| % 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} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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 | |
| ''' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| openssl genrsa $((1024*16)) | openssl rsa -text | |
| python3 -c "import re;print(int(''.join(re.split('[:\s ]', open(0).read())), 16))" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/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): |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/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 | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/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 |