-
jq — https://jqlang.github.io/jq/ — "like sed for JSON data"
There are several options available for installing jq. I prefer to use Homebrew:
brew install jq
Gist title: "BASH: ISO 8601 Timestamp with Milliseconds" | |
Summary: How to get an ISO 8601 timestamp with milliseconds in BASH |
TSV means "tab-separated values". I prefer this format over CSV ("comma-separated values") because it doesn't require as much quoting. Many programs that can use CSV formatted data can also use TSV, although they may need to be explicitly told of the different format if it's not detected automatically.
However, in any of the jq scripts below, "@tsv
" can usually be replaced with "@csv
" to get CSV output instead.
#!/bin/sh -- | |
# Toggle macOS Background Sounds on or off. | |
# | |
# See the System Settings panel for Accessibility > Audio to change settings | |
# like the sound played, volume level, and automatic stop. | |
# `read` returns an integer, but… | |
if [ $(defaults read com.apple.ComfortSounds 'comfortSoundsEnabled') = 0 ] | |
then |
There are times notifications aren't wanted about either a changed repo file or a new file that needs to be added to the repo. However, adding the name of the file to .gitignore
might not be a good option, either. For example, locally-generated files that other users aren't likely to generate (e.g., files created by an editor) or files of experimental test code might not be appropriate to appear in a .gitignore
file.
In those cases, use one of these solutions:
-
If the file is a changed repo file
Use the command:
git update-index --assume-unchanged "$FILE"
𝐀 = {'😀': 5} | |
for ℹ︎ in range(20): | |
# print(i, ℹ︎, i == ℹ︎) # NameError: name 'i' is not defined. | |
for _,__ in 𝐀.items(): | |
if __ == ℹ︎: | |
print(_, ℹ︎) | |
print(𝐀) # Prints dictionary in 𝐀 | |
print(A) # Also prints dictionary in 𝐀! | |
print(𝐀 is A) # True |
class IndexFormatter: | |
def __init__(self, volumeId: int): | |
self.itemPages = ( | |
ItemPage.objects.filter(volume__id=volumeId) | |
.order_by('item__topic__name', F('page') * 1, 'item__name')) | |
def format(self) -> str: | |
""" | |
Format the index for printing. | |
""" |