<?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: Sam</title>
    <description>The latest articles on DEV Community by Sam (@tofudotdev).</description>
    <link>https://dev.to/tofudotdev</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%2F250809%2F5a8f6072-f9cb-445c-b790-53353c1f6846.jpeg</url>
      <title>DEV Community: Sam</title>
      <link>https://dev.to/tofudotdev</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/tofudotdev"/>
    <language>en</language>
    <item>
      <title>Ok Boomer! Instant GitHub Repo Creation in One Command 🚀</title>
      <dc:creator>Sam</dc:creator>
      <pubDate>Thu, 01 Feb 2024 22:04:18 +0000</pubDate>
      <link>https://dev.to/tofudotdev/ok-boomer-instant-github-repo-creation-in-one-command-1cd</link>
      <guid>https://dev.to/tofudotdev/ok-boomer-instant-github-repo-creation-in-one-command-1cd</guid>
      <description>&lt;h2&gt;
  
  
  Boom Live Action GIFs 🤩
&lt;/h2&gt;

&lt;h3&gt;
  
  
  On an existing folder/repo
&lt;/h3&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%2Fdcfq6eju6sxsj2mydh5y.gif" 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%2Fdcfq6eju6sxsj2mydh5y.gif" alt="Existing Repo" width="1132" height="770"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Creating a new folder/repo
&lt;/h3&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%2Fezqbml8wvxp8hs51s08v.gif" 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%2Fezqbml8wvxp8hs51s08v.gif" alt="New repo/folder" width="800" height="553"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Quick Explanation / Installation
&lt;/h2&gt;

&lt;p&gt;Hey DEV community! If you're anything like me, you frequently start new projects to experiment with ideas, and find yourself needing to manually create new repositories on GitHub for backups.&lt;/p&gt;

&lt;p&gt;If so, you'll appreciate this little &lt;code&gt;boom&lt;/code&gt; script I wrote a few years back. Simply copy/paste the code snippet below into your &lt;code&gt;.rc/.bashrc/.zshrc&lt;/code&gt; file and you're ready to &lt;code&gt;boom&lt;/code&gt; 🤯&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;👉 &lt;em&gt;Note:&lt;/em&gt; This script uses the GitHub CLI. So make sure you've installed that if you haven't already. Instructions &lt;a href="https://cli.github.com/"&gt;here&lt;/a&gt;.&lt;br&gt;
&lt;/p&gt;
&lt;/blockquote&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="c"&gt;#!/bin/bash&lt;/span&gt;
&lt;span class="c"&gt;# Function to quiet the output of a cmd unless it fails &lt;/span&gt;

&lt;span class="c"&gt;# Optional function I find handy for silencing the output of commands&lt;/span&gt;
quiet &lt;span class="o"&gt;()&lt;/span&gt; &lt;span class="o"&gt;{&lt;/span&gt;
    &lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="nv"&gt;$@&lt;/span&gt;&lt;span class="s2"&gt;"&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;&lt;/span&gt; /dev/null 2&amp;gt;&amp;amp;1
&lt;span class="o"&gt;}&lt;/span&gt;

