If you’re running a newer version of the JDK (9 or greater), you might have started to see warnings that look like this:
WARNING: An illegal reflective access operation has occurred
WARNING: Illegal reflective access by org.codehaus.groovy.reflection.CachedClass (file:/Users/myname/.gradle/caches/modules-2/files-2.1/org.codehaus.groovy/groovy/2.5.11/4d8f25c5da08af46fb204fd493ec894699a3f4e8/groovy-2.5.11.jar) to method java.lang.Object.finalize()
WARNING: Please consider reporting this to the maintainers of org.codehaus.groovy.reflection.CachedClass
WARNING: Use --illegal-access=warn to enable warnings of further illegal reflective access operations
WARNING: All illegal access operations will be denied in a future release
JDK9+ produces warnings with many libraries including Groovy due to some planned future restrictions in the JDK. Work is underway to re-engineer parts of Groovy to reduce/remove those warnings. Users wanting to hush the warnings as an interim measure may consider using the --add-opens escape clause offered by JDK9+. See commit 92bd96f (currently reverted) on the Groovy master branch for a potential list to add.
Groovy commit 92bd96f has the flags you can pass to the JVM to suppress the warnings, which I’ve reproduced below:
I often find myself copying strings of Java stack traces which have escaped tabs and newlines (\t\n). Those aren’t fun to read. Here’s a quick Python script I rigged up to grab what’s on the clipboard and format it properly. I call it unescape:
Grab the string on the clipboard and print it to standard out,
interpreting tabs and newlines appropriately
r = subprocess.run(["/usr/bin/pbpaste"], capture_output=True, encoding="unicode_escape")
tell script "Slack"
focus workspace "Netflix"
set status "online" with icon ":wfh-up:"
I couldn’t get Alfred to invoke this Applescript directly (I imagine it has something to do with Security settings in Catalina), so I saved it to a file (up.scpt), and then invoked it in a workflow as a bash script, where the command was:
When somebody rebases their PR, my local copy of that branch gets out of sync:
➜ keel git:(fix-paused-events) git status
On branch fix-paused-events
Your branch and 'luispollo/fix-paused-events' have diverged,
and have 8 and 16 different commits each, respectively.
(use "git pull" to merge the remote branch into yours)
I just want my local copy to reflect the remote one.
I created a “stomp” alias that resets my local branch with the upstream:
I’m a big fan of the Dash documentation tool for macOS. In particular, I often create my own Dash cheat sheets to help me remember commands I frequently forget.
I make enough of these that I created a simple Go app named cheat to generate a skeleton cheat sheet. I also created an UltiSnips snippet to make it easier to generate categories and entries in cheat sheets.
snippet entry "cheatsheet entry"
snippet category "cheatsheet category"
On Neovim, this would go in ~/.config/nvim/UltiSnips/ruby.snippets
I use the QuickSilver “Add to Catalog” action to add sleep.sh and lockscreen.scpt to the catalog. That action isn’t enabled by default, to enable it, you need to open QuickSilver preferences, click “General”, choose “Actions”, search for “Add to Catalog”, and enable it.
By default, the “Open” action has a higher precedence than the “Run” action for shell scripts. You can change the precedence order of actions by dragging, I dragged the “Run […]” action (Run a Shell Script [with optional arguments]) above the “Open” action.