<feed xmlns="http://www.w3.org/2005/Atom"> <id>https://karlsandin.com</id><title>Karl Sandin</title><subtitle>Collection of useful snippets related to frontend development.</subtitle> <updated>2021-07-13T16:07:06+02:00</updated> <author> <name>Karl Sandin</name> <uri>https://karlsandin.com</uri> </author><link href="/feed.xml" rel="self" type="application/atom+xml" /><link href="https://karlsandin.com" rel="alternate" type="text/html" /> <generator uri="https://jekyllrb.com/" version="3.9.0">Jekyll</generator> <rights> © 2021 Karl Sandin </rights> <icon>/assets/img/favicons/favicon.ico</icon> <logo>/assets/img/favicons/favicon-96x96.png</logo> <entry><title>Remove whitespace from an svg</title><link href="https://karlsandin.com/posts/remove-whitespace-svg/" rel="alternate" type="text/html" title="Remove whitespace from an svg" /><published>2021-07-13T15:00:00+02:00</published> <updated>2021-07-13T16:07:06+02:00</updated> <id>https://karlsandin.com/posts/remove-whitespace-svg/</id> <content src="https://karlsandin.com/posts/remove-whitespace-svg/" /> <author> <name>Karl Sandin</name> </author> <category term="Snippets" /> <category term="Javascript" /> <summary>Neat little trick to remove excess whitespace from an svg. Visit this link and paste the content of your svg and hit ‘Run’, the script will run and add a viewBox attribute which removes the whitesp...</summary> </entry> <entry><title>Restore a removed git branch</title><link href="https://karlsandin.com/posts/restore-removed-branch/" rel="alternate" type="text/html" title="Restore a removed git branch" /><published>2021-04-06T13:00:00+02:00</published> <updated>2021-07-13T16:07:06+02:00</updated> <id>https://karlsandin.com/posts/restore-removed-branch/</id> <content src="https://karlsandin.com/posts/restore-removed-branch/" /> <author> <name>Karl Sandin</name> </author> <category term="Commands" /> <summary>While doing some branch cleaning I accidentally deleted a branch I shouldn’t have deleted and apperently there is a way to restore it afterwards (phew!). Get git history: 1 $ git reflog Find row...</summary> </entry> <entry><title>Use js reduce to group array of objects by key</title><link href="https://karlsandin.com/posts/group-js-array-by-key-with-reduce/" rel="alternate" type="text/html" title="Use js reduce to group array of objects by key" /><published>2021-01-21T12:25:00+01:00</published> <updated>2021-07-13T16:07:06+02:00</updated> <id>https://karlsandin.com/posts/group-js-array-by-key-with-reduce/</id> <content src="https://karlsandin.com/posts/group-js-array-by-key-with-reduce/" /> <author> <name>Karl Sandin</name> </author> <category term="Snippets" /> <category term="Javascript" /> <summary>This will create a new object with each gender grouped by key using the reduce function. Array of objects to be grouped by gender: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 2...</summary> </entry> <entry><title>Add a timeout to fetch</title><link href="https://karlsandin.com/posts/add-timeout-to-fetch/" rel="alternate" type="text/html" title="Add a timeout to fetch" /><published>2020-11-03T15:19:00+01:00</published> <updated>2021-07-13T16:07:06+02:00</updated> <id>https://karlsandin.com/posts/add-timeout-to-fetch/</id> <content src="https://karlsandin.com/posts/add-timeout-to-fetch/" /> <author> <name>Karl Sandin</name> </author> <category term="Snippets" /> <category term="Javascript" /> <summary>This function returns 504 after time has passed. Instead of letting the user wait for the API to timeout which could take 60 seconds, it’s better to give the user feedback after a few seconds inste...</summary> </entry> <entry><title>Increase dashed/dotted border width</title><link href="https://karlsandin.com/posts/increase-dashed-border-width/" rel="alternate" type="text/html" title="Increase dashed/dotted border width" /><published>2020-08-28T10:37:00+02:00</published> <updated>2021-07-13T16:07:06+02:00</updated> <id>https://karlsandin.com/posts/increase-dashed-border-width/</id> <content src="https://karlsandin.com/posts/increase-dashed-border-width/" /> <author> <name>Karl Sandin</name> </author> <category term="Snippets" /> <category term="Css" /> <summary>The CSS property border doesn’t let us increase the width of the dots or the spacing between them, and this clever little trick is a workaround for that. 1 2 3 4 5 6 7 8 9 10 11 /*Horizontal*/ bac...</summary> </entry> </feed>
