Skip to content

Instantly share code, notes, and snippets.

View Amourspirit's full-sized avatar

:Barry-Thomas-Paul: Moss Amourspirit

  • Huntsville, Ontario, Canada
View GitHub Profile
@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

@Foadsf
Foadsf / README.md
Last active March 22, 2024 05:57
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

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.
"""
@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 = martin.larralde@embl.de
url = https://github.com/althonos/{name}
description = {description}
long_description = file: README.md
@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)
@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

Aligning images

This is a guide for aligning images.

See the full Advanced Markdown doc for more tips and tricks

left alignment

@Amourspirit
Amourspirit / README.md
Last active January 29, 2016 17:00 — forked from jonahvsweb/README.md
Setup GitHub Pages "gh-pages" branch and "master" branch as subfolders of a parent project folder ("grandmaster").

Intro

Description: Setup GitHub Pages "gh-pages" branch and "master" branch as subfolders of a parent project folder ("grandmaster").

Author: Chris Jacob @_chrisjacob

Tutorial (Gist): https://gist.github.com/833223

The Result

@tasdikrahman
tasdikrahman / python_tests_dir_structure.md
Last active June 30, 2024 00:15
Typical Directory structure for python tests

A Typical directory structure for running tests using unittest

Ref : stackoverflow

The best solution in my opinion is to use the unittest [command line interface][1] which will add the directory to the sys.path so you don't have to (done in the TestLoader class).

For example for a directory structure like this:

new_project

├── antigravity.py

@izderadicka
izderadicka / megaback.sh
Last active February 7, 2022 04:53
backup script for megatools
#!/bin/bash
BACKUP_DIR="/Root/Backup/"
PIECE_SIZE=10M
ACTION=store
trap "exit 2" SIGINT
if [[ $1 =~ -h|--help ]]; then