Skip to content

Instantly share code, notes, and snippets.

View themarcba's full-sized avatar

Marc Backes themarcba

View GitHub Profile
// A dependency-free, await-ready function for Node.js
// to get user input in the console
// Author: Marc Backes (@themarcba
const getInput = query => {
return new Promise((resolve, reject) => {
const readline = require('readline').createInterface({
input: process.stdin,
output: process.stdout,
})
readline.question(`${query} `, answer => {

Stupid puns. Don't Laugh!

Tech puns

  • Why did the Vue child component have such great self-esteem? Because its parent kept giving it props!
  • What does a Vue developer have in his tea? Syntactic sugar
  • Programming is like sex: One mistake and you have to support it for the rest of your life.
  • Sometimes when I'm writing JavaScript I want to throw up my hands and say "this is bullshit!" but I can never remember what "this" refers to.
  • Why are JavaScript conferences the worst? It all just sounds scripted.
  • How do you comfort a JavaScript bug? a. You console it.
@themarcba
themarcba / new_branch_bugfix.sh
Created January 24, 2022 13:47
Short commands to pull the current branch and create a new branch from it
#!/usr/bin/env zsh
source ~/.zshrc
ggpull
gco -b "bugfix/$1"
npm init vue@3
if [ $? -eq 0 ]; then
LAST_FOLDER=$(ls -td ./* | head -1)
cd $LAST_FOLDER
yarn
code .
else
echo "Project creation unsuccessful 😔"
fi
@themarcba
themarcba / accept-x-community-requests.js
Last active January 5, 2024 10:19
Accept all requests on an 𝕏 community
const acceptInterval = setInterval(() => {
const acceptButtons = Array.from(document.querySelectorAll("[role=button]")).filter(
(button) => button.textContent === "Approve"
);
if (acceptButtons.length > 0) {
acceptButtons.forEach((b) => b.click());
window.scrollBy(0, window.innerHeight - 100);
} else {
clearInterval(acceptInterval);