Skip to content

Instantly share code, notes, and snippets.

View BaderSZ's full-sized avatar

Bader Zaidan BaderSZ

View GitHub Profile
@BaderSZ
BaderSZ / scribus_bulk_export_pdf.py
Last active July 7, 2023 13:23
Bulk convert a selection of Scribus files to PDF
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# need the following for PyQt linting
# pylint: disable=c-extension-no-member
"""bulk_export_pdf.py
Bulk convert a selection of Scribus files to PDF with the built-in
export preferences. This script must be run from inside scribus with
the Scripts->Execute feature.
@BaderSZ
BaderSZ / thunderbird_ascii_format.py
Created January 21, 2022 18:03
Convert a string from stdin into a thunderbird-compatible URL ASCII body.
#!/bin/env python3
"""
Convert a string from stdin into a thunderbird-compatible URL body.
Run this as follows:
thunderbird -compose "to='test@example.com',body="'<output here>'""
Public domain, Bader Zaidan, 2022
@BaderSZ
BaderSZ / bash_template.sh
Created April 18, 2021 09:51
Bash script template, including functions, etc.
#!/bin/env bash
set -euo pipefail
EXIT_SUCCESS=0
EXIT_FAILURE=1
## insert functions here...
print_help() {
echo "Commands:"
@BaderSZ
BaderSZ / .lintr
Created April 29, 2020 21:12
Basic config for R lintr
linters: with_defaults(line_length_linter(120),
object_name_linter("lowercase"),
cyclocomp_linter(64),
semicolon_terminator_linter("compound"),
no_tab_linter,
assignment_linter)
@BaderSZ
BaderSZ / get_coordinates.py
Created February 2, 2020 01:24
Get and print coordinates of a location or city via python geopy. Includes raw JSON
# CC0 Bader Zaidan, 2020
# Call via: $ python get_coordinates.py CITY,COUNTRY
import geopy
import sys
from geopy.geocoders import Nominatim
geolocator = Nominatim(user_agent="ChangeMe")
coord = geolocator.geocode(sys.argv[1])