1
0
mirror of https://github.com/jbranchaud/til synced 2026-01-18 06:28:02 +00:00

Compare commits

...

3 Commits

Author SHA1 Message Date
nick-w-nick
b95b9bd0bd Merge 295fe153ad into 2028f6cb09 2025-01-28 10:51:44 -05:00
jbranchaud
2028f6cb09 Add List All Fonts On Your Machine as a Unix TIL 2025-01-27 23:34:44 -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
3 changed files with 28 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).
_1576 TILs and counting..._
_1577 TILs and counting..._
See some of the other learning resources I work on:
- [Ruby Operator Lookup](https://www.visualmode.dev/ruby-operators)
@@ -1545,6 +1545,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)
- [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)
- [List Files In A Single Column](unix/list-files-in-a-single-column.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,24 @@
# List All Fonts On Your Machine
In trying to figure out what _FiraCode_ font I have installed on my machine
and what it is called, I came across [this StackOverflow
answer](https://stackoverflow.com/a/52789662/535590) which shares the
following one-liner:
```bash
$ fc-list | awk '{$1=""}1' | cut -d: -f1 | sort | uniq
```
This uses `fc-list` to get the names of all the fonts available on your
machine. This seems to work on both Linux and Mac. Through a series of `awk`,
`cut`, and `sort | uniq`, this command produces a clean, easily-browsed list
of fonts.
I like to take this a step further by piping it all to `fzf` where I can then
narrow down the output to just lines that match _FiraCode_.
```bash
$ fc-list | awk '{$1=""}1' | cut -d: -f1 | sort | uniq | fzf
```
See also [`system_profiler SPFontsDataType`](https://apple.stackexchange.com/questions/35852/list-of-activated-fonts-with-shell-command-in-os-x/243746#243746).