Skip to content

Instantly share code, notes, and snippets.

View ByteJoseph's full-sized avatar
:electron:
Open Sourcer

Joseph ByteJoseph

:electron:
Open Sourcer
View GitHub Profile
@ByteJoseph
ByteJoseph / Readme.md
Created November 14, 2024 03:13
Quick GitHub Commands

Quick Bash Commands for Git Troubleshooting

1. Undo the Last Commit (Keep Changes)

git reset --soft HEAD~1
@ByteJoseph
ByteJoseph / index.js
Last active August 13, 2024 07:44
Send whatsapp message to a number
const { Client, LocalAuth } = require('whatsapp-web.js');
const qrcode = require('qrcode-terminal');
// Initialize the WhatsApp client
const client = new Client({
authStrategy: new LocalAuth()
});
// Generate and display the QR code in the terminal
client.on('qr', (qr) => {
@ByteJoseph
ByteJoseph / script.js
Created July 8, 2024 15:28
Navigate to Google when hit enter
document.addEventListener('DOMContentLoaded', () => {
const textBox = document.getElementById('your_id');
textBox.addEventListener('keydown', (event) => {
if (event.key === 'Enter') {
const keyword = textBox.value;
const googleSearchUrl = `https://www.google.com/search?q=${encodeURIComponent(keyword)}`;
window.location.href = googleSearchUrl;
}
});
@ByteJoseph
ByteJoseph / windows_virtual_env.md
Created June 12, 2024 02:43
Creating and activating a Python virtual environment on Windows

Creating and Activating a Python Virtual Environment on Windows

Windows Logo

Step-by-Step Guide

1. Open Command Prompt or PowerShell