Skip to content

Instantly share code, notes, and snippets.

View Amourspirit's full-sized avatar

:Barry-Thomas-Paul: Moss Amourspirit

  • Hamilton, Ontario, Canada
View GitHub Profile
@thekalinga
thekalinga / libre-office-uno-python-setup.md
Last active January 28, 2022 01:54
Setup python environment for writing macros with pyenv, virtualenv, visual studio code, libre office uno

Libre office python development environment setup guide

Setup

  1. Install Visual studio code
  2. Install Python plugin for visual studio
  3. Install pyenv that helps you manage multiple versions of python side by side
  4. Install pyenv-virtualenv helps you utilize python virtualenvs inside pyenv

git clone https://github.com/pyenv/pyenv-virtualenv.git $(pyenv root)/plugins/pyenv-virtualenv

@BroHui
BroHui / remove_comments.py
Created September 13, 2017 03:31
Remove comments and docstrings from a python fille.
""" Strip comments and docstrings from a file.
"""
import sys, token, tokenize
def do_file(fname):
""" Run on just one file.
"""
source = open(fname)
@althonos
althonos / setup.cfg
Last active March 4, 2024 18:08
A `setup.cfg` template for my Python projects
# https://gist.github.com/althonos/6914b896789d3f2078d1e6237642c35c
[metadata]
name = {name}
version = file: {name}/_version.txt
author = Martin Larralde
author_email = [email protected]
url = https://github.com/althonos/{name}
description = {description}
long_description = file: README.md
from random import shuffle
import copy
"""
SudokuGenerator
input: grid can be a 2-D matrix of a Sudoku puzzle to solve, or None to generate a new puzzle.
"""
@Foadsf
Foadsf / README.md
Last active March 1, 2025 16:17
Scripting LibreOffice with Python

This tutorial was originally written by Jannie Theunissen on onesheep.org. However, the website has been down for a while and this a clone from the web.archive.org backup. Also, the parts regarding the macOS are updated according to this post. You may find OneSheep here on Twitter and Jannie Theunissen here on StackOverflow. If you have any comments on this Gist please poke me here on Twitter, otherwise, I might miss your comments.

Scripting LibreOffice with Python

We were recently asked to automate some editing tasks for the Spotlight English editors w

@Amourspirit
Amourspirit / QuickConda.md
Last active April 17, 2022 19:45
Conda (cheatsheet) Quick Commands

Quick Commands

Set up env
$ conda env create --prefix ./env -f environment.yml

Set up new env
$ conda create --prefix ./env python=3.10

Write env to Yaml
$ conda env export > environment.yml