Skip to content

Instantly share code, notes, and snippets.

View Swarag-N's full-sized avatar
👨‍🚀
Hello There!

Swarag Narayanasetty Swarag-N

👨‍🚀
Hello There!
View GitHub Profile
@Swarag-N
Swarag-N / index.html
Last active June 30, 2020 14:39
This is an example gist to parse form data in node js "without" express js and body-parser
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Node Intial</title>
</head>
<body>
<h1>Hello</h1>
<form action="http://127.0.0.1:3000/" method="post">
<input type="text" name="name" id="">

Deploying a React App* to GitHub Pages

* created using create-react-app

Introduction

In this tutorial, I'll show you how I deployed a React app—which I created using create-react-app—to GitHub Pages.

You can visit the deployed app, at https://gitname.github.io/react-gh-pages/.

@Swarag-N
Swarag-N / rock-paper-scissors.py
Created July 21, 2020 05:42
Bored of playing Play Rock Paper and Scissors. with limited options.
"""
Start Script, choose the options you want play and start,
play until you want exit (exit by !exit)
Stores your score in results.txt file
Enter your name: > Tim
Hello, Tim
> rock,gun,lightning,devil,dragon,water,air,paper,sponge,wolf,tree,human,snake,scissors,fire
Okay, let's start
@Swarag-N
Swarag-N / Usage.md
Created October 10, 2024 19:01
This script converts a .env file to a JSON format

Dotenv to JSON Converter

This script converts a .env file to a JSON format. Here's a breakdown of how it works:

  1. Preprocessing with sed:
    sed 's/\r$//' .env
    • This command removes carriage returns (\r) at the end of each line in the .env file.
    • It handles both Windows (CRLF) and Unix (LF) line endings.
@Swarag-N
Swarag-N / markdown-shortcut.md
Created June 2, 2026 07:01
You can assign a keyword shortcut directly to your Chrome search engines to format links

Chrome Address Bar Shortcut: Copy Page as Markdown

Quickly copy any web page's title and URL as a formatted [Title](URL) Markdown link without using browser extensions.

Setup Instructions

  1. Open Chrome settings by navigating to: chrome://settings/searchEngines
  2. Scroll down to the Site search section and click Add.
  3. Fill out the fields with the following details:
  • Search engine: Copy Markdown
@Swarag-N
Swarag-N / ssh-carry-pems-through-jump-host.md
Last active July 21, 2026 15:04
Carry SSH pem keys through a jump host past a hardware/enclave agent (Secretive/Keychain) — override IdentityAgent + forward the ephemeral agent

SSH: carry pems through a jump host (past a hardware/enclave agent)

The problem

Two SSH agents exist and they never meet:

  • ssh-add writes to your agent ($SSH_AUTH_SOCK).
  • ssh reads the enclave agent (forced by Host *IdentityAgent in ~/.ssh/config).

So keys you add never get offered. Override the agent for the connection and you're fine.