andelink (andelinkyle@gmail.com)
2022-08-01 04:57:47

set the channel description: what did you learn today?

andelink (andelinkyle@gmail.com)
2022-08-01 04:59:19

til you can type ? on any github page to get a keyboard shortcuts description… and from that I learned github has its own code search akin to sourcegraph (⌘ shift f), which is useful when the repo you are searching is not in sourcegraph

🧠 spkaplan, andelink, r.taylor
keenin
2022-08-04 17:56:54

Amazon’s Code has this too, super nice. Can also open multiple files in the same package in one window, but separate tabs

andelink (andelinkyle@gmail.com)
2022-08-05 05:33:55

So handy

andelink (andelinkyle@gmail.com)
2022-10-04 11:42:44

til you can git add a subset of the changes in the files by interactively selecting the lines to stage with git add --patch or git add -p for short

🤯 spkaplan
:wow: spkaplan
brandon
2022-10-07 10:59:15

I have done this with Sourcetree in the past, but it's nice to finally see the commands behind it! I don't use Sourcetree anymore so this might come in handy.

andelink (andelinkyle@gmail.com)
2022-10-07 11:00:13

Hmm can’t say I’m familiar with Sourcetree. What is that?

brandon
2022-10-07 11:00:25

It is a git GUI

andelink (andelinkyle@gmail.com)
2022-10-07 11:00:36

Ahh

andelink (andelinkyle@gmail.com)
2022-10-07 11:00:45

command line only for me

andelink (andelinkyle@gmail.com)
2022-10-07 11:00:56

i don’t even use a mouse

🫡 brandon
andelink (andelinkyle@gmail.com)
2022-10-07 11:04:22

til you can use --alow-empty to make an empty commit, useful for when you have some CI steps that run on pushes to your remote:

git commit -m "trigger image build" --allow-empty

brandon
2022-10-07 16:39:44

Seems kind of noisy for git history though. Don't most CICD tools allow you to trigger a pipeline manually by selecting a target branch?

andelink (andelinkyle@gmail.com)
2022-10-07 17:23:15

We default to squash-merge when actually merging our PRs to the main branch, so one commit in the end doesn’t bloat production tree

👍 brandon
andelink (andelinkyle@gmail.com)
2022-10-07 17:25:39

selecting a target branch
That’s what this is doing. A lot of our dev tooling puts standard image builds as a part of CI. CI runs on PRs the infra team says to use PRs

andelink (andelinkyle@gmail.com)
2022-10-19 16:20:14

til something that i’m embarrassed to admit I didn’t know about. Apparently you can search your man pages using the -f (complete word matches) and -k (soft matches) flags e.g.

kandelin@lyft-mbp2 telematicsingest % man -f pid
pidof(1) - get the PID of processes by name
pid(ntcl) - Retrieve process identifiers
rwbypid.d(1m) - read/write calls by PID. Uses DTrace
pid(ntcl) - Retrieve process identifiers
rwbypid.d(1m) - read/write calls by PID. Uses DTrace

kandelin@lyft-mbp2 telematicsingest % man -k pid
pidof(1) - get the PID of processes by name
nfs4mapid(8) - shows NFSv4 mappings from uids or gids to over the wire string names and string names to uids or gids
pid(ntcl) - Retrieve process identifiers
pidpersec.d(1m) - print new PIDs per sec. Uses DTrace
rwbypid.d(1m) - read/write calls by PID. Uses DTrace
syscallbypid.d(1m) - syscalls by process ID. Uses DTrace
CURLOPT_TCP_KEEPIDLE(3) - TCP keep-alive idle time wait
Proc::Killfam(3pm) - kill a list of pids, and all their sub-children
Sub::Exporter::Cookbook(3pm) - useful, demonstrative, or stupid Sub::Exporter tricks
Tcl_DetachPids(3tcl), Tcl_ReapDetachedProcs(3tcl), Tcl_WaitPid(3tcl) - manage child processes in background
getpid(2), getppid(2) - get parent or calling process identification
nfs4mapid(8) - shows NFSv4 mappings from uids or gids to over the wire string names and string names to uids or gids
pid(ntcl) - Retrieve process identifiers
pidpersec.d(1m) - print new PIDs per sec. Uses DTrace
pthread_setugid_np(2) - Set the per-thread userid and single groupid
rwbypid.d(1m) - read/write calls by PID. Uses DTrace
syscallbypid.d(1m) - syscalls by process ID. Uses DTrace
wait(2), wait3(2), wait4(2), waitpid(2) - wait for process termination
git(1) - the stupid content tracker

:blob_clap: brandon
andelink (andelinkyle@gmail.com)
2022-11-14 09:05:00

