Skip to content

Instantly share code, notes, and snippets.

View KorsaR-ZN's full-sized avatar

Stanislav Kiryukhin KorsaR-ZN

View GitHub Profile
@afonasev
afonasev / pycon2022.md
Last active July 5, 2024 07:09
Полезные материалы для доклада на pycon russia 2022
@hediet
hediet / main.md
Last active November 13, 2024 17:23
Proof that TypeScript's Type System is Turing Complete
type StringBool = "true"|"false";


interface AnyNumber { prev?: any, isZero: StringBool };
interface PositiveNumber { prev: any, isZero: "false" };

type IsZero<TNumber extends AnyNumber> = TNumber["isZero"];
type Next<TNumber extends AnyNumber> = { prev: TNumber, isZero: "false" };
type Prev<TNumber extends PositiveNumber> = TNumber["prev"];
@jced-artem
jced-artem / UopzTrait.php
Last active June 12, 2021 08:10
Wrapper for php uopz library's functions. Very useful for unit testing for changing function's behaviour in runtime.
<?php
/**
* Trait UopzTrait
*
* Useful wrapper for uopz library's functions
*/
trait UopzTrait
{
/**
@ikatson
ikatson / fswatch_propagate_pwd_changes_to_docker.sh
Created October 16, 2014 06:24
fswatch_propagate_pwd_changes_to_docker
function fswatch_propagate_pwd_changes_to_docker () {
echo "Starting fswatch on $PWD"
# tracking previous not to get into endless loop of changing the same file
local previous=''
fswatch -r "$PWD" | while read file; do
if [[ previous != "$file" ]]; then
docker run --rm -v "$PWD":"$PWD" busybox touch -c "$file"
fi
previous="$file"
done
@plentz
plentz / nginx.conf
Last active November 19, 2024 22:27
Best nginx configuration for improved security(and performance)
# to generate your dhparam.pem file, run in the terminal
openssl dhparam -out /etc/nginx/ssl/dhparam.pem 2048