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
Stack = (lambda _stack, _example: _stack, lambda _stack, _example: print(_example))[__name__ == '__main__'](((EmptyStack := type("EmptyStack", (), {})), (_stack := type("Stack", (), {'__init__': lambda self: setattr(self, "__stack", []), 'add': lambda self, item: (self.__stack.append(item), self)[1], 'peek': lambda self: self.__stack[-1] if len(self.__stack) else EmptyStack(), 'pop': lambda self: self.__stack.pop() if len(self.__stack) else EmptyStack(), '__len__': lambda self: len(self.__stack), '__iter__': lambda self: iter(self.pop() for _ in self.__stack), '__repr__': lambda self: "<Stack(%s)>" % ', '.join(repr(item) for item in self.__stack), '__list__': lambda self: list(self.__stack)})))[1], _stack().add("Hello").add("world")) |
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
cd .. | |
venv\Scripts\python.exe -m setup sdist bdist_wheel | |
venv\Scripts\python.exe -m twine check dist/* | |
venv\Scripts\python.exe -m twine upload --repository-url https://upload.pypi.org/legacy/ dist/* -u %1 -p %2 --skip-existing |
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
pip install pipenv :: Install pipenv | |
cd your_project :: Going to your project | |
pipenv shell :: Initializing and entering shell | |
pipenv install %1 :: install any package in your isolated env now | |
pip freeze :: This will show pipenv's modules if shell is activated |
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
drop function if exists create_server; | |
delimiter $$ | |
CREATE FUNCTION create_server(server_name varchar(50), user_id int) | |
RETURNS int | |
DETERMINISTIC | |
BEGIN | |
INSERT INTO server(name, owner_id) VALUES (server_name, user_id); | |
return last_insert_id(); |
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
build: | |
environment: | |
python: | |
version: 3.8.6 | |
virtualenv: true | |
checks: | |
python: | |
code_rating: true | |
duplicate_code: true |
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 string import ascii_lowercase | |
from time import perf_counter | |
from typing import Tuple, Generator, List | |
CHARSET_LENGTH = len(ascii_lowercase) | |
Pair = Tuple[int, int] | |
Key = Tuple[int, int, int, int] | |
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
SHELL := /bin/bash | |
SERVER_PATH := /srv/http | |
ARROW := \033[1m\033[31m>\033[32m>\033[33m>\033[39m | |
CL_GREEN := \033[32m | |
CL_RESET := \033[39m | |
local: |
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: /; | |
.. { | |
string: ""; | |
? i --- // :: \ { | |
string+: "fizz"; | |
} | |
? i --- /\/ :: \ { | |
string+: "buzz"; | |
} |
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
name: 🚀 Deploy website on push | |
on: | |
workflow_dispatch: | |
push: | |
branches: | |
- master | |
jobs: | |
web-deploy: | |
name: 🎉 Deploy |
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
# - lolcat suffix check - | |
COLOR := $(shell command -v lolcat) | |
ifeq (, $(COLOR)) | |
COLOR= | |
else | |
COLOR= |lolcat | |
endif | |
# ---------------------- |
OlderNewer