til about gron. next time you find yourself trying to extract/manipulate some json data with jq, give gron a try instead 👍

Unnests json into greppable lines:

▶ gron "" | fgrep "commit.author"
json[0].commit.author = {};
json[0].commit.author.date = "2016-07-02T10:51:21Z";
json[0].commit.author.email = "mail@tomnomnom.com";
json[0].commit.author.name = "Tom Hudson";

Reverse it back into json form:
▶ gron "" | fgrep "commit.author" | gron --ungron
[
{
"commit": {
"author": {
"date": "2016-07-02T10:51:21Z",
"email": "mail@tomnomnom.com",
"name": "Tom Hudson"
}
}
}
]

spkaplan
2022-11-15 10:44:00

Cool! Maybe ill code one day 😭 and could use this

andelink (andelinkyle@gmail.com)
2022-11-15 10:56:21

lol oh no

andelink (andelinkyle@gmail.com)
2022-11-15 10:56:23

sam

spkaplan
2022-11-15 10:57:24

haha, managing 9 person team now, so there is 0 time for coding. It is fun though, but maybe after this recession ill mix it up again

andelink (andelinkyle@gmail.com)
2022-11-15 10:57:51

Last we spoke you mentioned you were gonna look for a new job as an IC

spkaplan
2022-11-15 10:58:24

yeah, but with the change in the economy, im gonna hunker down for a bit

andelink (andelinkyle@gmail.com)
2022-11-15 10:58:42

fair, i'm thinking the same

andelink (andelinkyle@gmail.com)
2022-12-14 17:05:01

til about the pandas.DataFrame.to_clipboard method.

So now I have this handy function in my PYTHONSTARTUP=~/.local/lib/pythonstartup.py file:

def to_clipboard(obj):
import pandas as pd
pd.DataFrame([obj]).to_clipboard(index=False, header=False)

clip clip

:nice2: spkaplan
andelink (andelinkyle@gmail.com)
2023-02-04 12:42:02

til there is no need for 3rd party software on macs to snap windows to left/right/top/bottom 🙌

You can simply do:

CtrlOptionReturn (⌃⌥⏎): Zoom
CtrlOptionLeft (⌃⌥←): Move Window to Left of Screen
CtrlOptionRight (⌃⌥→): Move Window to Right of Screen
CtrlOptionUp (⌃⌥↑): Move Window to Top of Screen
CtrlOptionDown (⌃⌥↓): Move Window to Bottom of Screen

😮 brandon
🙌 r.taylor
andelink (andelinkyle@gmail.com)
2023-02-04 12:44:32

source and more info here:

andelink (andelinkyle@gmail.com)
2023-02-04 12:44:36

fyi @brandon

brandon
2023-02-05 19:03:57

Cool, thanks for the heads up. I'll check this out tomorrow!

r.taylor
2023-02-21 17:49:08

One of the biggest annoyances with my mac so far is remembering which combination of shift + ctrl + opt + cmd I need to press for which command

andelink (andelinkyle@gmail.com)
2023-02-21 17:56:28

lol isn’t that generalizable to any keyboard shortcut on any operating system?

r.taylor
2023-02-26 09:04:33

No, for windows at least, most shortcuts only use one of those, but Mac seems to like using at least two for everything

r.taylor
2023-02-26 09:05:10

Like this snapping on Windows is just Win + Arrow

andelink (andelinkyle@gmail.com)
2023-02-26 11:16:28

Oh yeah I see what you mean. Same here

andelink (andelinkyle@gmail.com)
2023-02-09 08:52:37

til how to undo the amended changes from a git commit --amend.

HEAD@{1} gives you the commit that HEAD pointed to before it was moved to where it currently points at (ie before your --amend commit). I can see all my changes from the amended commit with git diff HEAD@{1}.

So then to break apart the original commit and the --amend into two separate commits:

# move head to point to the first commit, but leave the current index intact
git reset --soft HEAD@{1}

# now head is back to your original unmodified commit, with your mistakenly amended
# changes staged in the working tree. so at this point all you need to do is just
# create a new commit like you should have done in the first place.
git commit -m 'second set of changes in a separate commit'

🤯 I’m losing my mind. Had no idea this was possible. It’s actually really damn hard (impossible??) to truly lose or overwrite anything from your git history such that it’s unrecoverable (maybe only completely wiping the .git db?)

Key is that HEAD@{N} points to the Nth last state in the reflog history, while normal HEAD^N looks at the commit history. You can examine git reflog to find out what HEAD@{N} you are interested in, in case you want to go back further in time than just HEAD@{1}

spkaplan
2023-02-09 10:39:43

Damn, that's awesome. I had no idea you could split it after amending. That is good to know, since I use amend all the time. Thanks for sharing !

