A whistle-stop tour of the techniques for getting your Python code into a place where the interpreter can get to work on it followed by the implications for code structure and usability.
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 | |
# git-summary - summarise git repos at some path | |
# | |
# Adapted from https://gist.github.com/lmj0011/1a8dd1e376234ac7bf0fba2748ecdd0f | |
# | |
# Andy Gimblett, March 2017 | |
usage() { |
Importing a CSV into Excel is annoying, because by default it will try to interpret the columns, and it often/usually gets it wrong. You can control what format is used for each column when you import a CSV file, but it's fiddly, and for many purposes we'd just like to load a CSV and have every column to be read in as uninterpreted text, without having to faff with the import wizard.
Good news: we can do that with a macro. Here it is:
Sub importCSV()
Dim column_types() As Variant
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
def attrs_flexible_repr(cls): | |
""" | |
An [attrs](http://www.attrs.org/) extension giving attributes more | |
flexibility about how they appear in the autogenerated `__repr__`. | |
Out of the box, attrs gives your class a pretty decent `__repr__` method; | |
you can disable this at the class level to define your own, or you can | |
keep it but exclude attributes by setting their `repr` field to False. | |
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
#!/usr/bin/env bash | |
# See https://github.com/matryer/xbar/issues/714 | |
getxbarpid () { | |
ps -Ac -o pid=,comm= | grep xbar | column -t | cut -d ' ' -f 1 | |
} | |
xbarpid="$(getxbarpid)" | |
if [ -z "$xbarpid" ] ; then |
openpyxl has pretty good docs prepared using sphinx, though they can be hard to navigate.
Using Dash makes that easier for me, so here's how to create a Dash docset for openpyxl, using the doc2dash tool; by default this will install it directly into Dash, but see doc2dash
's documentation for more options.
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
2022-01-12T16:40:00.754Z [INFO] Terraform version: 1.1.3 | |
2022-01-12T16:40:00.755Z [INFO] Go runtime version: go1.17.2 | |
2022-01-12T16:40:00.755Z [INFO] CLI args: []string{"/opt/homebrew/Cellar/tfenv/2.2.2/versions/1.1.3/terraform", "apply"} | |
2022-01-12T16:40:00.755Z [DEBUG] Attempting to open CLI config file: /Users/andy.gimblett/.terraformrc | |
2022-01-12T16:40:00.755Z [DEBUG] File doesn't exist, but doesn't need to. Ignoring. | |
2022-01-12T16:40:00.755Z [DEBUG] ignoring non-existing provider search directory terraform.d/plugins | |
2022-01-12T16:40:00.755Z [DEBUG] ignoring non-existing provider search directory /Users/andy.gimblett/.terraform.d/plugins | |
2022-01-12T16:40:00.755Z [DEBUG] ignoring non-existing provider search directory /Users/andy.gimblett/Library/Application Support/io.terraform/plugins | |
2022-01-12T16:40:00.755Z [DEBUG] ignoring non-existing provider search directory /Library/Application Support/io.terraform/plugins | |
2022-01-12T16:40:00.756Z [INFO] CLI command args: []string{"apply"} |
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
workspace |