{"version":"https://jsonfeed.org/version/1.1","title":"Binyamin's Blog","description":"Archived musings on code, the web, and passing thoughts.","home_page_url":"https://binyam.in/p","feed_url":"https://binyam.in/p/feed.json","icon":"/_astro/logo.CnbJfLTy.png","favicon":"/_astro/logo.CnbJfLTy.png","language":"en-US","authors":[{"name":"Binyamin Green","url":"https://binyam.in","avatar":"https://binyam.in/_astro/profile.BTSQPjhM_18x5bi.jpeg"}],"items":[{"id":"https://binyam.in/p/2023-03-16","url":"https://binyam.in/p/2023-03-16","title":"What information do you include in the README of a web project?","content_html":"<p>On Mastodon, <a href=\"https://matthiasott.com/\">Matthias Ott</a>\n<a href=\"https://mastodon.social/@matthiasott/110033938136836091\">asked</a>,\n<q cite=\"https://mastodon.social/@matthiasott/110033938136836091\">What\ninformation do you include in the README of a web project? Any great examples\nyou can think of? Do you use a template? Or do you write them from scratch every\nsingle time?</q> I started drafting a reply, which broke Mastodon’s character\nlimit. So, now it’s a blog post.</p>\n<p>Anyhow, the structure of a readme often depends on the project, but there are\nsome common points.</p>\n<ol>\n<li>\n<p>At the top of the readme, describe the purpose of the project. Be stupidly simple. State the obvious.</p>\n</li>\n<li>\n<p>If the readme is for a website, link to the live website. It's surprising how often people miss this part.</p>\n</li>\n<li>\n<p>If the readme is for a library, document the API. Nothing complicated, just a bullet-list with some code examples. Typescript definitions (<i>typedefs</i>) don't count. And while code should be self-documenting, it doesn't need to be the <em>only</em> form of documentation.</p>\n</li>\n<li>\n<p>It's often helpful to link to related projects. You give those projects the boost they need, and your users can make an informed decision about your project.</p>\n</li>\n<li>\n<p>Maintenance info: Is this just a personal project, or are you looking for actively looking for pull requests? Can people expect a quick response to their issues, comments, and pull requests? We're all busy, so there's no judgement here.</p>\n</li>\n<li>\n<p>For legal reasons, I <em>always</em> include a short note mentioning the license.</p>\n</li>\n</ol>\n<p>That’s my two cents. I also wrote\n<a href=\"http://binyam.in/p/2021-08-11/\">another shorter note about this topic</a>. So\nthat’s like, 3 cents. Which is very cheap, in case you wanted to\n<a href=\"https://www.buymeacoffee.com/Binyamin\">buy me a coffee</a>.</p>\n","date_published":"2023-03-16T23:15:55.787Z","tags":["opensource","documentation","opinion"]},{"id":"https://binyam.in/p/2022-12-23","url":"https://binyam.in/p/2022-12-23","title":"The Seductive Simplicity of CSS","content_html":"<p>I found this quote back in September.</p>\n<figure><blockquote>\n<p>CSS is a programming language. As unintuitive as it might feel to you at\ntimes, it’s not just these random things that happen. It’s built using very\nspecific rules. The problem is that most people never learn those rules.</p>\n<p>We start learning CSS by learning the syntax, which is super simple. That\ntricks us into thinking that it’s a simple language.</p>\n<p>Don’t let the simple syntax trick you. Dive into it and learn how it works.</p>\n</blockquote><figcaption><p><a href=\"https://www.kevinpowell.co\">Kevin Powell</a>, Software Engineer &amp; CSS Educator, on\n<cite></p><p><a href=\"https://twitter.com/KevinJPowell/status/1231979371386277888\">twitter</a></p></cite></figcaption></figure>\n","date_published":"2022-12-23T00:18:36.790Z","tags":["web","css","code","quote"]},{"id":"https://binyam.in/p/writing-css-with-purpose","url":"https://binyam.in/p/writing-css-with-purpose","title":"Writing CSS with Purpose","content_html":"<p>I’ve been paying more attention to my website recently. I’ve been asking why it\nexists, what I want it to look like, and other such questions.</p>\n<p>Anyhow, as I rewrite my CSS, I’ve begun to realize how poorly I use it as a\nlanguage. My process for writing it consists mostly of trial-and-error, without\nany idea of what I’m doing. That makes it hard to rewrite the code, since\nthere’s no organization or logic.</p>\n<!-- There are many methods for writing and structuring CSS. There are linters to keep you in check, and style-guides to give you advice. And that's great &mdash; it's important to be able to find a block of CSS when you need to change it. -->\n<h2 id=\"an-analogy\">An Analogy</h2>\n<p>I guess my point is that <b>writing CSS is kinda like typing on a keyboard</b>.<sup><a href=\"#user-content-fn-css-kbd\" id=\"user-content-fnref-css-kbd\" data-footnote-ref aria-describedby=\"footnote-label\">1</a></sup>\nSome typists don’t have the layout memorized. This group looks down at the\nkeyboard when typing, then up at the screen to check for accuracy, and then down\nagain. Other typists know the layout perfectly well, and focus their eyes on the\nscreen at all times.</p>\n<p>In the same fashion, some developers try CSS rules until they get what they\nwant. The conversation goes something like this: <q>Let’s try <code>float: left</code>.\nNope. How about flexbox? Ah, there we go. But it’s not wrapping\n(<em>sigh</em>).</q></p>\n<p>Other developers know <em>why</em> each rule does what it does. They don’t need\nto see the browser as often. There’s no “guess and check”. This second group\ntranscends methodologies like <a href=\"http://getbem.com\">BEM</a>, and opinionated\nquestions like “how to order your rules”.</p>\n<h2 id=\"an-ideal\">An Ideal</h2>\n<p>When you stop <i>pushing divs across the screen</i>, you start making a website.\nI want to stop pushing divs.\n<a href=\"https://ia.net/topics/on-apps-and-coffee\">Websites are coffee makers</a>, and I\nwant to brew some coffee. Currently, though, I don’t <em>understand</em> CSS. I\njust <em>write</em> it.</p>\n<section data-footnotes class=\"footnotes\"><h2 class=\"sr-only\" id=\"footnote-label\">Footnotes</h2>\n<ol>\n<li id=\"user-content-fn-css-kbd\">\n<p>Not literally. I mean, I suppose you <em>are</em> typing on a\nkeyboard. Unless your name is Josh Comeau, and\n<a href=\"https://www.joshwcomeau.com/blog/hands-free-coding/\">you can code without using your hands</a>.\nBut, I digress. <a href=\"#user-content-fnref-css-kbd\" data-footnote-backref=\"\" aria-label=\"Back to reference 1\" class=\"data-footnote-backref\">↩</a></p>\n</li>\n</ol>\n</section>\n","summary":"I don’t understand CSS. I just write it.","date_published":"2022-01-20T19:00:58.453Z","tags":["code","css","web","design"]},{"id":"https://binyam.in/p/2021-08-12","url":"https://binyam.in/p/2021-08-12","title":"Is GitHub's UI too friendly?","content_html":"<p>People have come to expect a repository’s source code to guide them through the\ncontribution process. That job belongs to documentation and developer guides.</p>\n<p>Comments are for the people writing the code, not necessarily the peanut\ngallery. If a readme was meant as a sales pitch, it would be a website or a blog\npost.</p>\n","date_published":"2021-08-12T01:22:24.614Z","tags":["opensource","code","documentation","opinion"]},{"id":"https://binyam.in/p/2021-06-13","url":"https://binyam.in/p/2021-06-13","title":"On Sadness and Happiness","content_html":"<p>Sadness. It surrounds our thoughts and emotions. We want to the believe this\nemotion doesn’t exist, let alone affect us. But it’s always there. It watches\nfrom the rafters, and it pulls us elsewhere – not exactly down, and not upwards\neither. Sadness is a cat, and we are mice. And happiness is the mousetrap.</p>\n<p>Happiness is the delusion of perfection. What we truly seek is balance. Balance\nkeeps your ice cream cone from falling apart again. It cannot remove the scrape\nfrom your knee, but it can give you a bandage. A kiss goodnight will not scare\naway any monsters, and still your bed will become safe for sleeping. You will\nhave learned nothing, because you have plenty of wisdom already.</p>\n<p>Let yourself grow taller. Plants need water and sunlight, but you are not a\nplant. Only fools set limits; the wise use guidelines. Run down the trail, even\nas you stay on the path. When the road splits, go left. Or right, it makes no\ndifference. Momentum is a precious thing, and choices are all too common.</p>\n","date_published":"2021-06-13T20:45:25.000Z","tags":["sadness","balance","prose","thoughts"]},{"id":"https://binyam.in/p/2021-06-11","url":"https://binyam.in/p/2021-06-11","title":"Advice on giving feedback","content_html":"<p>I was looking at some posts from my RSS feed, and a piece by\n<a href=\"https://ethanmarcotte.com/\">Ethan Marcotte</a> caught my eye. It helps to know\nthat people still value kindness.</p>\n<figure><blockquote>\n<p>Is there a piece of professional or life advice you’ve gotten that has always\nstuck with you? What is it? My grandmother once told me, “You should offer\npraise in public, and offer gentle criticism in private.” She said a lot that\nshaped the way I approach the world, but I think about that particular\nsuggestion a lot.</p>\n</blockquote><figcaption><p>Ethan Marcotte, in\n<cite><a href=\"https://ethanmarcotte.com/wrote/bookiversary/#is-there-a-piece-of-professional-or-life-advice-youve-gotten-that-has-always-stuck-with-you-what-is-it\">Bookiversary</a></cite></p></figcaption></figure>\n","date_published":"2021-06-11T20:43:27.394Z","tags":["kindness","quote"]},{"id":"https://binyam.in/p/2021-03-18","url":"https://binyam.in/p/2021-03-18","title":"I shaved 65 kilobytes off my site","content_html":"<p>I saved 65 KB on this site. Basically, I removed two web-fonts and cut out some\nCSS. Overall, I went from 93.8 KB to 28.8 KB.</p>\n<p>I rewrote my styles using vanilla CSS. Originally, I was using a\n<a href=\"https://sass-lang.com/\">SCSS</a> because of its nesting capability. Another\nbenefit of SCSS is that you can split your styles among multiple files. By\ndefault, CSS doesn’t perform well in that respect<sup><a href=\"#user-content-fn-1\" id=\"user-content-fnref-1\" data-footnote-ref aria-describedby=\"footnote-label\">1</a></sup>. An advantage of using\nCSS, was that it forced me to write my styles more succinctly. By limiting\nmyself to one file, I gave myself a practical reason to keep the file size to a\nminimum.</p>\n<p>I also started loading fewer web-fonts. I removed the body and display\nweb-fonts, opting for local fonts instead. I was using Roboto (sans-serif) for\nthe body text, and Lora (serif) for the headings. I switched them both to a\nsingle, local-only, “catch-all” font stack. I can hardly tell the difference.</p>\n<p>Otherwise, I made minimal changes to the website’s visual design. In the process\nof rewriting the CSS, I made some stylistic decisions. For example, I changed\nthe theme of my code blocks from “Nord” (a dark theme) to “GitHub Light”. I also\nremoved the CSS reset I was using, which was\n<a href=\"https://necolas.github.io/normalize.css/\">normalize.css by Nicolas Gallagher</a>.</p>\n<figure><figcaption><p>Size Comparison</p></figcaption><table>\n\t<thead>\n\t\t<tr>\n\t\t\t<th></th>\n\t\t\t<th>Before</th>\n\t\t\t<th>After</th>\n\t\t</tr>\n\t</thead>\n\t<tbody>\n\t\t<tr>\n\t\t\t<th scope=\"row\">Roboto font</th>\n\t\t\t<td>15.4 KB</td>\n\t\t\t<td>0</td>\n\t\t</tr>\n\t\t<tr>\n\t\t\t<th scope=\"row\">Lora font</th>\n\t\t\t<td>34.5 KB</td>\n\t\t\t<td>0</td>\n\t\t</tr>\n\t\t<tr>\n\t\t\t<th scope=\"row\">Google Fonts CSS *</th>\n\t\t\t<td>11.4 KB</td>\n\t\t\t<td>2.4 KB</td>\n\t\t</tr>\n\t\t<tr>\n\t\t\t<th scope=\"row\">Normalize & code-block theme *</th>\n\t\t\t<td>4.2 KB</td>\n\t\t\t<td>854 B</td>\n\t\t</tr>\n\t\t<tr>\n\t\t\t<th scope=\"row\">Sitewide CSS *</th>\n\t\t\t<td>5.4 KB</td>\n\t\t\t<td>3.4 KB</td>\n\t\t</tr>\n\t\t<tr>\n\t\t\t<th scope=\"row\">Print CSS</th>\n\t\t\t<td>801 B</td>\n\t\t\t<td>748 B</td>\n\t\t</tr>\n\t</tbody>\n</table><p>* Uncompressed size</p></figure>\n<p>Oh, and the best part is… my site is now only 100 ms faster. 326% smaller,\n8.3% faster. Go figure. 🤷‍♂️</p>\n<section data-footnotes class=\"footnotes\"><h2 class=\"sr-only\" id=\"footnote-label\">Footnotes</h2>\n<ol>\n<li id=\"user-content-fn-1\">\n<p>Think about it. Every time you request a CSS file, whether using a\n<code>&lt;link/&gt;</code> tag or <code>@include</code> syntax, you make a network request. As every\nnetwork request has a cost, it’s much more practical to combine your CSS\ninto one file. <a href=\"#user-content-fnref-1\" data-footnote-backref=\"\" aria-label=\"Back to reference 1\" class=\"data-footnote-backref\">↩</a></p>\n</li>\n</ol>\n</section>\n","date_published":"2021-03-18T00:53:47.797Z","tags":["changelog","web"]},{"id":"https://binyam.in/p/2021-01-11","url":"https://binyam.in/p/2021-01-11","title":"Doubting full-post RSS feeds","content_html":"<p>I read\n<a href=\"https://kevq.uk/why-having-a-full-post-rss-feed-is-a-good-idea/\">a post by Kev Quirk</a>\nchampioning full-post RSS feeds.</p>\n<p>I’m trying to think of ways to encourage people who use my RSS feed (if they\nexist 😉) to actually read the articles on my website.</p>\n<p>Why? I work hard on my website.</p>\n<ul>\n<li>I try to be accessible at all times</li>\n<li>I aim for the optimal reading experience</li>\n<li>I design for aesthetics as well as simplicity</li>\n</ul>\n<p>Mainly, though, my website represents <em>me</em>. It’s the only coding project I’ve\nworked on steadily for the past three years. It’s been painstakingly redesigned\nmultiple times, and I try to put flair and charm into each iteration. I care\ndeeply about my website.</p>\n<p>If you have any suggestions, please <a href=\"/contact\">let me know</a>.</p>\n","date_published":"2021-01-11T15:17:13.385Z","tags":["opinion","rss","web"]},{"id":"https://binyam.in/p/my-reading-goals-in-2020","url":"https://binyam.in/p/my-reading-goals-in-2020","title":"My Reading Goals in 2020","content_html":"<p>At the beginning of 2020, after seeing a Goodreads challenge, I decided to read\ntwelve books that year. And I did read some wonderful books and novels. In\n<a href=\"https://www.goodreads.com/book/show/37903770-norse-mythology\"><em>Norse Mythology</em></a>,\nNeil Gaiman paints a pretty picture of the Norse pantheon.\n<a href=\"https://www.goodreads.com/book/show/31868169-letters-to-a-young-writer\"><em>Letters to a Young Writer</em></a>,\nby Colum McCann, advises young writers on how to hone their craft, and itself\nexhibits excellent writing.</p>\n<h2 id=\"the-problem\">The Problem</h2>\n<p>While I loved what I read, I only completed seven out of the twelve I had\nplanned to read. Initially, I was disappointed that I didn’t meet my goal.\nReading one book each month should not have been hard for me to do. Why couldn’t\nI have just <em>read more</em>?</p>\n<p>Looking back, I find that I didn’t want to rush through any books. In order to\nread a 300-page book in one month, I would need to do at least ten pages per\nday. That’s great for fiction or light-reading. But some of the books I had\nlined-up were full of information which needed processing. My system was faulty.</p>\n<h2 id=\"a-new-goal\">A New Goal</h2>\n<p>If I’m going to up my reading game in 2021, I need to devise a different\nchallenge. I could separate my books into light-reading and heavy-reading. Or\nmaybe my goal was fine, and I need to widen my selection of books.</p>\n<p>As I write this, I realize that the issue is about my <em>choice</em> of books. You\nsee, there are a couple things I’d like to accomplish by reading. I want to take\nan emotional journey through a fabricated world. I’d also like to learn more\nabout certain concepts and ideas. To me, this distinction is similar to that of\nfiction versus non-fiction.</p>\n<p><strong>Here’s my new goal</strong>: I’d like to read ten books this year. Of those ten, four\nmust be novels or light-reading. The remaining six are be up to me.</p>\n<h2 id=\"parting-thoughts\">Parting Thoughts</h2>\n<p>Honestly, though, every book can be a novel. Every book should be a journey,\nbroken into both logical and emotionally-provoking sections. How else did Lin\nManuel-Miranda transform a scholarly work into the acclaimed broadway musical,\n<em>Hamilton</em>? You don’t need to be a writer to tell stories, but you should tell a\nstory when you write.</p>\n<hr>\n<h2 id=\"full-list\">Full List</h2>\n<p>Here’s my full book list from 2020.</p>\n<ol>\n<li><em>Norse Mythology</em>, by Neil Gaiman</li>\n<li><em>The Voyage of the Dawn Treader</em> (Chronicles of Narnia #5), by C. S. Lewis</li>\n<li><em>Writer’s Digest Guide to Magazine Article Writing</em>, by Kerrie L. Flanagan</li>\n<li><em>Letters to a Young Writer</em>, by Colum McCann</li>\n<li><em>Tuesdays with Morrie</em>, by Mitch Albom</li>\n<li><em>Mister Monday</em> (The Keys to the Kingdom #1), by Garth Nix</li>\n<li><em>Grim Tuesday</em> (The Keys to the Kingdom #2), by Garth Nix</li>\n</ol>\n<p>I ended the year in the middle of <em>A Universe Made for Two</em>, by Jack M. Daniel.</p>\n","summary":"I read some wonderful books in 2020. While I didn't reach my quota, I'm ready for next year.","date_published":"2021-01-04T20:38:53.122Z","tags":["reading","yearly-review"]},{"id":"https://binyam.in/p/2020-12-29","url":"https://binyam.in/p/2020-12-29","title":"Reorganizing my website","content_html":"<p><q cite=\"https://www.w3.org/Provider/Style/URI.html\">URIs don’t change: people\nchange them.</q> That’s what\n<a href=\"https://en.wikipedia.org/wiki/Tim_Berners-Lee\">Tim Berners-Lee</a> says, either\nway. I was reading his article\n<a href=\"https://www.w3.org/Provider/Style/URI.html\">“Cool URIs don’t change”</a>, and I\nstarted thinking about my own website. I recently implemented\n<a href=\"/c/micro\">a micro blog</a>, and it’s possible that I will want more kinds of posts\nin the future.</p>\n<p>That’s the answer, I realized! They’re all <em>posts</em>, each with a different\n<em>category</em>. I decided to construct these categories using the Indieweb’s concept\nof a <a href=\"https://indieweb.org/posts#Types_of_Posts\"><strong>post type</strong></a>. I just need a\nblog and a micro blog (indieweb: articles and notes), and I should have room for\nother posts like photos and book reviews.</p>\n<p>So, I changed my <abbr title=\"Uniform Resource Locator\">URL</abbr> structure.\nStatic pages, such as contact and now, stay the same. If it’s a post, it’ll be\nunder <code>/p/{title}/</code>. Lastly, each post had a category page like <code>/blog/</code>. Under\nthis new system, that’ll be <code>/c/{category}/</code>.</p>\n<p>Okay, that’s a wrap on this article. Oh, one more thing. I set up redirects for\nmy old posts. That’s all. Thanks for reading!</p>\n","summary":"Tim Berners-Lee inspired me to change the way my URLs are structured.","date_published":"2020-12-29T22:11:45.853Z","tags":["changelog"]},{"id":"https://binyam.in/p/2020-12-15","url":"https://binyam.in/p/2020-12-15","title":"Your Turn to Yell","content_html":"<p>“Silence is Golden”, they say. They’re right, of course. Silence is the key to\nevery problem, as well as to every proposed solution. Arguing won’t solve\nproblems; not directly, anyhow. So what will? Listen, you say. And you yell, a\nlong, painful moan. I sit, and you scream. I listen while you lament. It’s a\npowerful dynamic, this. I learn your hardships, and you- well, I don’t know what\nyou do, but it’s dramatic. You shout, and I sympathize. You accuse, and I admit.\nIs it my turn yet?</p>\n<p>Finally, you come to the end of your conversation. A question burns in my belly,\nthough I dare not ask it. You leave, and take with you a bundle of anger. I\nleave too, adding yours to my collection. May I talk now? No, not yet. You see,\nto talk I need a listener. My door is open; you may vent any time you please.\nPerhaps, one day, you will open yours.</p>\n","date_published":"2020-12-15T02:05:08.000Z"},{"id":"https://binyam.in/p/filter-posts-by-tag","url":"https://binyam.in/p/filter-posts-by-tag","title":"Filter Posts by Tag","content_html":"<p>Blogs can quickly become disorganized. You might want to link to a page on your\nwebsite which only lists posts about CSS. With a bit of javascript, you can use\n<code>/blog?tag=css</code> to filter your posts.</p>\n<p>For the following method to work, each post item should have a\n<a href=\"https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/data-*\">data attribute</a>\nof <code>data-tags=\"[tag1,tag2]\"&gt;</code>. On a related note, the method assumes a basic\nknowledge of HTML. Feel free to glance at\n<a href=\"https://www.w3schools.com/html/\">W3Schools</a> or\n<a href=\"https://developer.mozilla.org/en-US/docs/Web/HTML\">MDN</a>.</p>\n<p>First, we need to find our posts. Use the <code>document.querySelectorAll</code>\nmethod<sup><a href=\"#user-content-fn-1\" id=\"user-content-fnref-1\" data-footnote-ref aria-describedby=\"footnote-label\">1</a></sup>. The method takes one parameter: A selector string formatted like a\ncss selector. Now, we need to get the tag in the url. The global\n<code>location.search</code> variable provides us with the query parameters at the end of\nthe url. This will give us a string, such as <code>?topic=css</code>, which we can\nmanipulate to find the tag.</p>\n<p>Find which posts <em>don’t</em> have the tag. For each post, check if the tags in the\n<code>data-tags</code> attribute include the one we found in the url. (Hint: use\n<code>Array.filter</code>) Then, hide the filtered posts. HTML has a handy <code>hidden</code>\nattribute for situations like this. Set the hidden attribute of each filtered\npost to <code>true</code>.</p>\n<p>You can now filter your blog posts by tag. Here’s the full snippet.</p>\n<pre class=\"astro-code vitesse-light\" style=\"background-color:#ffffff;color:#393a34; overflow-x: auto;\" tabindex=\"0\" data-language=\"html\"><code><span class=\"line\"><span style=\"color:#999999\">&lt;</span><span style=\"color:#1E754F\">ul</span><span style=\"color:#999999\">&gt;</span></span>\n<span class=\"line\"><span style=\"color:#999999\">\t&lt;</span><span style=\"color:#1E754F\">li</span><span style=\"color:#B07D48\"> class</span><span style=\"color:#999999\">=</span><span style=\"color:#B5695977\">\"</span><span style=\"color:#B56959\">post</span><span style=\"color:#B5695977\">\"</span><span style=\"color:#999999\">&gt;</span></span>\n<span class=\"line\"><span style=\"color:#A0ADA0\">\t\t&lt;!-- contents --&gt;</span></span>\n<span class=\"line\"><span style=\"color:#999999\">\t&lt;/</span><span style=\"color:#1E754F\">li</span><span style=\"color:#999999\">&gt;</span></span>\n<span class=\"line\"><span style=\"color:#A0ADA0\">\t&lt;!-- more --&gt;</span></span>\n<span class=\"line\"><span style=\"color:#999999\">&lt;/</span><span style=\"color:#1E754F\">ul</span><span style=\"color:#999999\">&gt;</span></span></code></pre>\n<pre class=\"astro-code vitesse-light\" style=\"background-color:#ffffff;color:#393a34; overflow-x: auto;\" tabindex=\"0\" data-language=\"js\"><code><span class=\"line\"><span style=\"color:#A0ADA0\">// Select all posts</span></span>\n<span class=\"line\"><span style=\"color:#AB5959\">const</span><span style=\"color:#B07D48\"> posts</span><span style=\"color:#999999\"> =</span><span style=\"color:#999999\"> [...</span><span style=\"color:#B07D48\">document</span><span style=\"color:#999999\">.</span><span style=\"color:#59873A\">querySelectorAll</span><span style=\"color:#999999\">(</span><span style=\"color:#B5695977\">'</span><span style=\"color:#B56959\">.post</span><span style=\"color:#B5695977\">'</span><span style=\"color:#999999\">)];</span></span>\n<span class=\"line\"></span>\n<span class=\"line\"><span style=\"color:#A0ADA0\">// Get the tag in the url</span></span>\n<span class=\"line\"><span style=\"color:#AB5959\">const</span><span style=\"color:#B07D48\"> tag</span><span style=\"color:#999999\"> =</span><span style=\"color:#B07D48\"> location</span><span style=\"color:#999999\">.</span><span style=\"color:#B07D48\">search</span><span style=\"color:#999999\">.</span><span style=\"color:#59873A\">slice</span><span style=\"color:#999999\">(</span><span style=\"color:#B07D48\">location</span><span style=\"color:#999999\">.</span><span style=\"color:#B07D48\">search</span><span style=\"color:#999999\">.</span><span style=\"color:#59873A\">indexOf</span><span style=\"color:#999999\">(</span><span style=\"color:#B5695977\">'</span><span style=\"color:#B56959\">=</span><span style=\"color:#B5695977\">'</span><span style=\"color:#999999\">)</span><span style=\"color:#AB5959\"> +</span><span style=\"color:#2F798A\"> 1</span><span style=\"color:#999999\">);</span></span>\n<span class=\"line\"></span>\n<span class=\"line\"><span style=\"color:#1E754F\">if</span><span style=\"color:#999999\"> (</span><span style=\"color:#B07D48\">tag</span><span style=\"color:#999999\">)</span><span style=\"color:#999999\"> {</span></span>\n<span class=\"line\"><span style=\"color:#A0ADA0\">\t// Find which posts don’t have the tag</span></span>\n<span class=\"line\"><span style=\"color:#AB5959\">\tlet</span><span style=\"color:#B07D48\"> postsNoTag</span><span style=\"color:#999999\"> =</span><span style=\"color:#B07D48\"> posts</span><span style=\"color:#999999\">.</span><span style=\"color:#59873A\">filter</span><span style=\"color:#999999\">(</span><span style=\"color:#B07D48\">l</span><span style=\"color:#999999\"> =&gt;</span><span style=\"color:#999999\"> {</span></span>\n<span class=\"line\"><span style=\"color:#1E754F\">\t\treturn</span><span style=\"color:#B07D48\"> JSON</span><span style=\"color:#999999\">.</span><span style=\"color:#59873A\">parse</span><span style=\"color:#999999\">(</span><span style=\"color:#B07D48\">l</span><span style=\"color:#999999\">.</span><span style=\"color:#B07D48\">dataset</span><span style=\"color:#999999\">.</span><span style=\"color:#B07D48\">tags</span><span style=\"color:#999999\">).</span><span style=\"color:#59873A\">includes</span><span style=\"color:#999999\">(</span><span style=\"color:#B07D48\">tag</span><span style=\"color:#999999\">)</span><span style=\"color:#AB5959\"> ===</span><span style=\"color:#1E754F\"> false</span><span style=\"color:#999999\">;</span></span>\n<span class=\"line\"><span style=\"color:#999999\">\t});</span></span>\n<span class=\"line\"></span>\n<span class=\"line\"><span style=\"color:#A0ADA0\">\t// Hide all posts which don’t have the tag</span></span>\n<span class=\"line\"><span style=\"color:#B07D48\">\tpostsNoTag</span><span style=\"color:#999999\">.</span><span style=\"color:#59873A\">forEach</span><span style=\"color:#999999\">(</span><span style=\"color:#B07D48\">p</span><span style=\"color:#999999\"> =&gt;</span><span style=\"color:#999999\"> {</span></span>\n<span class=\"line\"><span style=\"color:#B07D48\">\t\tp</span><span style=\"color:#999999\">.</span><span style=\"color:#59873A\">setAttribute</span><span style=\"color:#999999\">(</span><span style=\"color:#B5695977\">'</span><span style=\"color:#B56959\">hidden</span><span style=\"color:#B5695977\">'</span><span style=\"color:#999999\">,</span><span style=\"color:#1E754F\"> true</span><span style=\"color:#999999\">);</span></span>\n<span class=\"line\"><span style=\"color:#999999\">\t});</span></span>\n<span class=\"line\"><span style=\"color:#999999\">}</span></span></code></pre>\n<section data-footnotes class=\"footnotes\"><h2 class=\"sr-only\" id=\"footnote-label\">Footnotes</h2>\n<ol>\n<li id=\"user-content-fn-1\">\n<p>For more details, see\n<a href=\"https://developer.mozilla.org/en-US/docs/Web/API/Document/querySelectorAll\">this page on MDN</a>. <a href=\"#user-content-fnref-1\" data-footnote-backref=\"\" aria-label=\"Back to reference 1\" class=\"data-footnote-backref\">↩</a></p>\n</li>\n</ol>\n</section>\n","summary":"Blogs can quickly become disorganized. With a bit of javascript, you can filter your posts by tag.","date_published":"2020-06-10T16:00:00.000Z","date_modified":"2021-05-20T17:21:42.000Z","tags":["code","blogging","html"]},{"id":"https://binyam.in/p/list-all-posts-using-11ty","url":"https://binyam.in/p/list-all-posts-using-11ty","title":"List all Posts using 11ty","content_html":"<p>On the front page of a blog, we often list the title of every post on the site.\n<a href=\"https://jekyllrb.com\">Jekyll</a> will automatically list all pages within the\n<code>_post</code> directory under one collection. <a href=\"https://11ty.dev\">Eleventy</a>, however,\ncreates collections based on the tags. In other words, the only way to tell\nEleventy that your page is a blog post is by adding an extra tag. You may not\nwant to add the same tag for every post, especially if you already categorize\nyour posts.</p>\n<p>One <del>workaround</del> <em>fully documented feature</em> is to create a custom collection.\nIn <code>.eleventy.js</code>, use the <code>addCollection</code> method to define a new collection.\nYou can call it <em>posts</em>, if you want to (you can also call it <em>ice_cream</em>). Use\n<a href=\"https://github.com/isaacs/node-glob\">glob syntax</a> to get only the pages inside\nyour post folder. You can now find all your blog posts with the\n<code>collections.posts</code> variable.</p>\n<p>Here’s the code for your <code>.eleventy.js</code> file.</p>\n<pre class=\"astro-code vitesse-light\" style=\"background-color:#ffffff;color:#393a34; overflow-x: auto;\" tabindex=\"0\" data-language=\"js\"><code><span class=\"line\"><span style=\"color:#998418\">module</span><span style=\"color:#999999\">.</span><span style=\"color:#998418\">exports</span><span style=\"color:#999999\"> =</span><span style=\"color:#AB5959\"> function</span><span style=\"color:#999999\">(</span><span style=\"color:#B07D48\">eleventyConfig</span><span style=\"color:#999999\">)</span><span style=\"color:#999999\"> {</span></span>\n<span class=\"line\"><span style=\"color:#B07D48\">\televentyConfig</span><span style=\"color:#999999\">.</span><span style=\"color:#59873A\">addCollection</span><span style=\"color:#999999\">(</span><span style=\"color:#B5695977\">'</span><span style=\"color:#B56959\">posts</span><span style=\"color:#B5695977\">'</span><span style=\"color:#999999\">,</span><span style=\"color:#AB5959\"> function</span><span style=\"color:#999999\">(</span><span style=\"color:#B07D48\">collection</span><span style=\"color:#999999\">)</span><span style=\"color:#999999\"> {</span></span>\n<span class=\"line\"><span style=\"color:#1E754F\">\t\treturn</span><span style=\"color:#B07D48\"> collection</span><span style=\"color:#999999\">.</span><span style=\"color:#59873A\">getFilteredByGlob</span><span style=\"color:#999999\">(</span><span style=\"color:#B5695977\">'</span><span style=\"color:#B56959\">posts/**/*.md</span><span style=\"color:#B5695977\">'</span><span style=\"color:#999999\">);</span></span>\n<span class=\"line\"><span style=\"color:#999999\">\t});</span></span>\n<span class=\"line\"><span style=\"color:#A0ADA0\">\t// ...</span></span>\n<span class=\"line\"><span style=\"color:#999999\">};</span></span></code></pre>\n","summary":"Unlike Jekyll, Eleventy doesn't create a collection of all posts. But you can do it yourself very easily.","date_published":"2020-05-04T16:00:00.000Z","tags":["code","blogging","eleventy"]},{"id":"https://binyam.in/p/my-top-reading-picks","url":"https://binyam.in/p/my-top-reading-picks","title":"My top reading picks","content_html":"<p>Intricate worlds ensnare the mind. For this reason, I enjoy reading fantasy and\nscience-fiction books. There are so many good novels, and endless amounts of\nexcellent short-fiction. To create a list of my favorite stories is impossible —\nI have so many! What follows, then, is a rough list of a couple books which I\nadore.</p>\n<h2 id=\"harry-potter-and-the-order-of-the-phoenix\">Harry Potter and the Order of the Phoenix</h2>\n<p><em>By J. K. Rowling (Harry Potter, book 5)</em></p>\n<p><a href=\"https://www.barnesandnoble.com/w/harry-potter-and-the-order-of-the-phoenix-j-k-rowling/1100041270\">Barnes &amp; Noble</a></p>\n<p>The fifth book of the Harry Potter series has always stuck with me, maybe\nbecause it represents coming-of-age. Harry Potter becomes a man as he defies the\nMinistry’s control of his school. But maybe I love it because of the world in\nwhich J. K. Rowling places us, and the magic she brings to our lives by doing\nso.</p>\n<h2 id=\"the-voyage-of-the-dawn-treader\">The Voyage of the Dawn Treader</h2>\n<p><em>By C. S. Lewis (The Chronicles of Narnia, book 5)</em></p>\n<p><a href=\"https://www.barnesandnoble.com/w/voyage-of-the-dawn-treader-c-s-lewis/1100550844?ean=9780061969065\">Barnes &amp; Noble</a></p>\n<p>This story tells of wonderful, adventurous myth. The book is an expedition into\nour minds, probing the depths of our imagination.<em>The Voyage of the Dawn\nTreader</em>is a standard of children’s literature.</p>\n<h2 id=\"norse-mythology\">Norse Mythology</h2>\n<p><em>By Neil Gaiman</em></p>\n<p><a href=\"https://www.barnesandnoble.com/w/norse-mythology-neil-gaiman/1124023596\">Barnes &amp; Noble</a></p>\n<p>Some would call this book a record of history. The stories, however, continue to\nenthrall and entrance as no history textbook ever has. Gaiman departs from\nMarvel’s floodlit depiction of Thor the Mighty and gives insight into the\ncomplex mind of Loki the Trickster. He paints the Norse pantheon with a\nsignature, resplendent touch.</p>\n<h2 id=\"the-fellowship-of-the-ring\">The Fellowship of the Ring</h2>\n<p><em>By J. R. R. Tolkien (Lord of the Rings, Part One)</em></p>\n<p><a href=\"https://www.barnesandnoble.com/w/fellowship-of-the-ring-j-r-r-tolkien/1100013647\">Barnes &amp; Noble</a></p>\n<p>J. R. R. Tolkien was an Oxford professor, and the writing style reflects his\nstature. The world is magnificent, and the plot is riveting. I particularly\nconnect with the main character, Frodo Baggins. Frodo is timid yet persistant,\nwhich I relate to.</p>\n<h2 id=\"the-martian-chronicles\">The Martian Chronicles</h2>\n<p><em>By Ray Bradbury</em></p>\n<p><a href=\"https://www.barnesandnoble.com/w/martian-chronicles-ray-bradbury/1100197062?ean=9780062079930\">Barnes &amp; Noble</a></p>\n<p>This collection of science-fiction stories covers Earth’s colonization of Mars,\nboth from the explorers’ perspectives as well as from the natives’ viewpoint. As\nwell as entertaining our imagination, Ray Bradbury warns of a dark future; one\nwhich is in our hands.</p>\n<h2 id=\"a-study-in-scarlet\">A Study in Scarlet</h2>\n<p><em>By Sir Arthur Conan Doyle (A Sherlock Holmes novel)</em></p>\n<p><a href=\"https://www.barnesandnoble.com/w/study-in-scarlet-arthur-conan-doyle/1100163548?ean=9780140439083\">Barnes &amp; Noble</a></p>\n<p>Soon after Jack the Ripper tore through London, Sir Arthur Conan Doyle\nintroduced a detective who saw through any crime. Sherlock Holmes meets his\nlegendary partner, John Watson, and the rest is history. As we become intimate\nwith Holmes, we observe his many strengths and inevitable weaknesses. Sherlock\nHolmes’ debut story is an essential piece for any bookcase.</p>\n<h2 id=\"the-letter-for-the-king\">The Letter for the King</h2>\n<p><em>By Tonke Dragt</em></p>\n<p><a href=\"https://www.barnesandnoble.com/w/the-letter-for-the-king-tonke-dragt/1117057885?ean=9781782690818\">Barnes &amp; Noble</a></p>\n<p>Tonke Dragt published this story in the Netherlands in 1962, but it was over\nfifty years before it was introduced to the English-speaking world.\nSixteen-year-old Tiuri must trust no one as he ventures forth on his simple\nmission. As he fends of bandits on the back of each page, he emanates\nself-worth.</p>\n<hr>\n<p>These are just a few of my favorites. Frank Herbert, Roald Dahl, and many others\nhave also left behind timeless works. For more wonderful titles, check out\n<a href=\"https://www.pbs.org/the-great-american-read/books/\">The Great American Read</a> by\nPBS, or poke around on <a href=\"https://goodreads.com/\">Goodreads</a>.</p>\n","summary":"I love reading fantasy and science-fiction. Here are a couple of my favorite books ever.","date_published":"2020-03-23T16:00:00.000Z","tags":["reading"]},{"id":"https://binyam.in/p/2020-03-12","url":"https://binyam.in/p/2020-03-12","title":"[A clever phrase]","content_html":"<p>Here, I subtly introduce you to the topic at hand, and grab your attention. I\nmay use fantastic words and extravagant linguistics, or I can just be really\nboring and stuff. That’s called an <strong>introduction</strong>. Use it.</p>\n<p>Now, I start to get into the <em>nitty-gritty</em> of the article. I may include some\ncool things like <code>{% liquid:tags %}</code> or inline code.</p>\n<pre class=\"astro-code vitesse-light\" style=\"background-color:#ffffff;color:#393a34; overflow-x: auto;\" tabindex=\"0\" data-language=\"js\"><code><span class=\"line\"><span style=\"color:#B07D48\">document</span><span style=\"color:#999999\">.</span><span style=\"color:#59873A\">before</span><span style=\"color:#999999\">(</span><span style=\"color:#B5695977\">'</span><span style=\"color:#B56959\">codeBlock</span><span style=\"color:#B5695977\">'</span><span style=\"color:#999999\">,</span><span style=\"color:#999999\"> ()</span><span style=\"color:#999999\"> =&gt;</span><span style=\"color:#999999\"> {</span></span>\n<span class=\"line\"><span style=\"color:#1E754F\">  do</span><span style=\"color:#999999\">(</span><span style=\"color:#B5695977\">\"</span><span style=\"color:#B56959\">explain with words</span><span style=\"color:#B5695977\">\"</span><span style=\"color:#999999\">);</span></span>\n<span class=\"line\"><span style=\"color:#999999\">})</span></span></code></pre>\n<p>Now, I write another paragraph. Write at least two <strong>body</strong> paragraphs, with at\nleast three sentences each. Use proper grammar, <del>ppl</del> people!</p>\n<p>Lastly, I leave you with a thought which will remind you of what I’ve written.\nIt’s called a <strong>conclusion</strong>, and it’s like a party favor or gift. It leaves the\nreader with a good impression. Think of it as a nice way of saying, <em>goodbye</em>.</p>\n","summary":"Unlike the title, this part can be a full sentence.","date_published":"2020-03-12T12:00:00.000Z","tags":["tutorial","jokes","writing"]},{"id":"https://binyam.in/p/notes-on-startup-ideas","url":"https://binyam.in/p/notes-on-startup-ideas","title":"Notes on Startup Ideas","content_html":"<p><strong>Note:</strong> This article is a summary of\n<a href=\"https://peterthaleikis.com/business-idea-validation/\">https://peterthaleikis.com/business-idea-validation/</a></p>\n<p>Eureka! You have a business idea. What should you do first? No, It’s not the\ndevelopment phase. It isn’t the design or the marketing stage. The process\nbegins with validating your idea.</p>\n<p>People like to jump at whims, but starting with research is helpful for many\nreasons. Most likely, you have no money set aside to allocate for the idea. Even\nthough you’re motivated at the moment, you will get discouraged after a while.\nYou’ll discover competition, or find the marketing stressful and overwhelming.\nWhatever the reason, plowing through the initial stages will give you powerful\ninsights for the future.</p>\n<p>To validate your idea, conduct some research. Gather a list of relevant phrases,\nwords, and topics (keywords and keyphrases). Throw them at a bunch of popular\nwebsites, such as Google search, YouTube, Facebook, and Quora. (The article that\nI’m summarizing has a list of fifteen such sites). But don’t just research your\nidea, also look at your competitors. Use online tools to check their social\nmedia presence and evaluate their backlinks. Lastly, talk to friends about your\nidea. Get real feedback from real people. Mention it on Twitter, and see how\npeople react. <em>A picture paints a thousand words, but people paint pictures.</em></p>\n","summary":"When you come up with a business idea, you may want to start the coding immediately. However, research should be the first step.","date_published":"2019-12-17T01:37:30.434Z"},{"id":"https://binyam.in/p/six-uses-for-webpack","url":"https://binyam.in/p/six-uses-for-webpack","title":"Six Uses for Webpack","content_html":"<p>I’ve always tried to avoid Webpack. I would tell myself it was either too\ncomplicated or unnecessary. After all, it’s not the only tool of its kind on the\nmarket. Yet recently I’ve come to terms with Webpack. Once you know how to use\nit, it can be a very effective tool.</p>\n<p>Webpack’s main usage is bundling JavaScript. In node.js, we generally use\n<code>require</code> or <code>import</code> to include an external resource in our JavaScript file.\nYet browsers don’t understand <code>require</code>. You can either include the resource in\nthe head of your HTML or make an HTTP request to a URL. With Webpack, though,\nyou can bundle your in-browser code. Webpack will combine all the files that you\nimported using require and stick them in your file. Bundling can also take care\nof features such as ES6 notation which may not be compatible across all\nbrowsers. This requires the babel plugin.</p>\n<p>Another use-case is minifying CSS and/or JavaScript. Minification strips all\nwhite-space from a file. It’s a very effective way of decreasing file size, thus\nspeeding up load time. Minifying JavaScript requires no plugins, yet minifying\nCSS does. There are also plugins which increase the browser-compatibility of\nyour CSS.</p>\n<p>You can preprocess SCSS. There are other ways, such as gulp, node-sass, and even\na VS Code extension. But once you’re using Webpack this is a pretty useful\nfeature. This requires a Webpack loader.</p>\n<p>You can compile JSX for ReactJS. This is can be easier to set up in some\nsituations, especially in a complex environment such as an electron app. There’s\na good tutorial on compiling JSX with Webpack\n<a href=\"https://www.valentinog.com/blog/babel/\">here</a>. Note that this requires a plugin\nas well.</p>\n<p>You can compile Typescript with it. You <em>can</em>\n<a href=\"https://code.visualstudio.com/Docs/languages/typescript\">compile Typescript within VS Code</a>,\nthough Webpack may be more efficient because you can run many tasks with one\ncommand. This requires a plugin.</p>\n<p>You can run a development server with your static files. Extensions do exist to\nserve that purpose, though Webpack can prove useful when running many tasks or\ncomplicated setups. This requires an extra package.</p>\n<p>I don’t know the next time you will consider using Webpack, but I hope that now\nyou will be more prepared.</p>\n","summary":"I've always tried to avoid Webpack. However, once you know how to use it, it can be a very effective tool.","date_published":"2019-11-15T11:05:00.622Z","tags":["code","javascript"]},{"id":"https://binyam.in/p/my-year-as-a-moderator","url":"https://binyam.in/p/my-year-as-a-moderator","title":"My Year as a Moderator","content_html":"<p>Okay, so it hasn’t actually been a year. It’s been slightly over eight months.\nBut I digress. Since February of 2019, I have been a moderator on a discord\ncommunity named <em>DesignCourse (Coursetro)</em>. Created by YouTuber Gary Simon, this\nplace serves as a forum for questions and discussions regarding all sorts of\ndesign and development related topics. Recently, I realized that I have grown as\na mod, as a developer, and as a person, since that day in February.</p>\n<p><a href=\"#summary\"><strong>tl;dr</strong></a></p>\n<p><em>All opinions expressed herein are my own</em></p>\n<p>I’ve noticed that many users who ask questions are a bit clueless as to what\nthey would like answered. They know they have an error in their code, and they\nknow that’s bad. However, they don’t really understand what information to give\nor where to focus their question. When someone asks a question, they are really\nwaving a flag for help, not asking a technical question. Obviously, this is also\nwhat you do inadvertently when <em>you</em> ask a question. Recognizing that you are\nclueless is the first step to a better “I need help” experience.</p>\n<p><del>People don’t think.</del> (Yes, that’s very general.) People <em>usually</em> think. But\nyou and I know that it’s very easy to ask for help without actually talking\nthrough the issue at hand. And this is very important to realize. People don’t\nsift through archives to find duplicate issues, or host the complicated code\nthat they want help with. But that’s exactly where <em>you</em> come in. Stepping\nthrough an obvious error, or teaching somebody the wondrous world of Codepen, is\nactually helping them solve their error. Simply typing <em>“please read the rules”</em>\nis not as useful. Just a thought.</p>\n<p>Spammers are never wanted. I’m referring to those who advertise their service\nwithout being asked. You’ve probably seen them on discord or youtube, posting\ntheir website and whatnot. Sometimes, they are just being jerks. But when you\ntalk to them, a whole different story comes out. Sometimes, they’ve been told to\ndo it for marketing. Other times, they are trying to ask for help, but totally\nmiss the mark. Once, I found a great resource and posted it on Gitter so people\nwould use it, only to banned for spamming (I got back on eventually, but yeah).\nSpammers often mean well.</p>\n<p>It’s very rewarding to help your sibling tie their shoes. Not all of us have a\nsibling or siblings of the relevant age, but we all have each other. I know that\nsounds cheesy, but hear me out, okay? As a moderator, I’m responsible for\nthousands of users daily. The environment must be safe, kind, and helpful. I’m\nproud of what I do, because as little as it may seem, I’m helping other people.</p>\n<p>Finally, help can come in unexpected methods. It’s nice to know that a senior\ndev or designer is having the same issue as you, even if they can’t figure it\nout either. It’s also useful when someone points you to a guide without really\nanswering your question. Of course, it’s better to give a complete answer, but\nthere’s a next-best option. You don’t need to know it to be helpful.</p>\n<p>I love answering questions or giving feedback. In my opinion, it helps me grow\nas a person. Additionally, I like the camaraderie that comes with being part of\na community, if only an online one. It only takes a minute to help someone else,\nand with the internet you can find questions to be answered all of the time.</p>\n<h2 id=\"summary\">Summary</h2>\n<ul>\n<li>people don’t always know what they’re asking for</li>\n<li>people don’t always think before asking questions</li>\n<li>spammers usually don’t mean to spam</li>\n<li>taking care of people is a healthy source of pride</li>\n<li>you don’t need to answer to be helpful</li>\n</ul>\n<p>Come visit the <a href=\"https://discord.gg/a27CKAF\">DesignCourse discord server</a>, and\ngive me feedback on this article via email. That’s all for now. Take care.</p>\n","summary":"I love answering questions or giving feedback. I enjoy the camaraderie that comes with being part of a community, if only an online one.","date_published":"2019-10-25T19:10:26.424Z","tags":["feedback"]},{"id":"https://binyam.in/p/five-useful-tips-for-adobe-xd","url":"https://binyam.in/p/five-useful-tips-for-adobe-xd","title":"Five Useful Tips for Adobe XD","content_html":"<p>Adobe XD is becoming the go-to tools for UI/UX Designers in 2019. It’s free,\nmodern, and extensible. XD has many features, some of which you may not be aware\nof. Here are five useful tips for working within Adobe XD.</p>\n<hr>\n<h2 id=\"math\">Math</h2>\n<p>Adobe XD, as well as other programs such as Blender, Gimp and Inkscape, allows\nmath in the input fields. Let’s say that I had two circles with a width of 258px\neach , and I wanted one to be half as big as the other. I could do the math\nmentally, which could get complicated. Or, I could type 258/2, and XD will do\nthe math for me.</p>\n<p><img __ASTRO_IMAGE_=\"{&quot;alt&quot;:&quot;Doing math in Adobe XD&quot;,&quot;src&quot;:&quot;~/assets/uploads/math-in-xd.gif&quot;,&quot;index&quot;:0}\"></p>\n<h2 id=\"assets\">Assets</h2>\n<p>I use these all of the time.</p>\n<p>Open the assets panel by typing <code>ctrl/cmd + shift + y</code>. Then, select a object\nand click on the plus sign next to the word “color”. That object’s color is now\nset based on the swatch in the assets panel. You can add that exact color to\nanother object by selecting the object and clicking on the swatch. You can also\nedit the swatch by right-clicking and selecting “Edit”.</p>\n<p>PS: This works for text styles as well.</p>\n<h2 id=\"guides\">Guides</h2>\n<p>XD has awesome automatic guides which can help you align things perfectly.\nSometimes, though, the auto-guides just aren’t helping. Enter, guides. Well,\nmanual guides. Drag from the top or left edge of an artboard to create a thin\nguide manually. You can position it wherever you like, and not worry about\nmaking XD understand where exactly you want to position your item.</p>\n<h2 id=\"adjust-corners-separately\">Adjust Corners Separately</h2>\n<p>I found this awesome tip in\n<a href=\"https://twitter.com/elainecchao/status/1123289664671100928\">a tweet from Elaine Chao</a>.</p>\n<figure><blockquote>\n<p>#adobexd #protip Want to adjust the corners independently? Simply hold down\nAlt/Opt while dragging the corner to detach it from the others.</p>\n<p>@adobexd</p>\n</blockquote><figcaption><p>By <a href=\"https://twitter.com/elainecchao/status/1123289664671100928\">@elaincchao</a> on\nTwitter</p></figcaption></figure>\n<p>Thanks Elaine.</p>\n<h2 id=\"shortcuts\">Shortcuts</h2>\n<p>Shortcuts are awesome. They speed up your workflow, and make you look really\nprofessional 😎. You can find a comprehensive list here. Some useful shortcuts\nare:</p>\n<ul>\n<li><code>ctr/cmd + k</code>: Create component from selection</li>\n<li><code>ctrl/cmd + shift + y</code>: Toggle assets panel</li>\n<li><code>alt + drag</code>: Duplicate selection</li>\n</ul>\n","summary":"Adobe XD is free, modern, and extensible. Here are five useful tips for working within Adobe XD.","date_published":"2019-06-18T16:11:04.629Z"}]}