Skip to content

Instantly share code, notes, and snippets.

"""
Creates a CSV file to import passwords into BitWarden from an array
Usage:
- Download this file to a folder in your computer
- Change the file as you wish to add more account entries
- "cd" into the chosen download directory with the Terminal
- Run "python3 generate_bitwarden_import_file.py"
- A file called "generated_passwords.csv" will be created in the same directory
"""
This script generates a sidebar structure for Docsify (https://docsify.js.org/)
projects. It's intended as a way to make the sidebar a little more
straight-forward but the result will probably need some re-arranging.
Usage:
- Download this file to your project's directory
- "cd" into that directory
- Run "python3 generate_sidebar.py"
@pnettto
pnettto / png_to_jpg.py
Created May 22, 2017 21:14
Transform all png images in a directory to jpg
# Transform png image to jpg
imgs = []
path = "/path/containing/png/files"
valid_images = [".png"]
for f in os.listdir(path):
ext = os.path.splitext(f)[1]
if ext.lower() not in valid_images:
continue
imgs.append({
'name': f,
@pnettto
pnettto / download_images_from_csv.py
Created May 22, 2017 21:12
Download images from csv
# Download images from csv
with open('file.csv', 'rb') as myFile:
reader = csv.reader(myFile, delimiter=',')
for row in reader:
if row[5] != 'Images':
command = 'wget ' + row[5].split('?')[0]
subprocess.Popen(command.split(), stdout=subprocess.PIPE)