This file contains 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
# Path to your oh-my-zsh configuration. | |
export ZSH=$HOME/.oh-my-zsh | |
# Set name of the theme to load. | |
# Look in ~/.oh-my-zsh/themes/ | |
# Optionally, if you set this to "random", it'll load a random theme each | |
# time that oh-my-zsh is loaded. | |
#export ZSH_THEME="robbyrussell" | |
export ZSH_THEME="gnzh" |
This file contains 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
import datetime as dt | |
from sqlalchemy import Column, Integer, DateTime | |
from sqlalchemy.engine import create_engine | |
from sqlalchemy.orm import sessionmaker | |
from sqlalchemy.ext.declarative import declared_attr, declarative_base | |
from db.config import SQLA_URL | |
engine = create_engine(SQLA_URL, echo=True) |
This file contains 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
session = Session() | |
# Explicitly mention the tables having foreign key then concrete classes. | |
tables = [UserEmail, UserPermission, User, GroupPermission, Permission, Role, GroupMember, Group] | |
for table in tables: | |
session.query(table).delete() | |
session.commit() | |
print(table, 'data deleted') |
This file contains 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
def list_objects( | |
bucket_name: str, folder_name: str | |
) -> None: | |
""" This function takes a S3 bucket name and optionally folder name | |
and returns a sorted list of objects inside S3 | |
Args: | |
bucket_name ([string]): Name of the S3 bucket | |
folder_name ([string]): Sub folder inside S3 (optional) | |
""" |
This file contains 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
import unittest | |
class SequentialTestCaseLoader(unittest.TestLoader): | |
""" | |
The python's unittest library executes the tests in alphabetical order | |
to override this behaviour and execute tests in (defined) order. | |
Use `unittest.main(testLoader=SequentialTestCaseLoader())` to | |
the trigger execution. | |
""" | |
def getTestCaseNames(self, tcCls): |
This file contains 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
<?xml version="1.0" encoding="UTF-8"?> | |
<CLISH_MODULE xmlns="http://clish.sourceforge.net/XMLSchema" | |
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | |
xsi:schemaLocation="http://clish.sourceforge.net/XMLSchema | |
http://clish.sourceforge.net/XMLSchema/clish.xsd"> | |
<!--=======================================================--> | |
<PTYPE name="STRING" | |
pattern="[^\-]+" | |
help="String"/> |
This file contains 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
{ | |
"version": "2.0.0", | |
"created_on": "2021-06-28T17:29:37.714428", | |
"module": { | |
"name": "network", | |
"source_file": "network.xml", | |
"commands": [ | |
{ | |
"cmd": "network show", | |
"meta": { |
This file contains 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
<?xml version="1.0" encoding="UTF-8"?> | |
<CLISH_MODULE xmlns="http://clish.sourceforge.net/XMLSchema" | |
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | |
xsi:schemaLocation="http://clish.sourceforge.net/XMLSchema | |
http://clish.sourceforge.net/XMLSchema/clish.xsd"> | |
<COMMAND name="network show" | |
help="Show currently added devices"> | |
<ACTION>network show</ACTION> | |
</COMMAND> |
This file contains 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
0. START | |
1. Traverse the CmdTree node from the root CALL process_node(CmdTree.root) | |
2. START process_node: | |
If the CmdNode is not a leaf node then | |
2.1. Process all the child nodes of the current node first. CALL process_node(node) | |
2.2. After processing all child CmdNode. Set current node visibility | |
If all the childs are removed then | |
node.visible = False | |
Else | |
node.visible = True |
This file contains 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
function loadenv() { | |
if [ -f .env ]; | |
then | |
source .env | |
fi | |
} | |
loadenv | |
function cd() { |
OlderNewer