<?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: sudo-self</title>
    <description>The latest articles on DEV Community by sudo-self (@sudo-self).</description>
    <link>https://dev.to/sudo-self</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%2F1091408%2F1410371d-7d1f-4b39-9217-d2b06c664fb7.jpg</url>
      <title>DEV Community: sudo-self</title>
      <link>https://dev.to/sudo-self</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/sudo-self"/>
    <language>en</language>
    <item>
      <title>Deploy Buttons Generator Beautiful Deployment Badges</title>
      <dc:creator>sudo-self</dc:creator>
      <pubDate>Mon, 15 Dec 2025 04:32:05 +0000</pubDate>
      <link>https://dev.to/sudo-self/deploy-buttons-generator-beautiful-deployment-badges-for-your-github-repos-573f</link>
      <guid>https://dev.to/sudo-self/deploy-buttons-generator-beautiful-deployment-badges-for-your-github-repos-573f</guid>
      <description>&lt;h4&gt;
  
  
  Ever spent time searching for the right deployment button badges for your GitHub repository?&lt;br&gt;
&lt;/h4&gt;

&lt;p&gt;Or worse, manually writing Markdown or HTML for each platform? I've built a fun simple tool that solves this problem!&lt;/p&gt;

&lt;h4&gt;
  
  
  &lt;a href="https://deploy-my-repo.web.app" rel="noopener noreferrer"&gt;Deploy Buttons Generator&lt;/a&gt;
&lt;/h4&gt;

&lt;h2&gt;
  
  
  The Problem: Manual Badges Are Tedious
&lt;/h2&gt;

&lt;p&gt;As developers, we want to make it easy for others to deploy our projects. Deployment buttons (those beautiful badges that say "Deploy to Netlify", "Deploy to Vercel", etc.) are essential for this. But creating them manually is time-consuming:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;finding the correct button SVG/image URL for each platform&lt;/li&gt;
&lt;li&gt;You need the correct deployment URL structure&lt;/li&gt;
&lt;li&gt;You have to write both Markdown and HTML versions&lt;/li&gt;
&lt;li&gt;You need to update them if the repo URL changes&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  The Solution: One-Click Deployment Button Generation
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://deploy-my-repo.web.app" rel="noopener noreferrer"&gt;Deploy Buttons Generator&lt;/a&gt; automates this entire process. Simply enter your GitHub username and repository name, and instantly get deployment buttons for 12 popular platforms:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Netlify&lt;/li&gt;
&lt;li&gt;Vercel&lt;/li&gt;
&lt;li&gt;Heroku&lt;/li&gt;
&lt;li&gt;Railway&lt;/li&gt;
&lt;li&gt;Render&lt;/li&gt;
&lt;li&gt;DigitalOcean&lt;/li&gt;
&lt;li&gt;Cloudflare Workers&lt;/li&gt;
&lt;li&gt;CodeSandbox&lt;/li&gt;
&lt;li&gt;StackBlitz&lt;/li&gt;
&lt;li&gt;Glitch&lt;/li&gt;
&lt;li&gt;Firebase Hosting&lt;/li&gt;
&lt;li&gt;Replit&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fzr11z224ec3e7vv7ci2l.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fzr11z224ec3e7vv7ci2l.png" alt="Deploy Buttons" width="800" height="512"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  How It Works
&lt;/h3&gt;

&lt;h4&gt;
  
  
  incredibly simple
&lt;/h4&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Enter your GitHub username&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Enter your repository name&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Click "Generate Buttons"&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;That's it! The tool generates beautifully formatted deployment buttons for all supported platforms in both &lt;strong&gt;&lt;em&gt;Markdown&lt;/em&gt;&lt;/strong&gt; and &lt;strong&gt;&lt;em&gt;HTML&lt;/em&gt;&lt;/strong&gt; formats.&lt;br&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Example Output
&lt;/h2&gt;

&lt;p&gt;For the Vercel deploy button, you'll get both formats:&lt;/p&gt;

