Package-1/namespace/__init__.py
Package-1/namespace/module1/__init__.py
Package-2/namespace/__init__.py
Package-2/namespace/module2/__init__.py
with
- Package-1
- Package-2
# to add into .bashrc | |
clean_docker() { | |
# Delete all stopped container | |
docker rm $(docker ps -qa --no-trunc --filter "status=exited"); | |
# Delete intermediate images not referenced | |
docker rmi $(docker images --filter "dangling=true" -q --no-trunc) | |
} |
#!/bin/sh | |
#Git recursive | |
# Apply a command to all sub git directories | |
rootpath=. | |
cmd=$* | |
CLREOL=$'\x1B[K\033[0m' |
list_to_chunk = [1,2,3,4,5,6,7,8,9,10] | |
number_of_items_per_chunk = 2 | |
for i in range(0, len(list_to_chunk), number_of_items_per_chunk): | |
print("CHUNK %s"%i) | |
chunk = list_to_chunk[i:i + number_of_items_per_chunk] | |
# Action to perform on each chunk here |
#!/bin/bash | |
/etc/ppp$ /opt/vc/bin/vcgencmd measure_temp|cut -c6-9 |
du -hsx * | sort -rh | head -10 |
Package-1/namespace/__init__.py
Package-1/namespace/module1/__init__.py
Package-2/namespace/__init__.py
Package-2/namespace/module2/__init__.py
with
awk '{s+=$1} END {printf "%.0f", s}' mydatafile |
#Git recursive | |
# Apply a command to all sub git directories | |
gr() { | |
rootpath=`pwd`/ | |
cmd=$* | |
if [ $# -eq 0 ]; then | |
echo "Multiline (Add empty line to end the input)" |
class Singleton(type): | |
_instances = {} | |
def __call__(cls, *args, **kwargs): | |
if cls not in cls._instances: | |
cls._instances[cls] = super(Singleton, cls).__call__(*args, **kwargs) | |
return cls._instances[cls] | |
#Python2 | |
class MyClass(BaseClass): | |
__metaclass__ = Singleton |