boom &lt;span class="o"&gt;()&lt;/span&gt; &lt;span class="o"&gt;{&lt;/span&gt;
    &lt;span class="nb"&gt;echo&lt;/span&gt; &lt;span class="s2"&gt;"Boom! Creating Git &amp;amp; GitHub repo. Please wait..."&lt;/span&gt;
        &lt;span class="c"&gt;# If a param is passed, create a dir with that name and cd to it&lt;/span&gt;
    &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="o"&gt;[&lt;/span&gt; &lt;span class="nv"&gt;$1&lt;/span&gt; &lt;span class="o"&gt;]&lt;/span&gt;
    &lt;span class="k"&gt;then
        &lt;/span&gt;quiet &lt;span class="nb"&gt;mkdir&lt;/span&gt; &lt;span class="nv"&gt;$1&lt;/span&gt; &lt;span class="o"&gt;&amp;amp;&amp;amp;&lt;/span&gt; &lt;span class="nb"&gt;cd&lt;/span&gt; &lt;span class="nv"&gt;$1&lt;/span&gt;
        &lt;span class="nb"&gt;echo&lt;/span&gt; &lt;span class="s2"&gt;"Created folder &lt;/span&gt;&lt;span class="nv"&gt;$1&lt;/span&gt;&lt;span class="s2"&gt;"&lt;/span&gt;
    &lt;span class="k"&gt;fi&lt;/span&gt;
        &lt;span class="c"&gt;# Create README file if it doesn't already exist with directory name&lt;/span&gt;
    &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="o"&gt;[&lt;/span&gt; &lt;span class="o"&gt;!&lt;/span&gt; &lt;span class="nt"&gt;-f&lt;/span&gt; README.md &lt;span class="o"&gt;]&lt;/span&gt;
    &lt;span class="k"&gt;then
        &lt;/span&gt;quiet &lt;span class="nb"&gt;echo&lt;/span&gt; &lt;span class="s2"&gt;"# &lt;/span&gt;&lt;span class="k"&gt;${&lt;/span&gt;&lt;span class="nv"&gt;PWD&lt;/span&gt;&lt;span class="p"&gt;##*/&lt;/span&gt;&lt;span class="k"&gt;}&lt;/span&gt;&lt;span class="s2"&gt;"&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;&lt;/span&gt; README.md
        &lt;span class="nb"&gt;echo&lt;/span&gt; &lt;span class="s2"&gt;"Generated a README.md file"&lt;/span&gt;
    &lt;span class="k"&gt;fi
    &lt;/span&gt;git init
    git add &lt;span class="nb"&gt;.&lt;/span&gt;
    git commit &lt;span class="nt"&gt;-m&lt;/span&gt; &lt;span class="s2"&gt;"Initial commit"&lt;/span&gt;
    gh repo create &lt;span class="k"&gt;${&lt;/span&gt;&lt;span class="nv"&gt;PWD&lt;/span&gt;&lt;span class="p"&gt;##*/&lt;/span&gt;&lt;span class="k"&gt;}&lt;/span&gt; &lt;span class="nt"&gt;--private&lt;/span&gt; &lt;span class="nt"&gt;--source&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="nb"&gt;.&lt;/span&gt; &lt;span class="nt"&gt;--remote&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;origin
    git push &lt;span class="nt"&gt;-u&lt;/span&gt; origin main
    &lt;span class="nb"&gt;echo&lt;/span&gt; &lt;span class="s2"&gt;"Boom! Your repo is live: &lt;/span&gt;&lt;span class="si"&gt;$(&lt;/span&gt;git config &lt;span class="nt"&gt;--get&lt;/span&gt; remote.origin.url&lt;span class="si"&gt;)&lt;/span&gt;&lt;span class="s2"&gt;"&lt;/span&gt;
&lt;span class="o"&gt;}&lt;/span&gt;

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

&lt;/div&gt;



&lt;h2&gt;
  
  
  How's it work? 🤔
&lt;/h2&gt;

&lt;p&gt;The &lt;code&gt;boom&lt;/code&gt; script simplifies repository creation into one straightforward command. Here's how you can use it:&lt;/p&gt;

&lt;h3&gt;
  
  
  With Argument:
&lt;/h3&gt;

&lt;p&gt;Running the script with an argument creates a new folder, navigates into it, generates a &lt;code&gt;README.md&lt;/code&gt; file with the folder name as the title, initializes a new Git repository, adds all files, commits the changes, pushes the new repository to GitHub, and outputs the repository URL.&lt;/p&gt;

&lt;h3&gt;
  
  
  Without Argument:
&lt;/h3&gt;

&lt;p&gt;If run without an argument, the script generates a &lt;code&gt;README.md&lt;/code&gt; file with the current folder name as the title, initializes a new Git repository, adds all files, commits the changes, pushes the new repository to GitHub, and outputs the repository URL.&lt;/p&gt;

&lt;h2&gt;
  
  
  Notes
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Customize your repository by adding a &lt;code&gt;.gitignore&lt;/code&gt; file before running the script if you don't want to include all your files.&lt;/li&gt;
&lt;li&gt;By default, the script creates private GitHub repositories. Adjust this behavior by modifying the script.
Repositories can be deleted from GitHub using the command &lt;code&gt;hub delete -y repo-name&lt;/code&gt;.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Ok Boomer 👴🏻
&lt;/h2&gt;

&lt;p&gt;Hope this saves you all some time! I've used variants of this script myself hundreds of times for over a decade now!&lt;/p&gt;

&lt;p&gt;If you're interested in other things I've made to speed up our dev lives &lt;a href="https://dev.to/tofudotdev/still-deploying-updates-to-toggle-maintenance-pages-i-was-too-lgj"&gt;check out the other post I wrote here&lt;/a&gt; recently about &lt;a href="https://maintenance.dev"&gt;Maintenance.dev&lt;/a&gt;, a new side project I launched that lets you get an instantly toggle-able customizable maintenance page for your own website with a single &lt;code&gt;&amp;lt;script&amp;gt;&lt;/code&gt;, so you don't have to do any more manual deploys just to toggle maintenance pages.&lt;/p&gt;

&lt;p&gt;Happy coding everyone! 🫡 &lt;/p&gt;

</description>
      <category>productivity</category>
      <category>programming</category>
      <category>github</category>
      <category>git</category>
    </item>
    <item>
      <title>Still deploying updates to toggle maintenance pages? I was too! 🚀</title>
      <dc:creator>Sam</dc:creator>
      <pubDate>Thu, 11 Jan 2024 23:22:39 +0000</pubDate>
      <link>https://dev.to/tofudotdev/still-deploying-updates-to-toggle-maintenance-pages-i-was-too-lgj</link>
      <guid>https://dev.to/tofudotdev/still-deploying-updates-to-toggle-maintenance-pages-i-was-too-lgj</guid>
      <description>&lt;p&gt;&lt;a href="https://media.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%2F2stk1y86fyhtqwxx9fvg.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://media.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%2F2stk1y86fyhtqwxx9fvg.gif" alt="Automated Maintenance Page Builder"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Scouts Honour: I'll be discussing a new SaaS I've developed here&lt;/em&gt; 🫡&lt;/p&gt;




&lt;p&gt;Hey Dev Community! 👋 As the CTO of a web development agency, I've been in the coding trenches for years. One pain point that has consistently nagged at me (and I've seen discussed in this community over the years!) is the process of manually deploying updates just to toggle simple website maintenance pages. It's a cumbersome dance we've all been doing for too long!&lt;/p&gt;