👍 andelink, brandon
andelink (andelinkyle@gmail.com)
2023-02-09 10:41:45

I use it all the time as well. And then this morning I amended a commit with tons of separate unrelated changes I was planning to commit separately. Super pleased to have learned about this ability for sure

:nice2: spkaplan
keenin
2023-02-09 10:45:01

git head@{N} is a clutch command. Never knew about the ability to split as well, super useful!

💯 andelink
andelink (andelinkyle@gmail.com)
2023-03-03 15:01:47

til (i) how to find which commit deleted a file, and (ii) which commit deleted a line of code

Which commit deleted a file?
git rev-list -n1 HEAD — will give us the last commit that impacted a file path.

# Exact commit
kandelin  yeoman-generators [master] git rev-list -n1 HEAD -- generators/services/generator-service/generators/python/templates/docs/_README.md
e5fbebf606973d40de89565685ad3cebf5282258

# What happened? (moved or deleted)
kandelin  yeoman-generators [master] git diff e5fbebf^ e5fbebf | grep -m1 -A3 generators/services/generator-service/generators/python/templates/docs/_README.md
similarity index 100%
rename from generators/services/generator-service/generators/python/templates/docs/_README.md
rename to generators/generator-service/generators/python/templates/docs/_README.md

Twas moved.

Which commit deleted a line of code?
git blame --reverse will show you each line with the last commit in which it still existed 🙌

kandelin  yeoman-generators [master] git blame --reverse e5fbebf.. generators/generator-service/generators/python/templates/docs/_README.md | grep -A3 'not allowed to use unittest'
be8bccbf2 (Prem Santosh 2021-03-12 14:58:59 -0800 95) *For new services going forward, you are not allowed to use unittest anywhere.*
be8bccbf2 (Prem Santosh 2021-03-12 14:58:59 -0800 96) Assertions should be made
be8bccbf2 (Prem Santosh 2021-03-12 14:58:59 -0800 97) with the built-in assert statement. Py.test overloads this to do introspection, and
be8bccbf2 (Prem Santosh 2021-03-12 14:58:59 -0800 98) provides very detailed test output, which you don't get when you use unittest asserts.

Prem Santosh be8bccbf2 I got ya now bish. Edit: actually, the culprit is one commit later

