<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: rayne cloudy</title>
    <description>The latest articles on DEV Community by rayne cloudy (@raynecloudy).</description>
    <link>https://dev.to/raynecloudy</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F1532354%2F01f4188c-7e4d-4a83-ba35-f7b7567c5459.png</url>
      <title>DEV Community: rayne cloudy</title>
      <link>https://dev.to/raynecloudy</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/raynecloudy"/>
    <language>en</language>
    <item>
      <title>Why URL hashes are my favorite way to fire events</title>
      <dc:creator>rayne cloudy</dc:creator>
      <pubDate>Fri, 16 Aug 2024 08:40:18 +0000</pubDate>
      <link>https://dev.to/raynecloudy/why-url-hashes-are-my-favorite-way-to-fire-events-1415</link>
      <guid>https://dev.to/raynecloudy/why-url-hashes-are-my-favorite-way-to-fire-events-1415</guid>
      <description>&lt;p&gt;As a young web developer, I often wondered what the best way to fire events was (for example, to make a link display new content on the page, without reloading). I considered using HTML elements as event handlers, by changing a property when firing an event—but this just seemed too in the way. I needed something out of the way of my HTML.&lt;/p&gt;

&lt;p&gt;I then looked at my URL bar, sitting there lonely and unused, and an idea came to me. I would simply add two URL parameters, one named &lt;code&gt;event&lt;/code&gt; and one named &lt;code&gt;data&lt;/code&gt;! It was perfect!&lt;/p&gt;

&lt;p&gt;Or so I thought. Adding URL parameters reloads the page, so this wouldn't work either. But I still thought the URL was the best way to go, and reminded myself of hashes.&lt;/p&gt;

&lt;p&gt;For those who don't know, adding hashes to a URL does &lt;em&gt;not&lt;/em&gt; reload the page.&lt;/p&gt;

&lt;p&gt;I have used this technique ever since then, and it is undoubtedly my favorite. I don't believe this is a usual technique. All I know is that it suits my needs.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="nb"&gt;window&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;addEventListener&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;hashchange&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="kd"&gt;function&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;hash&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="k"&gt;if &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;hash&lt;/span&gt; &lt;span class="o"&gt;===&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;#profile-19289948&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="p"&gt;...&lt;/span&gt;
  &lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="p"&gt;});&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Now I'm curious—do other people do something similar? Do other people even know what I'm talking about?&lt;/p&gt;

</description>
      <category>webdev</category>
      <category>javascript</category>
      <category>programming</category>
    </item>
    <item>
      <title>ascii-based graphics: the only image file format for the terminal</title>
      <dc:creator>rayne cloudy</dc:creator>
      <pubDate>Tue, 28 May 2024 07:20:17 +0000</pubDate>
      <link>https://dev.to/b4d/ascii-based-graphics-the-only-image-file-format-for-the-terminal-4k61</link>
      <guid>https://dev.to/b4d/ascii-based-graphics-the-only-image-file-format-for-the-terminal-4k61</guid>
      <description>&lt;h2&gt;
  
  
  &lt;em&gt;hello, devs!&lt;/em&gt;
&lt;/h2&gt;

