1
0
mirror of https://github.com/jbranchaud/til synced 2026-01-15 04:58:02 +00:00

Compare commits

...

4 Commits

Author SHA1 Message Date
nick-w-nick
a8e58e82fb Merge 295fe153ad into eb3369d296 2025-02-12 17:15:38 +02:00
jbranchaud
eb3369d296 Add Limit Protocols Used In A cURL Command as a Unix TIL 2025-02-10 17:10:15 -06:00
jbranchaud
6f47e2f057 Add Uninstall LogiTech G Hub From Mac as a Mac TIL 2025-02-10 15:24:15 -06:00
nick-w-nick
295fe153ad added mention of ES6 compatibility
Hello, I've added a small blockquote below the description to indicate that this method of accessing an indefinite number of function arguments has been superseded by the use of the spread operator via rest parameters for ES6+ compatibility.
2022-01-06 11:39:04 -05:00
4 changed files with 49 additions and 1 deletions

View File

@@ -10,7 +10,7 @@ pairing with smart people at Hashrocket.
For a steady stream of TILs, [sign up for my newsletter](https://crafty-builder-6996.ck.page/e169c61186).
_1587 TILs and counting..._
_1589 TILs and counting..._
See some of the other learning resources I work on:
- [Ruby Operator Lookup](https://www.visualmode.dev/ruby-operators)
@@ -671,6 +671,7 @@ See some of the other learning resources I work on:
- [Set A Window To Its Default Zoom Level](mac/set-a-window-to-its-default-zoom-level.md)
- [Specify App When Opening From Command Line](mac/specify-app-when-opening-from-command-line.md)
- [Start Amphetamine Session With AppleScript](mac/start-amphetamine-session-with-applescript.md)
- [Uninstall LogiTech G Hub From Mac](mac/uninstall-logitech-g-hub-from-mac.md)
- [Use A Different Font With iTerm2](mac/use-a-different-font-with-iterm2.md)
- [Use Default Screenshot Shortcuts With CleanShot X](mac/use-default-screenshot-shortcuts-with-cleanshot-x.md)
- [View All Windows Of The Current App](mac/view-all-windows-of-the-current-app.md)
@@ -1555,6 +1556,7 @@ See some of the other learning resources I work on:
- [Killing A Frozen SSH Session](unix/killing-a-frozen-ssh-session.md)
- [Last Argument Of The Last Command](unix/last-argument-of-the-last-command.md)
- [Less With Style](unix/less-with-style.md)
- [Limit Protocols Used In A cURL Command](unix/limit-protocols-used-in-a-curl-command.md)
- [List All Fonts On Your Machine](unix/list-all-fonts-on-your-machine.md)
- [List All The Enabled ZSH Options](unix/list-all-the-enabled-zsh-options.md)
- [List All Users](unix/list-all-users.md)

View File

@@ -5,6 +5,8 @@ an array-like object with all of the arguments to the function. Even if not
all of the arguments are referenced in the function signature, they can
still be accessed via the `arguments` object.
> For ES6+ compatibility, the `spread` operator used via [rest parameters](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Functions/rest_parameters) is preferred over the `arugments` object when accessing an abritrary number of function arguments.
```javascript
function argTest(one) {
console.log(one);

View File

@@ -0,0 +1,17 @@
# Uninstall LogiTech G Hub From Mac
I rarely uninstall software from my Mac. And unless the software is nice enough
to provide a clear 'Uninstall' flow, it is not straightforward how to do it. In
fact, it probably varies quite a bit from app to app.
In the case of LogiTech's G Hub, I was able to find the following instructions
for uninstalling it. The thing of note is that the updater app can take an
`--uninstall` flag.
```bash
sudo /Applications/lghub.app/Contents/MacOS/lghub_updater.app/Contents/MacOS/lghub_updater --uninstall
```
I still had to remove the app launcher from my `Applications` directory.
[source](https://www.reddit.com/r/LogitechG/comments/bluth5/comment/lbhctx1/)

View File

@@ -0,0 +1,27 @@
# Limit Protocols Used In A cURL Command
I was about to install [`atuin`](https://github.com/atuinsh/atuin). I went to
their _Quick Start_ section to grab whatever command I would need to install
it. It was a `curl` statement piped to `sh`. The thing that caught my attention
though was I `curl` flag that I didn't recognize — `--proto`.
> Tells curl to limit what protocols it may use for transfers.
Using `curl --proto '=https' ...` we can enforce that only an `https` URL can
be used in this command.
Here is what happens if I try to run the `atuin`-provided `curl` command after
I have downgraded their URL to be `http`:
```bash
curl --proto '=https' --tlsv1.2 -LsSf http://setup.atuin.sh | sh
curl: (1) Protocol "http" not supported or disabled in libcurl
```
It doesn't even attempt the request. The protocol is considered unsupported and
the command immediately fails.
In addition to only installing software we trust, we should make sure we are
only doing so over a protocol we trust (namely, `https`).
See `man curl` for more details, including about the modifiers (`=`, `+`, `-`).