kandelin  yeoman-generators [master] git log --oneline be8bccbf2..HEAD | tail -n1
52d2c24c Remove repeated new python project boilerplate (#1144)

52d2c24c got ya now bish

:first_place_medal: spkaplan
❤️ brandon
brandon
2023-03-10 13:27:53

Am I blind? Where are you specifying the line number in that second one?

andelink (andelinkyle@gmail.com)
2023-03-10 13:45:30

Where are you specifying the line number in that second one?
Are you asking what line I’m trying to find?

I am trying to find what commit deleted the line that contained this text:
not allowed to use unittest

I grep for it

🙏 brandon
brandon
2023-03-10 13:46:22

Thanks. I think the word wrap messed with me

andelink (andelinkyle@gmail.com)
2023-03-10 13:47:30

oh dang. i don’t have any word wrap

andelink (andelinkyle@gmail.com)
2023-03-10 13:47:44

i keep slack at 80% zoom

brandon
2023-03-10 13:50:19

Wow, nice eyes

brandon
2023-03-10 13:50:50

😒

brandon
2023-03-10 13:51:17

But actually, maybe I should try that. Never really considered it

andelink (andelinkyle@gmail.com)
2023-03-10 13:52:00

it’s the only way to live. i keep most every application with text at 80% zoom. and my web browser

brandon
2023-03-10 13:53:20

You just manually zoom each one out with ctrl + -

andelink (andelinkyle@gmail.com)
2023-03-10 13:53:39

i usually configure it in the application preferences/settings

brandon
2023-03-10 13:54:45

I'll try it for a day or two and get back to you

andelink (andelinkyle@gmail.com)
2023-03-10 13:55:04

Nice, yeah lmk how you like it

andelink (andelinkyle@gmail.com)
2023-03-18 13:08:38

@brandon how are you enjoying your new found information density?

brandon
2023-03-20 09:19:29

It's good so far. I've been at 80% for slack and gmail and haven't switched back!

🙌 andelink
andelink (andelinkyle@gmail.com)
2023-03-21 11:52:40

til

:pika_woah: brandon, r.taylor
andelink (andelinkyle@gmail.com)
2023-03-21 11:53:30

@r.taylor i think you mentioned wanting a tool like this

👀 r.taylor
spkaplan
2023-03-21 12:00:25

what tool is it?

andelink (andelinkyle@gmail.com)
2023-03-21 12:05:51

It’s a combination of git, bat, and fzf. I’ve had and used them all for a while. But this fzf-git.sh project combines them magically. Found it in the fzf docs:


You can install it with:

❯ curl -sL  > ~/.fzf-git.sh
❯ echo '[ -f ~/.fzf-git.sh ] && source ~/.fzf-git.sh' >> ~/.zshrc

You’ll need fzf. bat is optional but I use it instead of cat everywhere anyways. It adds syntax highlighting

:thankyou: spkaplan, brandon
🙏 brandon
brandon
2023-03-21 12:22:30

This looks amazing

andelink (andelinkyle@gmail.com)
2023-03-21 13:11:51

It is amazing. I used ctrl-g ctrl-f in my gif above. Here are the other key bindings (fzf-git.sh only):

  • CTRL-G CTRL-F for Files

  • CTRL-G CTRL-B for Branches

  • CTRL-G CTRL-T for Tags

  • CTRL-G CTRL-R for Remotes

  • CTRL-G CTRL-H for commit Hashes

  • CTRL-G CTRL-S for Stashes

  • CTRL-G CTRL-E for Each ref (git for-each-ref)



If you aren’t familiar with fzf, it’s a great tool. I mostly use it for fuzzy searching my history and autocomplete suggestions, but it can do a lot more than that.

I love its --preview window option, and using it with ripgrep for interactive code searching.

r.taylor
2023-03-21 13:38:17

Even cooler than I imagined 🥹

brandon
2023-03-29 15:11:12

@andelink finally getting around to installing this today. Wondering why you provided the "install with git" instructions instead of homebrew. Do you prefer it because you have more control over the manipulation of zshrc?

andelink (andelinkyle@gmail.com)
2023-03-29 15:20:00

Nice!

andelink (andelinkyle@gmail.com)
2023-03-29 15:21:10

AFAIK there is no brew formula for fzf-git. I installed fzf via homebrew but wasn’t aware I could with fzf-git

andelink (andelinkyle@gmail.com)
2023-03-29 15:24:54

yeah i don’t see fzf-git in homebrew

❯ brew search fzf | xargs -I{} echo '{}'
fzf
fzy
fff

brandon
2023-03-29 15:44:46

Oh, I see. Thank you, I was referring to fzf

👍 andelink
brandon
2023-03-29 15:51:42

Pressing CTRL-G keeps starting a new command for me.

brandon
2023-03-29 15:52:04

I wonder if it's conflicting with some other keybinding I have installed

andelink (andelinkyle@gmail.com)
2023-03-29 15:59:44

Oh yeah, I read something about this

andelink (andelinkyle@gmail.com)
2023-03-29 15:59:46

One sec

👍 brandon
andelink (andelinkyle@gmail.com)
2023-03-29 16:00:32

Wait nevermind. I was thinking of something else

brandon
2023-03-29 16:01:45

This maybe? I saw that too.

andelink (andelinkyle@gmail.com)
2023-03-29 16:03:34

If you’ve got fzf-git setup right, you should be able to see results with this command:

$ which _fzf_git_fzf
_fzf_git_fzf () {
fzf-tmux -p80%,60% -- --layout=reverse --multi --height=50% --min-height=20 --border --color='header:italic:underline' --preview-window='right,50%,border-left' --bind='ctrl-/:change-preview-window(down,50%,border-top|hidden|)' "$@"
}

Then the keybind is CTRL-G CTRL-F

andelink (andelinkyle@gmail.com)
2023-03-29 16:03:46

CTRL-G then CTRL-F in sequence

brandon
2023-03-29 16:04:32
_fzf_git_fzf not found
andelink (andelinkyle@gmail.com)
2023-03-29 16:04:36

I keep CTRL pressed, and then hit G followed by F

andelink (andelinkyle@gmail.com)
2023-03-29 16:04:40

welp, there’s your problem

brandon
2023-03-29 16:04:51

I didn't do this step during fzf installation

# To install useful key bindings and fuzzy completion:
$(brew --prefix)/opt/fzf/install

andelink (andelinkyle@gmail.com)
2023-03-29 16:05:16

Do you see any of these:

 telematicsingest on  master (1be4a24) +3 -3 [!?] via 🐍 v3.8.12 (telematicsingest venv)                                                                                           16:03:13
❯ print -l ${(ok)functions} | grep -E 'fzf[_-]git'
__fzf_git_init
__fzf_git_join
_fzf_git_branches
_fzf_git_check
_fzf_git_each_ref
_fzf_git_files
_fzf_git_fzf
_fzf_git_hashes
_fzf_git_remotes
_fzf_git_stashes
_fzf_git_tags
_zsh_autosuggest_bound_1_fzf-git-branches-widget
_zsh_autosuggest_bound_1_fzf-git-each_ref-widget
_zsh_autosuggest_bound_1_fzf-git-files-widget
_zsh_autosuggest_bound_1_fzf-git-hashes-widget
_zsh_autosuggest_bound_1_fzf-git-remotes-widget
_zsh_autosuggest_bound_1_fzf-git-stashes-widget
_zsh_autosuggest_bound_1_fzf-git-tags-widget
fzf-git-branches-widget
fzf-git-each_ref-widget
fzf-git-files-widget
fzf-git-hashes-widget
fzf-git-install
fzf-git-remotes-widget
fzf-git-stashes-widget
fzf-git-tags-widget

andelink (andelinkyle@gmail.com)
2023-03-29 16:05:30

I didn’t do this step during fzf installation
also yes do that

brandon
2023-03-29 16:05:44
print -l ${(ok)functions} | grep -E 'fzf[_-]git'
_fzf_git_fzf
brandon
2023-03-29 16:11:17

success! I think the main issue was the missing newline in my .zshrc file causing the source not to be loaded.

👍 andelink
andelink (andelinkyle@gmail.com)
2023-03-29 16:19:38

excellent! enjoy your new powers

brandon
2023-03-30 15:13:07

How do you trigger this on mac? ALT-A just creates a unicode character for me.

ALT-A (show all branches)
I'm trying to read fzf-git.sh but haven't found the answer yet

andelink (andelinkyle@gmail.com)
2023-03-30 15:24:00

AFAIK, the ALT- commands are used within the other fzf-git views. So to show all branches:

  1. CTRL-G CTRL-B for Branches

  2. ALT-A for All of them (local + remote)

andelink (andelinkyle@gmail.com)
2023-03-30 15:24:47

If that’s what you’re already doing, then my best guess is you need to configure ALT as a meta key within iterm. See the FAQ:

Q: How do I make the option/alt key act like Meta or send escape codes?
A: Go to Preferences > Profiles tab. Select your profile on the left, and then open the Keyboard tab. At the bottom is a set of buttons that lets you select the behavior of the Option key. For most users, Esc+ will be the best choice.

brandon
2023-03-30 15:30:00

Perfect, I had just found this and was experimenting with Esc+ vs Meta. Thanks

👍 andelink
andelink (andelinkyle@gmail.com)
2023-04-25 13:52:12

til that shell functions natively operate on stdin if available. most folks probably already knew this, but i did not!

e.g. just do a command within your function

# Accepts arbitrary jq options e.g. --slurp
function jqtable() {
jq -r '(.[0] | keys_unsorted | @tsv), (.[] |map(.) | @tsv)' "$@"
}

# data
❯ cat /tmp/data.json
{"filename":"app/workers/s3_event_worker.py","line_number":97}
{"filename":"app/coreservices/reports/report_squeezer.py","line_number":285}
{"filename":"app/coreservices/reports/report_squeezer.py","line_number":296}
{"filename":"app/coreservices/reports/report_squeezer.py","line_number":382}
{"filename":"app/coreservices/workers/create_worker_job.py","line_number":188}

# pipe stdin to your function
❯ cat /tmp/data.json | jqtable --slurp | column -t
filename line_number
app/workers/s3_event_worker.py 97
app/coreservices/reports/report_squeezer.py 285
app/coreservices/reports/report_squeezer.py 296
app/coreservices/reports/report_squeezer.py 382
app/coreservices/workers/create_worker_job.py 188

# or not
❯ jqtable --slurp /tmp/data.json | column -t
filename line_number
app/workers/s3_event_worker.py 97
app/coreservices/reports/report_squeezer.py 285
app/coreservices/reports/report_squeezer.py 296
app/coreservices/reports/report_squeezer.py 382
app/coreservices/workers/create_worker_job.py 188

not sure if i should feel stupid for not knowing this for so long 😅 historically i’ve used the read command to achieve this…

spkaplan
2023-04-26 07:17:01

Haha nice! I hope it saves you a few extra commands 😁

andelink (andelinkyle@gmail.com)
2023-04-27 16:06:29

til you can use touch ID instead of typing a password for sudo access:

😍 spkaplan
🆒 brandon
andelink (andelinkyle@gmail.com)
2023-07-06 13:05:20

til how to remap keys with hidutiil

my keyboards fn key is on the right side rather than the left, and my mac isn’t registering my right-fn key presses at all, so i basically don’t have a fn key. i don’t use my right-ctrl key ever, so i remapped it to fn with hidutil:

# Get current key mapping
$ hidutil property --get "UserKeyMapping"
(null)

# remap right_control --> fn
$ hidutil property --set '{"UserKeyMapping":[{"HIDKeyboardModifierMappingSrc": 0x7000000E4, "HIDKeyboardModifierMappingDst": 0xFF00000003}]}'

# Now we see a populated mapping
$ hidutil property --get "UserKeyMapping"
(
{
HIDKeyboardModifierMappingDst = 1095216660483;
HIDKeyboardModifierMappingSrc = 30064771300;
}
)

# You can clear any mappings with:
$ hidutil property --set '{"UserKeyMapping":[]}'

And now I have a working fn key 🎉

andelink (andelinkyle@gmail.com)
2023-07-06 13:05:52

To get the proper key codes I used this handy tool:
The key hex values can be seen here:

You can calculate the correct hidutil key codes from the source hex values with:

# python
>>> right_control = '0xE4'
>>> hex(int(right_control, 16) + 0x700000000)
'0x7000000e4'

# javascript
❯ let right_control = '0xE4';
0x${(parseInt(right_control, 16) + 0x700000000).toString(16)};
'0x7000000e4'

The only technical reference I could find from Apple about this:

spkaplan
2023-07-06 16:20:49

I wish I had the time to tinker more like this

spkaplan
2023-07-06 16:20:53

🤤

andelink (andelinkyle@gmail.com)
2023-07-06 16:22:53

woah woah woah… tinker? this is me solving a business problem! if i don’t have a fn key, certain key combos won’t work, and we get paid to type, so all combos have to work

andelink (andelinkyle@gmail.com)
2023-07-06 16:23:55

easy sell 😂

andelink (andelinkyle@gmail.com)
2023-08-13 15:59:20

Ran into the issue of my key mapping not surviving reboots. Had to create a launch agent that runs the hidutil command every time I login.

  1. Write the attached plist file to ~/Library/LaunchAgents/local.hidutilKeyMapping.plist

  2. Load into launchd: launchctl load ~/Library/LaunchAgents/local.hidutilKeyMapping.plist

  3. Confirm it’s loaded: launchctl list local.hidutilKeyMapping

  4. Optionally run it one time now: launchctl start local.hidutilKeyMapping

  5. ???

  6. Profit


Now even after a reboot my key mapping is retained

andelink (andelinkyle@gmail.com)
2023-07-22 13:26:12

til finally how to clear notification center via command line, which means i can map it to a keyboard shortcut. why one doesn’t exist natively who knows.

# ~/.zshrc
function clearnc() {
local url=
local filename=~/bin/clear-notifications
if [[ "$1" == "which" ]]; then
echo "${filename}"
return
elif [[ ! -f "${filename}" || "$@" =~ -u ]]; then
echo "Installing latest..."
mkdir -p "$(dirname filename)"
{
echo '#!/usr/bin/env osascript -l JavaScript\n';
curl -sL "${url}"
} > ${filename}
chmod +x ${filename}
fi
${filename} > /dev/null 2>&1
}

# clear notification banners
$ clearnc

# clear notification banners and install latest version of script
$ clearnc -u
Installing latest...

# ... or
$ clearnc --upgrade
Installing latest...

# where's the executable
$ clearnc which
/Users/andelink/bin/clear-notifications

:nice2: spkaplan
r.taylor
2023-08-01 09:56:11

til about . Not sure how I never stumbled upon this before now, but, after skimming, it seems to provide some good deep-dives into why and how to be security-minded, or some summarized recommendations if you can't be assed to do the research but are curious about alternatives.

privacyguides.org
👍 andelink, spkaplan, brandon
r.taylor
2023-08-01 09:57:41

For example, a list of Android OS alternatives in order of recommendation with a summary of the OS but plenty of links to follow if you want to look deeper

andelink (andelinkyle@gmail.com)
2023-08-01 11:36:04

Nice! I’m excited to read after I get out of the shower

andelink (andelinkyle@gmail.com)
2023-08-01 12:30:36

Like with everything in life, privacy is all about trade offs. Many of the privacy focused recommendations I assess and think nahh I’m good I’ll take the convenience

r.taylor
2023-08-01 14:18:23

Definitely. I've actually grown to appreciate the lack of convenience that comes with it though 😆 it was too convenient to just waste time (or at least, my opinion on what I consider a waste of my personal time)

andelink (andelinkyle@gmail.com)
2023-08-01 14:52:53

For me what these enable I don’t view these as a waste of time. These make interacting with my phone so much more pleasant. I’m often wishing I could do more things from a locked phone so I can run shortcuts that do all sorts of things more easily

andelink (andelinkyle@gmail.com)
2023-08-01 14:53:20

But then again, I guess with Face ID it should unlock when I look at my phone

r.taylor
2023-08-01 15:39:38

If the two seconds that unlocking my phone adds to an operation makes it not worth it, it wasn't worth it in the first place haha

andelink (andelinkyle@gmail.com)
2023-08-01 15:40:07

When you do it however many times a day, that adds up fast

r.taylor
2023-08-01 15:40:28

That is a pretty specific case though, I was speaking more towards losing my curated lists when I stopped being automatically signed in to websites, for example

r.taylor
2023-08-01 15:40:38

Less doom scrolling, unless I go out of my way

andelink (andelinkyle@gmail.com)
2023-08-01 15:41:07

Yeah, I agree. But it was seeing these specific recommendations that prompted my comment lol

andelink (andelinkyle@gmail.com)
2023-08-01 15:41:30

Because these specific ones I’ve thought about very intentionally in the past and went against

r.taylor
2023-08-01 15:41:46

Fair enough

andelink (andelinkyle@gmail.com)
2023-08-01 15:41:51

But yeah, the auto signing into websites is a big one

andelink (andelinkyle@gmail.com)
2023-08-01 15:41:55

It’s a drug

💉 r.taylor
andelink (andelinkyle@gmail.com)
2023-08-01 15:42:00

Hella convenient

andelink (andelinkyle@gmail.com)
2023-08-01 15:42:30

And would be best to forego

r.taylor
2023-08-01 15:44:53

Because these specific ones I’ve thought about very intentionally in the past and went against
The amount of people that all best privacy practices apply to at all times is probably a very, very small number. I don't think anybody is saying it is realistic to do so, and, if they are, they live in a very different reality 😆 makes sense to make your own decisions

andelink (andelinkyle@gmail.com)
2023-08-01 15:45:17

That’s true

brandon
2023-08-31 11:08:56

Hachyderm.io
andelink (andelinkyle@gmail.com)
2023-09-01 09:19:45

Woah

andelink (andelinkyle@gmail.com)
2023-09-01 09:20:02

How long has this been a git command?

brandon
2023-09-01 12:07:31

ikr, I literally have a repo cloned twice for this very purpose lol

andelink (andelinkyle@gmail.com)
2023-09-02 08:55:59

LOLOL

andelink (andelinkyle@gmail.com)
2023-09-02 08:56:13

i meant to try this out yesterday but didn’t. let me give it a spin

andelink (andelinkyle@gmail.com)
2023-09-02 08:56:32

but… cloning a repo twice… lol cmon

😂 brandon
andelink (andelinkyle@gmail.com)
2023-09-02 08:57:10

just use git stash

andelink (andelinkyle@gmail.com)
2023-09-02 08:57:40

the reality is git is the greatest tool ever, and too its own detriment, simply because of how much it can do. it’s massive

andelink (andelinkyle@gmail.com)
2023-09-01 11:22:51

til best speed test:

speed.cloudflare.com
:thankyou: spkaplan
🆒 brandon
brandon
2023-09-01 12:08:49

I love all the stats. What makes this one the best? Is it more accurate for some reason?

brandon
2023-09-01 12:14:33

stats! Here's my first result. M1, wifi 6

andelink (andelinkyle@gmail.com)
2023-09-02 08:55:31

What makes this one the best?
Oh, simply because of all the stats lol I like all the descriptions, the drop-downs for each of the stats to show the individual measurements. I just think it’s cool

andelink (andelinkyle@gmail.com)
2023-09-02 08:55:42

okay i don’t know what this bot is doing

andelink (andelinkyle@gmail.com)
2023-09-02 09:34:12

wow my test results are amazing

andelink (andelinkyle@gmail.com)
2023-09-02 09:38:18

@brandon you had some packet loss! Does it go into any detail about that? What do you see when you hit the packet loss test drop-down?

brandon
2023-09-05 06:14:30

I don't have the tab anymore unfortunately. I ran the test again though and the packet loss went away so hopefully not a common occurrence!

Slackbot
2023-09-01 12:08:49

Kyle is the best.

😲 brandon
Slackbot
2023-09-02 08:55:32

Kyle is the best.

andelink (andelinkyle@gmail.com)
2023-09-08 14:48:07

til about the zen of github api

❯ gh api zen
Responsive is better than fast.

❯ repeat 10 echo $(gh api zen)
Encourage flow.
Favor focus over features.
Avoid administrative distraction.
Practicality beats purity.
Design for failure.
Avoid administrative distraction.
Non-blocking is better than blocking.
Practicality beats purity.
Mind your words, they are important.
Keep it logically awesome.

Or if you don’t have gh installed:
❯ curl -L -H "Authorization: Bearer ${GITHUB_TOKEN}" 
Speak like a human.

andelink (andelinkyle@gmail.com)
2023-10-24 11:22:57

til curl

so stupid

:nice: brandon
andelink (andelinkyle@gmail.com)
2024-08-17 22:46:15

@spkaplan another clipboard manager for you to consider:

getclipboard.app
Website
<https://getclipboard.app/>
Stars
4584
spkaplan
2024-08-19 10:20:20

Thanks! I'll try it out sometime.

andelink (andelinkyle@gmail.com)
2025-03-06 19:46:21

til about the install command which is basically just an enhanced cp. That's fine and all. But what I like is that I learned about it from a Tinder open source project 😆

gnu.org
😂 brandon, spkaplan
andelink (andelinkyle@gmail.com)
2025-03-06 19:46:41

GitHub
andelink (andelinkyle@gmail.com)
2025-03-25 17:00:46

til

What The Fuck Just Happened Today?
spkaplan
2025-03-26 09:15:12

i love the sound of it!

andelink (andelinkyle@gmail.com)
2025-04-22 08:34:25

til about this handy cli for downloading music. seems like the yt-dlp for music. been working reliably for me this morning so far


e.g.

freyr 
freyr

can pass it a link to a song, album, artist, or playlist. pretty convenient!

:nice2: spkaplan, keenin
keenin
2025-04-22 09:12:13

Need any API keys or need to be on a VPN?

andelink (andelinkyle@gmail.com)
2025-04-22 09:13:48

The docs mentioned Spotify API keys but I've been using it just fine with Apple Music and no keys supplied by me. I haven't provisioned any keys and I've downloaded like 30 songs maybe today?

andelink (andelinkyle@gmail.com)
2025-04-22 09:13:50

I have been on VPN

andelink (andelinkyle@gmail.com)
2025-04-22 09:14:08

But I'm almost always on VPN

keenin
2025-04-22 10:03:00

nice, sounds like a nice tool! I'll try it out

keenin
2025-04-22 10:03:09

on work vpn 😎

😎 andelink
spkaplan
2025-05-13 08:08:55

Copy to clipboard: If you miss the thumbnail, you can take a screenshot directly to the clipboard by holding the Control key while capturing (e.g., Control + Shift + Command + 3). Then paste it (Command + V) into your desired application.

copy screenshot to clipboard, so you can then just paste it into an llm, vs clicking on "upload image", and finding it in the Finder, etc...

r.taylor
2025-05-13 08:15:23

Good tip! It may be that I started on Windows which has this behavior, but one of the first things I did when I got a MacBook for work was to just swap the keybinds so that I copy screenshots to clipboard by default. I think I can count on one hand the number of times that I’ve had to save a screenshot as a file 😆 clipboard is so much more convenient

spkaplan
2025-05-13 08:34:18

This blew my mind. I love it!

spkaplan
2025-05-13 08:34:36

Especially with how often I am providing screenshots to AI

brandon
2025-05-13 09:54:56

haha yes, holding control key is a must! Also if you want to grab a snippet of the screen instead of the whole thing, use 4 instead of 3. You don't need to hold control the whole time, just when you click and drag.

  1. Command + Shift + 4

  2. Hold Control, Click and Drag

  3. Command + V

spkaplan
2025-05-13 10:00:32

holding control just changed my life.

:nice: brandon
andelink (andelinkyle@gmail.com)
2025-05-15 18:22:45

I feel like I am pretty good with keybindings, but I cannot get the mac screen capture key binds to stick. I can barely remember one of them

spkaplan
2025-05-16 11:14:18

yeah it's a weird combo of keys

andelink (andelinkyle@gmail.com)
2025-06-23 15:47:10

til about this example Chrome extension that "will steal literally everything it can"

The accompanying blog post is a great read and shows how easy it is to work against the users interests without them noticing. I only had four extensions enabled, but it inspired me to uninstall one because it did have somewhat broad permissions and I really don't need it.

The author designed the extension above to, instead of actually exfiltrate the data it collects, to simply present all collected data to you in its popup modal. If you want to do a (very) lazy validation of his claim before installing it as a dev extension, I asked Claude 4 Sonnet to verify it so I don't have to pepe-hacker

GitHub
andelink (andelinkyle@gmail.com)
2025-06-23 15:59:52

I ran it and yeah, it's collected a lot of data. Everything works as expected except for the geolocation capture. I didn't look into why, whether it's outdated or I have some permission disabled somewhere - idk.

I will post a screenshot of my results. It is a 37 page PDF. Most of it is cookies, so let me remove those first and then I'll share

andelink (andelinkyle@gmail.com)
2025-06-23 16:04:14

Here you go. I removed 25 pages of cookie values. The remainder is whatever

andelink (andelinkyle@gmail.com)
2025-06-23 16:05:13

I like how it takes screenshots of the tab I am viewing

spkaplan
2025-06-23 16:12:44

oh fun!