Skip to content

Instantly share code, notes, and snippets.

@thegame4craft
thegame4craft / gist:8264b4479444f508889f8a20fff95ece
Created April 23, 2023 11:54
Nextcloud Pterodactyl config in root
upstream php-handler {
server 127.0.0.1:9000;
#server unix:/var/run/php/php7.4-fpm.sock;
}
# Set the `immutable` cache control options only for assets with a cache busting `v` argument
map $arg_v $asset_immutable {
"" "";
default "immutable";
}
@thegame4craft
thegame4craft / main.py
Last active October 25, 2022 15:32
This Gist contains one function and a decorator. As you see in the example, you do not need an `if __name__ == "__main__:" to call any statement.`
def mainFunc(func): # func is the function
result = func() # which should be called at begin.
# Note: Python executes the file from top to bottom. so every statment that is not in a function (like
# `print`) will be executed before the main function if it is earlyer defined
def wrapper():
nonlocal result
print(result) # print the result
return result # and return it