1
0
mirror of https://github.com/jbranchaud/til synced 2026-01-17 22:18:01 +00:00

Compare commits

...

3 Commits

Author SHA1 Message Date
nick-w-nick
139973eef4 Merge 295fe153ad into baab5738e7 2024-09-16 10:58:02 -04:00
jbranchaud
baab5738e7 Add Convert SVG To Favicon as a Unix TIL 2024-09-15 12:24:18 -05: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 32 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).
_1440 TILs and counting..._
_1441 TILs and counting..._
---
@@ -1356,6 +1356,7 @@ _1440 TILs and counting..._
- [Command Line Length Limitations](unix/command-line-length-limitations.md)
- [Compare Two Variables In A Bash Script](unix/compare-two-variables-in-a-bash-script.md)
- [Configure cd To Behave Like pushd In Zsh](unix/configure-cd-to-behave-like-pushd-in-zsh.md)
- [Convert SVG To Favicon](unix/convert-svg-to-favicon.md)
- [Copying File Contents To System Paste Buffer](unix/copying-file-contents-to-system-paste-buffer.md)
- [Copying Nested Directories With Ditto](unix/copying-nested-directories-with-ditto.md)
- [Count The Lines In A CSV Where A Column Is Empty](unix/count-the-lines-in-a-csv-where-a-column-is-empty.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,28 @@
# Convert SVG To Favicon
The imagemagick `convert` CLI tool can convert an SVG file into a transparent
favicon (ICO) file with the different standard sizes.
Assuming the background that we want to make transparent is white, then include
`-transparent white` and then to resize the icon include `-define
icon:auto-resize ...`. Point to the `image.svg` to be converted and specify the
name of the output file (`favicon.ico`).
```bash
$ convert image.svg -transparent white -define icon:auto-resize=16,32,48,64,128 favicon.ico
```
We can then use the `identify` CLI to inspect the `favicon.ico` file to see
that the above worked.
```bash
$ identify favicon.ico
favicon.ico[0] ICO 16x16 16x16+0+0 8-bit sRGB 0.000u 0:00.002
favicon.ico[1] ICO 32x32 32x32+0+0 8-bit sRGB 0.000u 0:00.004
favicon.ico[2] ICO 48x48 48x48+0+0 8-bit sRGB 0.000u 0:00.004
favicon.ico[3] ICO 64x64 64x64+0+0 8-bit sRGB 0.000u 0:00.004
favicon.ico[4] ICO 128x128 128x128+0+0 8-bit sRGB 99678B 0.000u 0:00.003
```
[source](https://www.joshmcarthur.com/2024/06/19/Auto-resizing-images-for-.ico-files.html)