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
""" Copy a file with callback (E.g. update a progress bar) """ | |
# based on flutefreak7's answer at StackOverflow | |
# https://stackoverflow.com/questions/29967487/get-progress-back-from-shutil-file-copy-thread/48450305#48450305 | |
# License: MIT License | |
import os | |
import pathlib | |
import shutil |
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://gist.github.com/timabell/bc90e0808ec1cda173ca09225a16e194 | |
# MIT license | |
$exts=@( | |
"csv", | |
"csproj", | |
"json", | |
"log", | |
"md", | |
"patch", | |
"sql", |
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 | |
# usage: export_to_csv.sh <database.sqlite> | |
sqlite3 $1 "SELECT tbl_name FROM sqlite_master WHERE type='table' and tbl_name not like 'sqlite_%';" | while read table; do | |
echo $table | |
sqlite3 $1 <<! | |
.headers on |
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 time | |
def highlight(element): | |
"""Highlights (blinks) a Selenium Webdriver element""" | |
driver = element._parent | |
def apply_style(s): | |
driver.execute_script("arguments[0].setAttribute('style', arguments[1]);", | |
element, s) | |
original_style = element.get_attribute('style') | |
apply_style("background: yellow; border: 2px solid red;") |