&lt;h2&gt;
  
  
  The Maintenance Challenge
&lt;/h2&gt;

&lt;p&gt;Every agency I've been at, we've built custom solutions for maintenance windows; deploying static HTML pages, updating database booleans, updating code, and crossing our fingers that everything goes smoothly. &lt;/p&gt;

&lt;p&gt;The disconnect between what should be one of the simplest parts of a website and the complexity I've always encountered frustrated me 😡&lt;/p&gt;

&lt;p&gt;Even worse, these pages are usually static, and provide no way of keeping your users in the loop on how your maintenance is progressing, so instead companies usually revert to posting status updates on social media. Again, this just seemed ridiculous! 🤦&lt;/p&gt;

&lt;h2&gt;
  
  
  The Birth of Maintenance.dev 🤔
&lt;/h2&gt;

&lt;p&gt;So, I took matters into my own hands and built &lt;a href="https://maintenance.dev" rel="noopener noreferrer"&gt;Maintenance.dev&lt;/a&gt;. I wanted to make toggling maintenance pages as easy as flipping a switch, and to stop us all reinventing the wheel for such a common task.&lt;/p&gt;

&lt;h2&gt;
  
  
  What's the Magic?
&lt;/h2&gt;

&lt;p&gt;Here's the lowdown: &lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Log in, Add Branding, Title, Text:&lt;/strong&gt;

&lt;ul&gt;
&lt;li&gt;Just log into Maintenance.dev, add your branding, title, and maintenance message. &lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;a href="https://media.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%2F2stk1y86fyhtqwxx9fvg.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://media.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%2F2stk1y86fyhtqwxx9fvg.gif" alt="Automated Maintenance Page Builder"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Generate Your Script:&lt;/strong&gt;

&lt;ul&gt;
&lt;li&gt;Maintenance.Dev will generate a simple script for your project, e.g.:
&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ol&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;script
      &lt;/span&gt;&lt;span class="na"&gt;src=&lt;/span&gt;&lt;span class="s"&gt;"https://maintenance.dev/maintenance.js"&lt;/span&gt;
      &lt;span class="na"&gt;data-project-id=&lt;/span&gt;&lt;span class="s"&gt;"5c08e0e1-bad3-46f2-ba0f-e432cac5c1cf"&lt;/span&gt;
      &lt;span class="na"&gt;defer&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;gt;&amp;lt;/script&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Insert, Toggle, Done:&lt;/strong&gt;

&lt;ul&gt;
&lt;li&gt;Insert the script into your webpage. Anytime you hit &lt;code&gt;Enable/Disable Maintenance&lt;/code&gt; on your dashboard, your maintenance page is toggled on/off to your website users, instantly. That's it. Really.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;a href="https://media.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%2F9afm43b9m3d9bggb3v9m.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://media.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%2F9afm43b9m3d9bggb3v9m.gif" alt="Image description"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Realtime Updates, No Refresh Required! 🔉
&lt;/h2&gt;

&lt;p&gt;We also solved the communication gap during maintenance. No more resorting to tweets or external updates. &lt;strong&gt;Any time you update your maintenance page, these updates will be delivered to users in realtime without them even having to refresh their page&lt;/strong&gt;. 🔄 &lt;/p&gt;

&lt;p&gt;All this is achieved via websockets, so you don't need to worry about your website polling/spamming network requests 🤩&lt;/p&gt;

&lt;h2&gt;
  
  
  What about me? I'm an app/backend developer! 🙋🙋‍♀️
&lt;/h2&gt;

&lt;p&gt;I also didn't forget about my mobile and backend developers. So I went a step further and provided an alternative option for you (or for anyone else who may have more bespoke UX needs than what the low-code automated maintenance page provides):&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Custom JSON Structure:&lt;/strong&gt;

&lt;ul&gt;
&lt;li&gt;For those who want complete control, you have the option to define &lt;strong&gt;your own JSON structure&lt;/strong&gt;. Same as above, any time you toggle maintenance mode for your project, we'll send you this information in realtime (including any updates you make to the project).&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://media.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%2Frae0k5dse3kd9gqhgelx.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.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%2Frae0k5dse3kd9gqhgelx.png" alt="CUSTOM JSON Payload"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Get Started in Minutes! - FREE
&lt;/h2&gt;

&lt;p&gt;I tried to make the free-tier as generous as possible, and if I'm being honest I think it should be suitable for almost anyone outside of professional organizations/agencies.&lt;/p&gt;

&lt;p&gt;There's also an option to join the waiting list for the paid plan (which will give you a 50% discount for when it goes live).&lt;/p&gt;

&lt;p&gt;&lt;iframe width="710" height="399" src="https://www.youtube.com/embed/fXiTTVd3E8Q?start=25"&gt;
&lt;/iframe&gt;
&lt;/p&gt;

&lt;p&gt;👉 If this looks useful to you, please check out &lt;a href="https://maintenance.dev" rel="noopener noreferrer"&gt;Maintenance.dev&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;Please feel free to comment any questions here! I'm more than happy to discuss anything about the tool, how it works, how I built it (tech stack) - whatever you might be interested in! 💻✨ Thanks everyone! 👋&lt;/p&gt;

</description>
      <category>webdev</category>
      <category>showdev</category>
      <category>startup</category>
      <category>frontend</category>
    </item>
  </channel>
</rss>