&lt;p&gt;i'm excited to show you all this tiny project i made in my free time!! it's nothing much, but it's the first project i've ever shared with the public. say hello to &lt;strong&gt;&lt;em&gt;ascii-based-graphics!&lt;/em&gt;&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;this is a new file format that can be easily edited with a text editor (an ability that you don't have with pngs, jpegs, and most other image formats). it also has a text output using ansi escape codes to color the image, which brings images to the terminal!!&lt;/p&gt;

&lt;h2&gt;
  
  
  example of abg in action
&lt;/h2&gt;

&lt;p&gt;take a look at the image at the top of this post. that was made using abg. here is what it looks like in a text editor:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;1.0.1
abg banner
xx xx xx xx xx xx xx xx xx xx xx xx xx xx xx xx xx xx xx xx xx xx xx xx v2 v2 xx xx xx xx xx xx xx p4 xx xx xx xx v4 v4 v4 xx xx xx p4 xx xx v4 v4 xx
xx xx xx xx xx xx xx xx xx xx xx xx xx xx xx xx xx xx xx xx xx xx xx xx xx xx v2 v2 v2 xx xx xx xx xx p4 xx xx xx xx xx xx v4 xx xx xx p4 xx xx xx v4
xx xx y4 xx xx xx xx xx xx xx xx xx xx xx xx xx xx xx xx xx xx xx xx xx xx xx xx xx xx v2 v2 xx xx xx xx p4 xx xx xx xx xx xx v4 xx xx p4 xx xx xx xx
xx xx y4 xx xx xx xx xx xx xx xx xx xx xx y4 xx xx xx xx xx xx xx xx xx xx xx xx xx xx xx xx v2 xx xx xx xx p4 p4 p4 xx xx xx xx v4 xx xx p4 p4 xx xx
xx y4 y4 y4 xx xx xx xx xx xx xx xx xx y4 y4 y4 xx xx xx xx xx xx xx xx xx xx xx xx xx xx xx xx v2 xx xx xx xx xx xx p4 xx xx xx v4 xx xx xx xx p4 p4
xx xx y4 xx xx xx xx xx xx xx xx xx xx xx y4 xx xx xx xx xx xx xx xx xx xx xx xx xx xx xx xx xx xx v2 xx xx xx xx xx xx p4 xx xx xx v4 xx xx xx xx xx
v2 xx y4 xx xx xx xx xx xx xx xx xx xx xx xx xx xx xx xx xx xx xx xx xx xx xx xx xx xx xx xx xx xx xx v2 v2 v2 v2 xx xx xx p4 xx xx xx v4 v4 xx xx xx
xx v2 v2 v2 v2 v2 y4 xx y4 xx xx xx xx xx xx xx xx xx xx xx xx xx xx xx w2 xx xx xx xx xx xx xx xx xx xx xx xx xx v2 xx xx p4 xx xx xx xx xx v4 v4 v4
xx xx xx xx xx xx v2 y4 xx xx xx xx xx xx xx xx xx xx xx xx xx xx xx w2 w4 w2 xx xx xx xx xx xx xx xx xx xx xx xx v2 xx xx xx p4 xx xx xx xx xx xx xx
xx xx xx xx xx xx y4 xx y4 xx xx xx xx xx xx xx xx xx xx w2 w2 w2 xx w2 w4 w2 w2 xx w2 w2 w2 xx xx xx xx xx xx xx xx v2 xx xx xx p4 p4 xx xx xx xx xx
p4 p4 p4 p4 p4 xx xx xx xx v2 xx xx xx xx xx xx xx xx w2 w4 w4 w4 w2 w2 w4 w4 w4 w2 w4 w4 w4 w2 xx xx xx xx xx xx xx xx v2 xx xx xx xx p4 p4 p4 p4 p4
xx xx xx xx xx p4 p4 xx xx xx v2 xx xx xx xx xx xx xx w2 w4 w2 w4 w2 w2 w4 w2 w4 w2 w4 w2 w4 w2 xx xx xx xx xx xx xx xx xx v2 xx xx xx xx xx xx xx xx
xx xx xx xx xx xx xx p4 xx xx xx v2 xx xx xx xx xx xx w2 w4 w4 w4 w4 w2 w4 w4 w4 w2 w4 w4 w4 w2 xx xx xx xx xx xx xx xx xx xx v2 v2 xx xx xx xx xx xx
v4 v4 v4 xx xx xx xx xx p4 xx xx v2 xx xx xx xx xx xx xx w2 w2 w2 w2 xx w2 w2 w2 xx w2 w2 w4 w2 xx xx xx xx y4 xx xx xx xx xx xx xx v2 v2 v2 v2 v2 xx
xx xx xx v4 v4 xx xx xx p4 xx xx xx v2 v2 v2 v2 xx xx xx xx y4 xx y4 xx y4 xx y4 w2 w4 w4 w4 w2 xx xx xx xx y4 xx xx xx xx xx xx xx xx xx xx xx xx v2
xx xx xx xx xx v4 xx xx xx p4 xx xx xx xx xx xx v2 xx xx y4 xx y4 xx y4 xx y4 xx y4 w2 y4 w2 xx xx xx xx y4 y4 y4 xx xx xx xx xx xx xx xx xx xx xx xx
p4 p4 xx xx xx xx v4 xx xx xx p4 xx xx xx xx xx xx v2 xx xx xx xx xx xx xx xx xx xx xx xx xx xx xx xx xx xx y4 xx xx xx xx xx xx xx xx xx xx xx xx xx
xx xx p4 p4 xx xx v4 xx xx xx xx p4 p4 p4 xx xx xx xx v2 xx xx xx xx xx xx xx xx xx xx xx xx xx xx xx xx xx y4 xx xx xx xx xx y4 xx y4 xx xx xx xx xx
xx xx xx xx p4 xx xx v4 xx xx xx xx xx xx p4 p4 xx xx xx v2 v2 xx xx xx xx xx xx xx xx xx xx xx xx xx xx xx xx xx xx xx xx xx xx y4 xx xx xx xx xx xx
v4 xx xx xx p4 xx xx xx v4 xx xx xx xx xx xx xx p4 xx xx xx xx v2 v2 v2 xx xx xx xx xx xx xx xx xx xx xx xx xx xx xx xx xx xx y4 xx y4 xx xx xx xx xx
xx v4 v4 xx xx p4 xx xx xx v4 v4 v4 xx xx xx xx xx p4 xx xx xx xx xx xx v2 v2 xx xx xx xx xx xx xx xx xx xx xx xx xx xx xx xx xx xx xx xx xx xx xx xx
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;if you don't know how to read it, this may look like chaos. however, this makes a lot more sense than you may first realize.&lt;/p&gt;
&lt;h2&gt;
  
  
  dissecting an abg file
&lt;/h2&gt;

&lt;p&gt;the first line is the version of abg this file uses. this is because abg is subject to change in the future. the second line serves no purpose to the interpreter, so it could be a description of the image. every line after this is the actual image. the first letter of every pixel is the color. in version 1.0.0:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;r&lt;/code&gt; = red&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;y&lt;/code&gt; = yellow&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;g&lt;/code&gt; = green&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;b&lt;/code&gt; = blue&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;v&lt;/code&gt; = cyan&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;p&lt;/code&gt; = purple&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;w&lt;/code&gt; = white&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;x&lt;/code&gt; = transparent&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;the second character is the brightness.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;1&lt;/code&gt; = black&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;2&lt;/code&gt; = very dark&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;3&lt;/code&gt; = little darker&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;4&lt;/code&gt; = bright&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;x&lt;/code&gt; = transparent&lt;/li&gt;
&lt;/ul&gt;
&lt;h2&gt;
  
  
  limitations
&lt;/h2&gt;

&lt;p&gt;abg only allows for 20 possible colors (a mere 7% of the atari's 256), but this number will never increase. this is because of the number of ansi escape codes that exist. yes, it's sad, but there's nothing i can do :'(&lt;/p&gt;
&lt;h2&gt;
  
  
  future updates
&lt;/h2&gt;

&lt;p&gt;in the future, i plan on branching away from just pixels, and into more commonly used characters used to make art (such as &lt;code&gt;/&lt;/code&gt;, &lt;code&gt;,&lt;/code&gt;, &lt;code&gt;|&lt;/code&gt;, etc.)&lt;/p&gt;
&lt;h2&gt;
  
  
  thanks!
&lt;/h2&gt;

&lt;p&gt;thanks for reading my article! i don't know if anybody'll use this, ever, but it was fun to make!! :) have a great rest of your day, devs!!&lt;/p&gt;
&lt;h2&gt;
  
  
  repository
&lt;/h2&gt;


&lt;div class="ltag-github-readme-tag"&gt;
  &lt;div class="readme-overview"&gt;
    &lt;h2&gt;
      &lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--A9-wwsHG--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev.to/assets/github-logo-5a155e1f9a670af7944dd5e12375bc76ed542ea80224905ecaf878b9157cdefc.svg" alt="GitHub logo"&gt;
      &lt;a href="https://github.com/breakfast-for-dinner"&gt;
        breakfast-for-dinner
      &lt;/a&gt; / &lt;a href="https://github.com/breakfast-for-dinner/abg"&gt;
        abg
      &lt;/a&gt;
    &lt;/h2&gt;
    &lt;h3&gt;
      ascii-based graphics format for showing images in the terminal
    &lt;/h3&gt;
  &lt;/div&gt;
  &lt;div class="ltag-github-body"&gt;
    
&lt;div id="readme" class="md"&gt;
&lt;div class="markdown-heading"&gt;
&lt;h1 class="heading-element"&gt;abg&lt;/h1&gt;
&lt;/div&gt;

&lt;p&gt;this stands for &lt;em&gt;&lt;strong&gt;a&lt;/strong&gt;scii-&lt;strong&gt;b&lt;/strong&gt;ased &lt;strong&gt;g&lt;/strong&gt;raphics format.&lt;/em&gt; this is an ideal file format for terminal-based graphics.&lt;/p&gt;

&lt;div class="markdown-heading"&gt;
&lt;h2 class="heading-element"&gt;example&lt;/h2&gt;
&lt;/div&gt;

&lt;p&gt;here's abg in action:&lt;/p&gt;

&lt;div class="snippet-clipboard-content notranslate position-relative overflow-auto"&gt;
&lt;pre class="notranslate"&gt;&lt;code&gt;a person waving hello
xx xx xx xx xx xx xx xx
xx xx y4 y4 y4 xx xx xx
xx y4 w4 w4 w4 y4 xx xx
y2 w4 w4 w4 w4 w4 y4 xx
y2 w4 w1 w4 w1 w4 y4 xx
y2 w4 w4 w4 w4 w4 y4 xx
y2 w1 w4 w4 w4 w1 y4 xx
y2 y2 w1 w1 w1 y4 y4 xx
y2 y2 y2 w1 y4 y4 xx w1
xx y2 w1 w1 w1 y4 w1 xx
xx w1 y2 w1 y2 w1 xx xx
xx w1 xx w1 xx xx xx xx
xx w1 xx w1 xx xx xx xx
xx xx xx w1 xx xx xx xx
xx xx w1 xx w1 xx xx xx
xx&lt;/code&gt;&lt;/pre&gt;…&lt;/div&gt;
&lt;/div&gt;
  &lt;/div&gt;
  &lt;div class="gh-btn-container"&gt;&lt;a class="gh-btn" href="https://github.com/breakfast-for-dinner/abg"&gt;View on GitHub&lt;/a&gt;&lt;/div&gt;
&lt;/div&gt;



</description>
      <category>opensource</category>
      <category>github</category>
      <category>showdev</category>
      <category>terminal</category>
    </item>
  </channel>
</rss>