&lt;h3&gt;
  
  
  Markdown Format
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight markdown"&gt;&lt;code&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nv"&gt;![Deploy with Vercel&lt;/span&gt;&lt;span class="p"&gt;](&lt;/span&gt;&lt;span class="sx"&gt;https://vercel.com/button&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;](https://vercel.com/new/clone?repository-url=https://github.com/sudo-self/link-in-bio)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  HTML Format
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight html"&gt;&lt;code&gt;&lt;span class="nt"&gt;&amp;lt;a&lt;/span&gt; &lt;span class="na"&gt;href=&lt;/span&gt;&lt;span class="s"&gt;"https://vercel.com/new/clone?repository-url=https://github.com/sudo-self/link-in-bio"&lt;/span&gt; &lt;span class="na"&gt;target=&lt;/span&gt;&lt;span class="s"&gt;"_blank"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
  &lt;span class="nt"&gt;&amp;lt;img&lt;/span&gt; &lt;span class="na"&gt;src=&lt;/span&gt;&lt;span class="s"&gt;"https://vercel.com/button"&lt;/span&gt; &lt;span class="na"&gt;alt=&lt;/span&gt;&lt;span class="s"&gt;"Deploy with Vercel"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;/a&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Rendered Result
&lt;/h3&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F5aq5cmxdx38gr40dakxq.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F5aq5cmxdx38gr40dakxq.png" alt=" " width="446" height="160"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fkllahubgpu4pgqjyu5cx.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fkllahubgpu4pgqjyu5cx.png" alt="button example" width="798" height="497"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;A few versions out there. Free to use and free of spam and junk...&lt;br&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://deploy-my-repo.web.app" rel="noopener noreferrer"&gt;Deploy My Repo&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://deploy-buttons.web.app" rel="noopener noreferrer"&gt;Deploy Buttons&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://repo-buttons.vercel.app" rel="noopener noreferrer"&gt;Repo Buttons&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://deploy.sudo-self.com" rel="noopener noreferrer"&gt;deploy.sudo-self.com&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The source code is also avaliable &lt;a href="https://github.com/sudo-self/deploy-buttons" rel="noopener noreferrer"&gt;sudo-self/deploybuttons&lt;/a&gt;.&lt;/p&gt;

&lt;h4&gt;
  
  
  Stay Creative!
&lt;/h4&gt;

</description>
      <category>deploy</category>
      <category>buttons</category>
      <category>generator</category>
      <category>repo</category>
    </item>
    <item>
      <title>Calculator</title>
      <dc:creator>sudo-self</dc:creator>
      <pubDate>Thu, 24 Apr 2025 07:23:15 +0000</pubDate>
      <link>https://dev.to/sudo-self/calculator-2n3f</link>
      <guid>https://dev.to/sudo-self/calculator-2n3f</guid>
      <description>&lt;p&gt;&lt;strong&gt;A calculator is a device or software application used to perform mathematical operations.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;iframe src="https://codesandbox.io/embed/72lrtc"&gt;
&lt;/iframe&gt;
&lt;/p&gt;

</description>
      <category>codesandbox</category>
      <category>react</category>
      <category>typescript</category>
    </item>
    <item>
      <title>Deploy with workers</title>
      <dc:creator>sudo-self</dc:creator>
      <pubDate>Tue, 10 Sep 2024 04:40:41 +0000</pubDate>
      <link>https://dev.to/sudo-self/deploy-with-workers-595h</link>
      <guid>https://dev.to/sudo-self/deploy-with-workers-595h</guid>
      <description>&lt;h2&gt;
  
  
  &lt;a href="https://sudo-self.github.io/deploy-button" rel="noopener noreferrer"&gt;Button Generator&lt;/a&gt;
&lt;/h2&gt;

&lt;p&gt;The &lt;strong&gt;Button Generator&lt;/strong&gt; is a tool designed to streamline the deployment process for projects hosted on GitHub. By creating a "Deploy to Cloudflare Workers" button, you can simplify the deployment process, allowing users to deploy your application to Cloudflare Workers with a single click.&lt;/p&gt;

&lt;p&gt;This button provides a convenient way for users to deploy your project directly to Cloudflare Workers, which is ideal for projects that benefit from serverless architecture and global distribution.&lt;/p&gt;

&lt;h3&gt;
  
  
  How It Works
&lt;/h3&gt;

&lt;p&gt;By embedding a simple script tag into your webpage, you can integrate the deploy button functionality. This script will dynamically add a floating button to your webpage. When users click this button, it opens a popup that facilitates one-click deployments to Cloudflare Workers. This integration is especially useful for streamlining the deployment process for your users and enhancing their experience.&lt;/p&gt;

&lt;p&gt;To include the deploy button generator on your webpage, simply add the following script tag:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;&amp;lt;script src="https://sudo-self.github.io/deploy-button/deploy-button.js"&amp;gt;&amp;lt;/script&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  &lt;a href="https://sudo-self.github.io/deploy-button/deploy-button-webpage.html" rel="noopener noreferrer"&gt;Example Widget&lt;/a&gt;
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fmo38x2or8deqvnfam60k.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fmo38x2or8deqvnfam60k.png" alt="Deploy widget embed" width="800" height="546"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;How to Create Your Deploy Button&lt;br&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Get your GitHub repository URL&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;You need the GitHub repository URL in the format &lt;code&gt;https://github.com/USERNAME/REPO&lt;/code&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;USERNAME&lt;/code&gt; is your GitHub username.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;REPO&lt;/code&gt; is the name of your repository.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Construct the deploy button URL&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;https://deploy.workers.cloudflare.com/?url=https://github.com/USERNAME/REPO
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Replace USERNAME and REPO with your actual GitHub username and repository name. This URL links directly to Cloudflare's Workers deployment system, enabling seamless deployment of your project with a single click.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Flw1oj0utjsxlymdf78m3.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Flw1oj0utjsxlymdf78m3.png" alt="Image description" width="774" height="148"&gt;&lt;/a&gt;&lt;/p&gt;

</description>
      <category>cloudflare</category>
      <category>javascript</category>
      <category>github</category>
      <category>beginners</category>
    </item>
    <item>
      <title>dicebear api</title>
      <dc:creator>sudo-self</dc:creator>
      <pubDate>Tue, 14 May 2024 06:10:14 +0000</pubDate>
      <link>https://dev.to/sudo-self/dicebear-api-m59</link>
      <guid>https://dev.to/sudo-self/dicebear-api-m59</guid>
      <description>&lt;p&gt;because why not.....&lt;/p&gt;

&lt;p&gt;&lt;iframe height="600" src="https://codepen.io/sudo-self/embed/abrONbN?height=600&amp;amp;default-tab=result&amp;amp;embed-version=2"&gt;
&lt;/iframe&gt;
&lt;/p&gt;

</description>
      <category>api</category>
      <category>dicebear</category>
      <category>random</category>
      <category>avatar</category>
    </item>
    <item>
      <title>Blog with comments..</title>
      <dc:creator>sudo-self</dc:creator>
      <pubDate>Fri, 10 May 2024 07:40:11 +0000</pubDate>
      <link>https://dev.to/sudo-self/blog-with-comments-1314</link>
      <guid>https://dev.to/sudo-self/blog-with-comments-1314</guid>
      <description>&lt;h2&gt;
  
  
  Firebase SDK is plug and play
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://codepen.io/sudo-self/pen/wvbvXBZ"&gt;Blog with comments...&lt;/a&gt;&lt;br&gt;
&lt;iframe height="600" src="https://codepen.io/sudo-self/embed/wvbvXBZ?height=600&amp;amp;default-tab=result&amp;amp;embed-version=2"&gt;
&lt;/iframe&gt;
&lt;/p&gt;

&lt;p&gt;*consider rules with DB codepen is purely an example&lt;/p&gt;

&lt;p&gt;initialize&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;const firebaseConfig = {
apiKey: "YOUR_API_KEY",
authDomain: "YOUR_AUTH_DOMAIN",
databaseURL: "YOUR DATABASE URL".
projectid: "YOUR_PROJECT_ID",
storageBucket: "YOUR_ STORAGE _BUCKET",
messaging Senderld: "YOUR_MESSAGING_SENDER_ID",
appld: "YOUR_APP_ID"
measurementld: "YOUR_ MEASUREMENT_ID"
};

if (!firebase.apps.length) {
  firebase.initializeApp(firebaseConfig);
}

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;read, write, and display comments&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;var database = firebase.database();

var commentsContainer = document.getElementById("comments-container");

function displayComments() {
  database.ref("comments").on("value", function (snapshot) {
    commentsContainer.innerHTML = "";
    snapshot.forEach(function (childSnapshot) {
      var comment = childSnapshot.val().text;
      var timestamp = new Date(childSnapshot.val().timestamp);

      var commentElement = document.createElement("div");
      commentElement.classList.add("comment");

      var commentTextElement = document.createElement("div");
      commentTextElement.classList.add("comment-text");
      commentTextElement.textContent = comment;
      commentElement.appendChild(commentTextElement);

      var timestampElement = document.createElement("div");
      timestampElement.classList.add("comment-timestamp");
      timestampElement.textContent = timestamp.toLocaleString();
      commentElement.appendChild(timestampElement);

      commentsContainer.appendChild(commentElement);
    });
  });
}

displayComments();

document
  .getElementById("comment-form")
  .addEventListener("submit", function (event) {
    event.preventDefault();
    var commentInput = document.getElementById("comment-input").value;
    if (commentInput.trim() !== "") {
      var newCommentRef = database.ref("comments").push();
      newCommentRef.set({
        text: commentInput,
        timestamp: firebase.database.ServerValue.TIMESTAMP
      });
      document.getElementById("comment-input").value = "";
    }
  });
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;css to fit your style&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;body {
  font-family: Arial, sans-serif;
  background-color: #748b97;
  margin: 0;
  padding: 0;
}

.container {
  max-width: 560px;
  margin: 14px auto;
  padding: 14px;
  background-color: #fff;
  border-radius: 8px;
  box-shadow: 0 0 7px rgba(0, 0, 0, 0.1);
}

h1 {
  text-align: center;
}

img {
  max-width: 100%;
  height: auto;
  margin-bottom: 14px;
  border-radius: 8px;
}

#comments-container {
  margin-bottom: 14px;
}

.comment {
  background-color: #f9f9f9;
  padding: 10px;
  border-radius: 8px;
  margin-bottom: 10px;
  border: 1px solid #ddd;
}

.comment-text {
  margin-bottom: 5px;
}

.comment-timestamp {
  color: #888;
  font-size: 0.9em;
}

#comment-form {
  display: flex;
}

#comment-input {
  flex: 1;
  margin-right: 10px;
  padding: 8px;
  border: 1px solid #ddd;
  border-radius: 4px;
}

button {
  padding: 8px 16px;
  cursor: pointer;
  background-color: #007bff;
  color: #fff;
  border: none;
  border-radius: 4px;
}

button:hover {
  background-color: #0056b3;
}

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;a href="https://codepen.io/sudo-self/pen/wvbvXBZ"&gt;Blog with comments...&lt;/a&gt;&lt;/p&gt;

</description>
      <category>codepen</category>
      <category>realtimedb</category>
      <category>firebase</category>
      <category>html</category>
    </item>
    <item>
      <title>GitHub-repo-api</title>
      <dc:creator>sudo-self</dc:creator>
      <pubDate>Fri, 03 May 2024 08:15:46 +0000</pubDate>
      <link>https://dev.to/sudo-self/github-repos-284g</link>
      <guid>https://dev.to/sudo-self/github-repos-284g</guid>
      <description>&lt;p&gt;GitHub api to search GitHub repos by username&lt;/p&gt;

&lt;p&gt;several frameworks all implementing github RestFul APIs.&lt;/p&gt;

&lt;p&gt;made with react app, tailwind, and vercel. &lt;/p&gt;

&lt;p&gt;V2 Demo: &lt;a href="https://gitreactrepos.vercel.app"&gt;https://gitreactrepos.vercel.app&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;V1 Demo: &lt;a href="https://user-repos.vercel.app"&gt;https://user-repos.vercel.app&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;github's build your own octocat:  &lt;a href="https://myoctocat.com"&gt;https://myoctocat.com&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;iframe height="600" src="https://codepen.io/sudo-self/embed/KKYjXXZ?height=600&amp;amp;default-tab=result&amp;amp;embed-version=2"&gt;
&lt;/iframe&gt;
&lt;/p&gt;

&lt;p&gt;Create a React App&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;npx create-react-app my-app
cd my-app
npm start
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;add tailwind.css&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;npm install -D tailwindcss
npx tailwindcss init
npx tailwindcss -i ./src/input.css -o ./src/output.css --watch

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Fetch Repos and Followers by username&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;//api
fetch(`https://api.github.com/users/${username}`);
      const data = await response.json();
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;





&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;//username
 const handleSubmit = async (event) =&amp;gt; {
    event.preventDefault();
    try {
      const response = await fetch(`https://api.github.com/users/${username}`);
      const data = await response.json();
      setProfile(data);
      await fetchRepos(username);
      await fetchFollowers(username);

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;





&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;//repos
 const fetchRepos = async (username) =&amp;gt; {
    try {
      const response = await fetch(
        `https://api.github.com/users/${username}/repos`
      );
      const data = await response.json();
      setRepos(data);

//followers
  const fetchFollowers = async (username) =&amp;gt; {
    try {
      const response = await fetch(
        `https://api.github.com/users/${username}/followers`
      );
      const data = await response.json();
      setFollowers(data);

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;return json via JSX with tailwind.css&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;
//repos
{Array.isArray(repos) &amp;amp;&amp;amp; repos.length &amp;gt; 0 &amp;amp;&amp;amp; (
        &amp;lt;div className="repos-container bg-gray-100 text-red-800 rounded-lg shadow-lg p-4 mb-4 mx-auto md:w-1/3" style={{ overflowY: "auto" }}&amp;gt;
          &amp;lt;h3 className="text-lg font-semibold"&amp;gt;Repositories&amp;lt;/h3&amp;gt;
          &amp;lt;ul className="list-none"&amp;gt;
            {repos.map((repo) =&amp;gt; (
              &amp;lt;li key={repo.id}&amp;gt;
                &amp;lt;a href={repo.html_url}&amp;gt;{repo.name}&amp;lt;/a&amp;gt;
              &amp;lt;/li&amp;gt;
            ))}
          &amp;lt;/ul&amp;gt;
        &amp;lt;/div&amp;gt;
      )}

//followers
      {Array.isArray(followers) &amp;amp;&amp;amp; followers.length &amp;gt; 0 &amp;amp;&amp;amp; (
        &amp;lt;div className="followers-container bg-gray-100 text-red-800 rounded-lg shadow-lg p-4 mb-4 mx-auto md:w-1/3" style={{ overflowY: "auto" }}&amp;gt;
          &amp;lt;h3 className="text-lg font-semibold"&amp;gt;Followers&amp;lt;/h3&amp;gt;
          &amp;lt;ul className="list-none"&amp;gt;
            {followers.map((follower) =&amp;gt; (
              &amp;lt;li key={follower.id}&amp;gt;
                &amp;lt;a href={follower.html_url}&amp;gt;{follower.login}&amp;lt;/a&amp;gt;
              &amp;lt;/li&amp;gt;
            ))}
          &amp;lt;/ul&amp;gt;
        &amp;lt;/div&amp;gt;
      )}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;implementing tsParticles with npm&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;npm install tsparticles-engine
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;





&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;import { loadFull } from "tsparticles";
import particlesOptions from "./particles.json";

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;initialize engine&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt; useEffect(() =&amp;gt; {
    if (init) {
      return;
    }

    initParticlesEngine(async (engine) =&amp;gt; {
      await loadFull(engine);
    }).then(() =&amp;gt; {
      setInit(true);
    });
  }, [])

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;particles.json (sample)&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;{
  "autoPlay": true,
  "background": {
    "color": {
      "value": "#000"
    },
    "image": "",
    "position": "",
    "repeat": "",
    "size": "",
    "opacity": 1
  },
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Demo: &lt;a href="https://gitreactrepos.vercel.app"&gt;https://gitreactrepos.vercel.app&lt;/a&gt;&lt;/p&gt;

</description>
      <category>codepen</category>
      <category>api</category>
      <category>github</category>
      <category>username</category>
    </item>
    <item>
      <title>Magic .mp3 Burner</title>
      <dc:creator>sudo-self</dc:creator>
      <pubDate>Sun, 07 Apr 2024 13:50:37 +0000</pubDate>
      <link>https://dev.to/sudo-self/magic-mp3-burner-49bo</link>
      <guid>https://dev.to/sudo-self/magic-mp3-burner-49bo</guid>
      <description>&lt;h6&gt;
  
  
  Many argue mp3s are dead. The internet is not. Here is mp3 to html  &lt;br&gt;&lt;br&gt;
&lt;/h6&gt;

&lt;p&gt;&lt;a href="https://mp3-burn.pages.dev"&gt;Magic Mp3 Burner&lt;/a&gt;&lt;br&gt;&lt;/p&gt;

&lt;p&gt;&lt;iframe height="600" src="https://codepen.io/sudo-self/embed/zYXWNgj?height=600&amp;amp;default-tab=result&amp;amp;embed-version=2"&gt;
&lt;/iframe&gt;
&lt;br&gt;&lt;br&gt;
Production &lt;a href="https://magic.JesseJesse.com"&gt;&lt;br&gt;
Magic Mp3 Burner&lt;/a&gt;&lt;br&gt;&lt;/p&gt;

&lt;p&gt;CodePen &lt;a href="https://codepen.io/sudo-self/pen/zYXWNgj"&gt;&lt;br&gt;
  Magic MP3 Burner&lt;/a&gt;&lt;br&gt;&lt;br&gt;&lt;/p&gt;

&lt;p&gt;html download&lt;/p&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;      &amp;lt;!DOCTYPE html&amp;gt;
          &amp;lt;html lang="en"&amp;gt;
          &amp;lt;head&amp;gt;
            &amp;lt;meta charset="UTF-8"&amp;gt;
            &amp;lt;meta name="viewport" content="width=device-width, initial-scale=1.0"&amp;gt;
            &amp;lt;title&amp;gt;Mp3 Player&amp;lt;/title&amp;gt;
          &amp;lt;/head&amp;gt;
          &amp;lt;body style="background-color: #f0f0f0;"&amp;gt;
            &amp;lt;center&amp;gt;
              &amp;lt;h2&amp;gt;Mp3 Playlist&amp;lt;/h2&amp;gt;
              &amp;lt;audio controls&amp;gt;
                &amp;lt;source src="data:audio/mp3;base64,${base64Data}" type="audio/mp3"&amp;gt;
                Your browser does not support the audio element.
              &amp;lt;/audio&amp;gt;
            &amp;lt;/center&amp;gt;

            &amp;lt;div style="position: fixed; bottom: 0; left: 0; right: 0; background-color: black; color: white; padding: 10px; text-align: center;"&amp;gt;
              &amp;lt;a href="https://mp3-burn.pages.dev" style="color: white; text-decoration: none;"&amp;gt;made with&amp;amp;nbsp;&amp;amp;#10084;&amp;amp;nbsp;Magic Mp3 Burner&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;copy;2024&amp;lt;/a&amp;gt;
            &amp;lt;/div&amp;gt;
          &amp;lt;/body&amp;gt;
          &amp;lt;/html&amp;gt;
``


[Magic Mp3 Burner](https://mp3-burn.pages.dev)&amp;lt;br&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

</description>
      <category>mp3</category>
      <category>burn</category>
      <category>base64</category>
      <category>html</category>
    </item>
    <item>
      <title>Base 64</title>
      <dc:creator>sudo-self</dc:creator>
      <pubDate>Fri, 29 Mar 2024 23:02:43 +0000</pubDate>
      <link>https://dev.to/sudo-self/base-64-2pa0</link>
      <guid>https://dev.to/sudo-self/base-64-2pa0</guid>
      <description>&lt;p&gt;Upload an image&lt;br&gt;
base64 encode&lt;br&gt;
download as a .txt&lt;br&gt;
download as a .css (background use)&lt;br&gt;
copy string to clipboard&lt;/p&gt;

&lt;p&gt;&lt;iframe height="600" src="https://codepen.io/sudo-self/embed/ZEZJbXN?height=600&amp;amp;default-tab=result&amp;amp;embed-version=2"&gt;
&lt;/iframe&gt;
&lt;/p&gt;

&lt;p&gt;Buttons&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;//copy to clipboard

function copyToClipboard() {
  const textarea = document.getElementById("encodedCode");
  textarea.select();
  document.execCommand("copy");
  alert("Code copied to clipboard!");
}

//download txt

function downloadImage() {
  const base64EncodedImage = document.getElementById("encodedCode").value;
  const blob = new Blob([base64EncodedImage], { type: "text/plain" });

  const link = document.createElement("a");
  link.href = URL.createObjectURL(blob);
  link.download = "sudo-self.txt"; //file name here//
  document.body.appendChild(link);
  link.click();
  document.body.removeChild(link);
  alert("Text file downloaded!");
}

//download css

function downloadCSS() {
  const base64EncodedImage = document.getElementById("encodedCode").value;
  const cssContent = `body {
        background-image: url("${base64EncodedImage}");
        background-repeat: no-repeat;
        background-size: 80%;
        background-attachment: fixed;
      }`;
  const blob = new Blob([cssContent], { type: "text/plain" });
  const link = document.createElement("a");
  link.href = URL.createObjectURL(blob);
  link.download = "sudo-self.css"; //file name here//
  document.body.appendChild(link);
  link.click();
  document.body.removeChild(link);
  alert("CSS file downloaded!");
}

function displayImage(input) {
  var file = input.files[0];
  var imageType = /image.*/;

  if (file.type.match(imageType)) {
    var reader = new FileReader();

    reader.onload = function (e) {
      var img = new Image();
      img.src = reader.result;

      img.onload = function () {
        var width = this.width;
        var height = this.height;
        document.getElementById("thumbnail").src = this.src;
        document.getElementById("thumbnail").style.display = "inline";
        document.getElementById("resolution").innerText =
          width + " x " + height;
      };
    };

    reader.readAsDataURL(file);
  } else {
    alert("File format not supported!");
  }
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



</description>
      <category>codepen</category>
      <category>images</category>
      <category>base64</category>
      <category>create</category>
    </item>
    <item>
      <title>http request</title>
      <dc:creator>sudo-self</dc:creator>
      <pubDate>Fri, 22 Mar 2024 08:23:17 +0000</pubDate>
      <link>https://dev.to/sudo-self/http-request-200-ok-4li2</link>
      <guid>https://dev.to/sudo-self/http-request-200-ok-4li2</guid>
      <description>&lt;h2&gt;
  
  
  This is a submission for DEV Challenge v24.03.20, One Byte Explainer: Browser API or Feature.
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ff6nb2prcoa2hfq7dm372.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ff6nb2prcoa2hfq7dm372.png" alt="Image description" width="800" height="227"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Production
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://denodock.deno.dev"&gt;https://denodock.deno.dev&lt;/a&gt;&lt;br&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Playground
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://dash.deno.com/playground/deno-html-json"&gt;https://dash.deno.com/playground/deno-html-json&lt;/a&gt;&lt;br&gt;&lt;/p&gt;

&lt;p&gt;calling friends with a request. &lt;/p&gt;

&lt;p&gt;🙋🏽SERVER&lt;br&gt;
🙋🏿‍♂️TEXT &lt;br&gt;
🙋🏻‍♀️HTML &lt;br&gt;
🙋🏽JSON&lt;br&gt;
🙋🏿‍♂️AUDIO&lt;/p&gt;

&lt;p&gt;  Imagine you're at a party, and you ask a friend to message the DJ across the room. In HTTP, your browser sends a request to a server asking to drop the bass. The DJ processes your request and sends back the track. This exchange is the essence of an HTTP request.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fauxebmwnfuhdrscp7olm.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fauxebmwnfuhdrscp7olm.png" alt="Image description" width="800" height="435"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;  To demonstrate this browser action I chose to use a single typescript file &lt;code&gt;main.ts&lt;/code&gt; developed via deno playground. &lt;a href="https://deno-html-json.deno.dev"&gt;https://deno-html-json.deno.dev&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;🙋🏿‍♂️&lt;a href="https://one-byte-wonder.deno.dev/server.ts"&gt;server.ts&lt;/a&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;// deno server.ts

import { listenAndServe } from "https://deno.land/std@0.111.0/http/server.ts";
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;🙋🏻‍♀️&lt;a href="https://one-byte-wonder.deno.dev/html"&gt;html&lt;/a&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;if (pathname.startsWith("/html")) {
    const html = `
      &amp;lt;html&amp;gt;
        &amp;lt;p&amp;gt;&amp;lt;a style="color:green"&amp;gt;html&amp;lt;b class="text-blue-500"&amp;gt;&amp;lt;/b&amp;gt;&amp;lt;br&amp;gt;&amp;lt;marquee style="1"&amp;gt;&amp;lt;img src="https://api.iconify.design/logos:html-5.svg?color=%23669c35" alt="HTML Icon" class="inline h-5 w-5 mx-1"&amp;gt;&amp;lt;/a&amp;gt;&amp;lt;/p&amp;gt;
      &amp;lt;/html&amp;gt;`;
    return new Response(html, { headers: { "content-type": "text/html; charset=UTF-8" } });
  }
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;🙋🏻‍♀️&lt;a href="https://one-byte-wonder.deno.dev/text"&gt;text&lt;/a&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;if (pathname.startsWith("/text")) {
    const text = "This is plain text. I like to keep things simple around here";
    return new Response(text, { headers: { "content-type": "text/plain; charset=UTF-8" } });
  }
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;🙋🏽&lt;a href="https://one-byte-wonder.deno.dev/json"&gt;json&lt;/a&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;if (pathname.startsWith("/json")) {
    const json = JSON.stringify({ "json": "could not find a valid date for my structure" });
    return new Response(json, { headers: { "content-type": "application/json; charset=UTF-8" } });
  }
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;🙋🏿‍♂️ &lt;a href="https://deno-html-json.deno.dev"&gt;java&lt;/a&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;// Random Words

  const getRandomWord = () =&amp;gt; {
    const words = ["text", "audio", "html", "json", "pdf"];
    const randomIndex = Math.floor(Math.random() * words.length);
    return { word: words[randomIndex], color: getRandomDarkColor() };
  };
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Cloudflare R2  (storage)&lt;br&gt;
Deno Typescript (playground) &lt;br&gt;
Tailwind (CDN)&lt;br&gt;
Dev.to (contest and inspirtation)&lt;br&gt;
Github (workflow)&lt;/p&gt;

&lt;p&gt;Source &lt;a href="https://github.com/sudo-self/http-request.git"&gt;https://github.com/sudo-self/http-request.git&lt;/a&gt;&lt;/p&gt;

</description>
      <category>frontendchallenge</category>
      <category>devchallenge</category>
      <category>javascript</category>
      <category>webdev</category>
    </item>
    <item>
      <title>Dark Mode</title>
      <dc:creator>sudo-self</dc:creator>
      <pubDate>Mon, 11 Mar 2024 09:59:20 +0000</pubDate>
      <link>https://dev.to/sudo-self/dark-mode-23dd</link>
      <guid>https://dev.to/sudo-self/dark-mode-23dd</guid>
      <description>&lt;p&gt;Life is already complicated.&lt;br&gt;&lt;/p&gt;

&lt;p&gt;dark mode doesn't have to be.&lt;/p&gt;




&lt;p&gt;add a class to an SVG to use as a toggle&lt;/p&gt;

&lt;p&gt;&lt;code&gt;class="dark-mode-svg" onclick="toggleDarkMode()"&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;.dark-mode {&lt;br&gt;
            background-color: #333;&lt;br&gt;
            color: grey;&lt;br&gt;
        }&lt;/p&gt;

&lt;p&gt;.dark-mode-svg {&lt;br&gt;
            fill: #333;&lt;br&gt;
            color: grey; &lt;br&gt;
            width: 100px;&lt;br&gt;
            height: 100px;&lt;br&gt;
            margin-top: 50px;&lt;br&gt;
            margin-left: 900px;&lt;br&gt;
            cursor: pointer;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;function toggleDarkMode() {
  const body = document.body;
  const isDarkMode = body.classList.contains("dark-mode");
  body.classList.toggle("dark-mode", !isDarkMode);
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;iframe height="600" src="https://codepen.io/sudo-self/embed/zYXqWGm?height=600&amp;amp;default-tab=result&amp;amp;embed-version=2"&gt;
&lt;/iframe&gt;
&lt;/p&gt;

</description>
      <category>html</category>
      <category>css</category>
      <category>javascript</category>
      <category>developer</category>
    </item>
    <item>
      <title>htmx chat</title>
      <dc:creator>sudo-self</dc:creator>
      <pubDate>Thu, 07 Mar 2024 03:17:08 +0000</pubDate>
      <link>https://dev.to/sudo-self/htmx-chat-2bn3</link>
      <guid>https://dev.to/sudo-self/htmx-chat-2bn3</guid>
      <description>&lt;p&gt;AJAX, CSS Transitions, WebSockets, in HTML&lt;/p&gt;

&lt;p&gt;sucessor to intercooler = HTMX&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;npm install htmx.org
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;NUNCHUCKS&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt; npm install nunjucks
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;DAISYUI&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;npm i -D daisyui@latest
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;POCKETBASE&lt;/p&gt;

&lt;p&gt;&lt;a href="https://pocketbase.io"&gt;https://pocketbase.io&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;iframe height="600" src="https://codepen.io/sudo-self/embed/XWQmBZJ?height=600&amp;amp;default-tab=result&amp;amp;embed-version=2"&gt;
&lt;/iframe&gt;
&lt;/p&gt;

&lt;p&gt;web &lt;a href="https://sms.jessejesse.com"&gt;htmx-chat&lt;/a&gt;&lt;/p&gt;

</description>
      <category>codepen</category>
      <category>htmx</category>
      <category>pocketbase</category>
      <category>nunchucks</category>
    </item>
    <item>
      <title>Colorful Counter</title>
      <dc:creator>sudo-self</dc:creator>
      <pubDate>Wed, 06 Mar 2024 19:29:27 +0000</pubDate>
      <link>https://dev.to/sudo-self/colorful-counter-cph</link>
      <guid>https://dev.to/sudo-self/colorful-counter-cph</guid>
      <description>&lt;p&gt;&lt;a href="https://upstash-rediss.deno.dev"&gt;upstash-rediss.deno.dev&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;counters may be dime a dozen however a vast space for creativity is there. serverless. Another page view counter in production. &lt;/p&gt;

&lt;p&gt;Typescript with deno is straight forward.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;// server.ts
Deno.serve((_request: Request) =&amp;gt; {
  return new Response("serverless data with Upstash");
});

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Wasting no time head over to &lt;a href="https://upstash.com"&gt;Upstash&lt;/a&gt; create a Redis serverless database.&lt;/p&gt;

&lt;p&gt;Once complete there are two key pieces of info were gonna grab for the project that make up the rest API were gonna use to access our data....&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F02cnl3yox09cb1t5qxl2.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F02cnl3yox09cb1t5qxl2.png" alt="Image description" width="800" height="243"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;UPSTASH_REDIS_REST_URL&lt;/p&gt;

&lt;p&gt;UPSTASH_REDIS_REST_TOKEN&lt;/p&gt;

&lt;p&gt;copy them to a temporary file or leave a tab open then move them them directly to .env via playground. &lt;/p&gt;

&lt;p&gt;deno runtime.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;curl -fsSL https://deno.land/install.sh | sh
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;In the quickstarts we find the handler function. all the work is done here just grab this and start a new deno playground. &lt;a href="https://docs.deno.com/deploy/manual/playgrounds#creating-a-playground"&gt;Deno Playground&lt;/a&gt;&lt;a&gt;&lt;/a&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;import { serve } from "https://deno.land/std@0.142.0/http/server.ts";
import { Redis } from "https://deno.land/x/upstash_redis@v1.14.0/mod.ts";

serve(async (_req: Request) =&amp;gt; {

    if( ! _req.url.endsWith("favicon.ico") ) {
        const redis = new Redis({
            url: '**YOUR ENDPOINT**',
            token: '**YOUR TOKEN**',
        })

        const counter = await redis.incr("deno-counter");
        return new Response(JSON.stringify({ counter }), { status: 200 });
    }


});

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;save &amp;amp; deploy.&lt;/p&gt;

&lt;p&gt;The url should now return a json.&lt;br&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;{"count":197}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;a href="https://dark-night-57c5.jessejesse.workers.dev"&gt;Json&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Upstash endpoint and token moved to .env via playground settings.&lt;br&gt;&lt;/p&gt;

&lt;p&gt;&lt;code&gt;&lt;pre&gt;&lt;br&gt;
        const token = Deno.env.get("UPSTASH_REDIS_TOKEN");&lt;br&gt;
        const redisUrl = Deno.env.get("UPSTASH_REDIS_URL");&lt;br&gt;
 &lt;/pre&gt;&lt;/code&gt;&lt;br&gt;&lt;/p&gt;

&lt;p&gt;Then all were doing in that same space is rendering html with a tailwind CDN. &lt;/p&gt;

&lt;p&gt;const counter = await redis.incr("deno-counter");&lt;br&gt;
${counter}&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;//deno.json

{
  "tasks": {
    "dev": "deno run --watch main.ts"
  }
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;implement in production, another project, or keep creating. &lt;/p&gt;

&lt;p&gt;export to &lt;a href="https://GitHub.com/sudo-self"&gt;GitHub&lt;/a&gt; direct from playground.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fhps7f82d0nes476ref6i.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fhps7f82d0nes476ref6i.png" alt="Image description" width="800" height="469"&gt;&lt;/a&gt;&lt;br&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://upstash-rediss.deno.dev"&gt;upstash-rediss.deno.dev&lt;/a&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;//Generating random colors

const randomColor = generateRandomHexColor();

function generateRandomHexColor() {
    const randomColor = Math.floor(Math.random()*16777215).toString(16);
    return "#" + randomColor;
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;





&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;//html with tailwind CDN and GitHub buttons 

 &amp;lt;!DOCTYPE html&amp;gt;
            &amp;lt;html lang="en"&amp;gt;
            &amp;lt;head&amp;gt;

                &amp;lt;script async defer src="https://buttons.github.io/buttons.js"&amp;gt;&amp;lt;/script&amp;gt;
                &amp;lt;meta charset="UTF-8"&amp;gt;
                &amp;lt;meta name="viewport" content="width=device-width, initial-scale=1.0"&amp;gt;
                &amp;lt;title&amp;gt;Counter&amp;lt;/title&amp;gt;
                &amp;lt;link href="https://cdn.jsdelivr.net/npm/tailwindcss@2.2.19/dist/tailwind.min.css" rel="stylesheet"&amp;gt;
            &amp;lt;/head&amp;gt;
            &amp;lt;body class="bg-gray-100 flex flex-col items-center justify-center h-screen"&amp;gt;
                &amp;lt;div class="max-w-md w-full mx-auto rounded-lg p-6 mb-4" style="background-color: &amp;lt;u&amp;gt;${randomColor};&amp;lt;/u&amp;gt;"&amp;gt;
                    &amp;lt;div class="bg-white shadow-md rounded-lg p-6"&amp;gt;
                        &amp;lt;h1 class="text-3xl font-semibold text-center mb-4 cursor-pointer text-green-500 hover:text-green-600" onclick="location.reload()"&amp;gt;Counter&amp;lt;/h1&amp;gt;
                        &amp;lt;div class="text-center"&amp;gt;
                            &amp;lt;p class="text-5xl font-bold mb-4"&amp;gt;&amp;lt;u&amp;gt;${counter}&amp;lt;/u&amp;gt;&amp;lt;/p&amp;gt;
                            &amp;lt;p class="text-lg text-gray-500 mb-4"&amp;gt;https://upstash-rediss.deno.dev&amp;lt;/p&amp;gt;
                            &amp;lt;a class="github-button" href="https://github.com/sudo-self/upstash-deno" data-color-scheme="no-preference: dark; light: dark; dark: dark_high_contrast;" data-icon="octicon-star" data-size="large" aria-label="Star sudo-self/upstash-deno on GitHub"&amp;gt;Star&amp;lt;/a&amp;gt;
                            &amp;lt;p class="text-lg text-gray-500 mb-4"&amp;gt;MAC address: ${macAddress}&amp;lt;/p&amp;gt;
                        &amp;lt;/div&amp;gt;
                    &amp;lt;/div&amp;gt;
                &amp;lt;/div&amp;gt;
            &amp;lt;/body&amp;gt;
            &amp;lt;/html&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Guthub.com/&lt;a href="https://github.com/sudo-self/upstash-redis"&gt;sudo-self/upstash-deno&lt;/a&gt;&lt;/p&gt;

</description>
      <category>serverless</category>
      <category>upstash</category>
      <category>javascript</category>
      <category>metrics</category>
    </item>
  </channel>
</rss>
