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
from bs4 import BeautifulSoup | |
import os | |
xml = '<?xml version="1.0" encoding="UTF-8"?>'\ | |
'<FictionBook xmlns="http://www.gribuser.ru/xml/fictionbook/2.0" xmlns:l="http://www.w3.org/1999/xlink">'\ | |
'<description>'\ | |
' <title-info>'\ | |
' <genre>foreign_prose</genre>'\ | |
' <genre>literature_20</genre>'\ | |
' <author>'\ |
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
#include <QLoggingCategory> | |
#include <QSqlQuery> | |
#include <QSqlError> | |
Q_LOGGING_CATEGORY(hfCoreM, "hf.core.migration"); | |
QString getOneTableDbSchema(QString table_name) { | |
auto q = QString( | |
"SELECT * FROM `sqlite_master` WHERE `type` = 'table' AND `name` = '%1'").arg(table_name); |
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 get_setting_value { | |
declare SECTION=$1 | |
declare KEY=$2 | |
sed -nr '/\['$SECTION\]'/,/\[.*\]/{/'$KEY'/s/(.*)=(.*)/\2/p}' "$INI_FILE" | |
} | |
function set_setting_value { | |
declare SECTION=$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
perl -pe 's/\e\[?.*?[\@-~]//g' |
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
Remote: | |
ssh.exe -R 1333:10.50.2.1:722 kahuna@8.8.8.8 | |
Add port from current scope to remote machine. Where: | |
1333 - port in remote scope | |
10.50.2.1:722 - port in current scope | |
kahuna@8.8.8.8 - remote machine(ssh server) | |
Local: | |
ssh -L 127.1:1333:127.1:3128 kahuna@8.8.8.8 |
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 | |
# Create clone of SUBMODULE based git repository(BASE) convering it to SUBREPO repository(TARGET). | |
# | |
# Use this script with care it can make severe changes both to TARGET and to BASE. | |
# | |
# Call it from directory of TARGET, with path to BASE. | |
# On a go, script make changes to BASE, creating branches named MODULAR_PRJ_NAME/ROOT_BRANCH_NAME for each submodule. | |
# It overrides already existing ones! | |
# In TARGET project it creates remote named 'modular', if there is alredy one - it is overrided! |
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
scratchpad.patch for dwm 5.9 | |
A scratchpad is a window that is assigned the (hidden) scratchtag. | |
A window becomes a scratchpad if its WM_NAME at its creation time is the value | |
of the scratchpadname variable. | |
togglescratchpad() is actually a variant of toggleview(). | |
To use this, put the following definitions in config.h: | |
static const char scratchpadname[] = "Scratchpad"; /* make it unique, avoid name collision */ | |
static const char *scratchpadcmd[] = { "uxterm", "-title", scratchpadname, "-geometry", "80x20", NULL }; /* WM_NAME must be scratchpadname */ |