An alias that will generate a git commit message staged changes as shown in git-status. Put this alias (section below) in your .gitconfig.
The message generated will be in the format of:
$ git status --porcelain
A file1.py
A file2.py
A file3.py| #!/usr/bin/env bash | |
| # ref: | |
| # https://forums.macrumors.com/threads/smart-quotes-forced-on-in-messages.2284346/post-30657259 | |
| _res() { | |
| (( res += $1 )) | |
| } | |
| res=0 |
| #!/usr/bin/env bash | |
| CODESIGN_CN_STRING='Developer ID Application' | |
| #CODESIGN_CN_STRING='Apple Development' | |
| #requires openssl@3 from Homebrew | |
| _openssl=$(brew --prefix openssl 2>/dev/null)/bin/openssl | |
| [[ -x $_openssl ]] || { echo "missing openssl, try \`brew install openssl\`"; exit 1; } | |
| #find development cert |
| const app = Application.currentApplication() | |
| app.includeStandardAdditions = true | |
| function getJSON(path) { | |
| const fullPath = path.replace(/^~/, app.pathTo('home folder')) | |
| const contents = app.read(fullPath) | |
| return JSON.parse(contents) | |
| } | |
| function run() { |
| <%* | |
| //v0.2 - bug fix: when search results match just a file name and no line contents under it | |
| //User can set the following two parameters | |
| const resultFilePrefix = '## '; | |
| const folderLocation = '/search'; | |
| const search = app.workspace.getLeavesOfType("search")[0]; | |
| const searchTerms = search.view.getQuery(); | |
| const arrCount = Array.from(search.view.dom.resultDomLookup); |
Install a working (and compiled) version of virt-viewer. You may view the homebrew package's upstream source on GitHub.
brew tap jeffreywildman/homebrew-virt-manager
brew install virt-viewerOnce that's installed should be able make a call remote-viewer with a pve-spice.vv file downloaded from proxmox web interface
| <%* | |
| var searchLeaf; | |
| app.workspace.iterateAllLeaves(leaf => { | |
| if (leaf.view.getViewType() === 'search') { | |
| searchLeaf = leaf; | |
| }}); | |
| if (typeof(searchLeaf) !== 'undefined') { | |
| var q = searchLeaf.view.getQuery(); | |
| if (q !== '') { | |
| var md = '[search: ' + q + '](obsidian://search?query=' + encodeURIComponent(q) + ')'; |
| --[[ Live-updating floating windows at your service! | |
| https://www.hammerspoon.org/docs/hs.window.html | |
| https://www.hammerspoon.org/docs/hs.canvas.html | |
| https://www.hammerspoon.org/docs/hs.image.html | |
| https://www.hammerspoon.org/docs/hs.mouse.html | |
| https://www.hammerspoon.org/docs/hs.timer.html | |
| https://www.lua.org/manual/5.4/manual.html#6.2 (coroutines) | |
| https://github.com/Hammerspoon/hammerspoon/issues/2710#issuecomment-788266990 (thanks @asmagill) |
This is a cheat sheet for how to perform various actions to ZSH, which can be tricky to find on the web as the syntax is not intuitive and it is generally not very well-documented.
| Description | Syntax |
|---|---|
| Get the length of a string | ${#VARNAME} |
| Get a single character | ${VARNAME[index]} |
NB: these instructions are for Ubuntu; they work under WSL on Windows 10 as well
Get the decrypt.sh file from here: https://github.com/zhangyoufu/unifi-backup-decrypt
Make sure prerequisites are installed:
sudo apt update && sudo apt install zip unzip openssl mongo-tools