Skip to content

dhruuvv-git/instant-github-code-pusher

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 

Repository files navigation

⚡ GitHub Instant Code Pusher

Version Platform License

A lightweight, frictionless browser extension designed to kill the repetitive busywork of saving code snippets, algorithmic solutions, and notes directly to GitHub.

Instead of juggling terminal commands, creating manual files, or wrestling with git commits, this extension allows you to highlight any code block on the web, click a button, and push it directly to your remote repository in seconds.


✨ Features

  • 🧲 Auto-Capture Selected Text: Highlight code on any website (like LeetCode, ChatGPT, or documentation). When you open the extension, your highlighted text is automatically pulled into the editor.
  • 🧠 Smart Auto-Save: Your Personal Access Token (PAT), target repository, and last-used file paths are saved locally. Set it up once and never type it again.
  • 📝 Problem/Note Wrapping: Includes a dedicated input for problem descriptions or notes, which automatically wraps them into a clean multi-line comment block above your code.
  • 🛡️ Collision Detection: Safely checks if a file already exists in your target path before pushing. If there's a conflict, it prompts you with a native UI to confirm if you want to cleanly overwrite it via SHA-matching.
  • ⚡ Direct to Main: Leverages the GitHub v3 REST API to push files directly to your default branch. No intermediate branches, no unnecessary pull requests.

🛠️ Installation (Developer Mode)

Since this is a custom local tool, it is installed directly via your browser's extension engine:

  1. Clone or Download this repository to your local machine.
  2. Open your Chromium-based browser (Chrome, Brave, Edge) and navigate to chrome://extensions/.
  3. Toggle on Developer mode in the top right corner.
  4. Click Load unpacked in the top left menu.
  5. Select the folder containing these extension files.
  6. Optional but recommended: Pin the extension to your browser toolbar for quick access.

🚀 How to Use

1. Generate a GitHub Token

To allow the extension to push code on your behalf, you need a one-time setup token.

  • Go to your GitHub Settings -> Developer settings -> Personal access tokens -> Tokens (classic).
  • Click Generate new token (classic).
  • Give it a name and check the box for repo (Full control of private repositories).
  • Generate and copy the token.

2. Push Your First File

  • Highlight a block of code on any webpage.
  • Click the extension icon.
  • Token: Paste your ghp_... token.
  • Target Repository: Format as username/repository-name (e.g., dhruuvv-git/leetcode-solutions).
  • File Path: Define your path and extension (e.g., arrays/TwoSum.java). If the folders don't exist, the API will create them automatically.
  • Hit Upload Directly to Main.

🔒 Security & Privacy Notice

Your token never leaves your machine. This extension relies purely on client-side JavaScript. Your GitHub Personal Access Token (PAT) is stored exclusively in your browser's local chrome.storage API. There are no external databases, telemetry, or third-party servers acting as middlemen. The extension communicates directly with the official api.github.com endpoints.


💻 Tech Stack

  • HTML5 / CSS3: Clean, native-feeling popup UI.
  • Vanilla JavaScript (ES6+): Async/Await API orchestration and background scripting.
  • GitHub REST API (v3): Repository interactions, SHA fetching, and Base64 content uploading.
  • Chrome Extension API: chrome.storage, chrome.tabs, chrome.scripting.

About

GitHub-integrated browser utility utilizing the GitHub REST API and browser storage to streamline algorithmic practice workflows and remote code archival.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors