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
# https://plantuml.com/text-encoding | |
# https://github.com/dougn/python-plantuml/blob/master/plantuml.py#L64 | |
import zlib | |
import base64 | |
maketrans = bytes.maketrans | |
plantuml_alphabet = string.digits + string.ascii_uppercase + string.ascii_lowercase + '-_' | |
base64_alphabet = string.ascii_uppercase + string.ascii_lowercase + string.digits + '+/' |
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: "5.3.255", BUILD_DATE: "2022-09-19T07:31:34.542Z", BUILD_NUMBER: "255", DEV: false*/ !function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.callus=t():e.callus=t()}(self,()=>(()=>{var leafPrototypes,getProto,__webpack_modules__={4537(e){"use strict";e.exports=function(e,t){for(var n=Array(arguments.length-1),i=0,a=2,r=!0;a<arguments.length;)n[i++]=arguments[a++];return new Promise(function(a,o){n[i]=function(e){if(r){if(r=!1,e)o(e);else{for(var t=Array(arguments.length-1),n=0;n<t.length;)t[n++]=arguments[n];a.apply(null,t)}}};try{e.apply(t||null,n)}catch(s){r&&(r=!1,o(s))}})}},7419(e,t){"use strict";var n=t;n.length=function(e){var t=e.length;if(!t)return 0;for(var n=0;--t%4>1&&"="===e.charAt(t);)++n;return Math.ceil(3*e.length)/4-n};for(var i=Array(64),a=Array(123),r=0;r<64;)a[i[r]=r<26?r+65:r<52?r+71:r<62?r-4:r-59|43]=r++;n.encode=function(e,t,n){for(var a,r=null,o=[],s=0,l=0;t<n;){va |
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: '3.9' | |
services: | |
mongodb_container: | |
image: mongo:latest | |
environment: | |
MONGO_INITDB_ROOT_USERNAME: root | |
MONGO_INITDB_ROOT_PASSWORD: rootpassword | |
ports: | |
- 27017:27017 | |
volumes: |
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
#!/usr/bin/env bash | |
for letter in {0..9} {a..z}; | |
do | |
files_array=() | |
if [ $(find "$1" -maxdepth 1 -type f -iname "$letter*" -print0| wc -c) -ne 0 ]; then | |
mkdir "$1""$(printf '%s\n' "$letter" | awk '{ print toupper($0) }')" > /dev/null | |
set +m | |
shopt -s lastpipe | |
find "$1" -maxdepth 1 -type f -iname "$letter*" -print0 | while IFS= read -r -d $'\0'; do files_array+=("$REPLY"); done; declare -p files_array > /dev/null |
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 export_xlsx(request): | |
response = HttpResponse(content_type='application/vnd.openxmlformats-officedocument.spreadsheetml.sheet') | |
response['Content-Disposition'] = 'attachment; filename="{}"'.format(self._fname) | |
# Excel configuration | |
# TODO add more formatting | |
workbook = xlsxwriter.Workbook(response, {'in_memory': True}) | |
worksheet = workbook.add_worksheet(self._sheet_name) | |
bold = workbook.add_format({'bold': True}) | |
row = 1 |
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 os | |
from Xlib import display | |
d = display.Display() | |
s = d.screen().root | |
output = os.popen("xrandr --listmonitors | grep '*' | awk {'print $4'}").read().splitlines() | |
num_sc = s.xinerama_get_screen_count().screen_count | |
width = s.get_geometry().width | |
height = s.get_geometry().height | |
print("Total count screens: %s" % num_sc) | |
for i in range(num_sc): |
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
#!/bin/bash | |
function confirm() { | |
# call with a prompt string or use a default | |
read -r -p "$(echo -e $1) Are you sure? [y/N] " response | |
case "$response" in | |
[yY][eE][sS]|[yY]) | |
true | |
;; | |
*) | |
false |
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
#!/bin/bash | |
# Exemple | |
# Choose your virtualenv for crispml: | |
# 1 reader | |
# 2 curses | |
# 3 twisted | |
function select_virtenv() { | |
echo "$1" |