Skip to content

Instantly share code, notes, and snippets.

View rjmacarthy's full-sized avatar
🎮
The Tetris effect

Richard Macarthy rjmacarthy

🎮
The Tetris effect
View GitHub Profile
@rjmacarthy
rjmacarthy / mass-unfollow-twitter.js
Last active July 17, 2023 14:00
mass unfollow twitter
function unfollow() {
const elements = document.querySelectorAll('[data-testid=cellInnerDiv]')
elements.forEach((element) => {
const buttons = element.querySelectorAll('[role="button"]')
buttons.forEach((button) => {
if (button.innerText === 'Following') {
button.click()
const unfollowButton = document.querySelector('[data-testid="confirmationSheetConfirm"]')
unfollowButton.click()
}
@rjmacarthy
rjmacarthy / shortcuts.md
Last active June 1, 2023 10:59
keyboard shortcuts for ecosse/nvim

NVim Configuration Cheat Sheet

This is a quick reference guide for NVim configuration key bindings for https://github.com/ecosse3/nvim

File Explorer

Key Bindings Description
<C - e> Open File Explorer
Backspace Back to file explorer (in editor normal mode)
@rjmacarthy
rjmacarthy / p2tr.js
Created July 8, 2022 09:12
Generate a Bitcoin P2TR Address
const ECPairFactory = require('ecpair').ECPairFactory
const ecurve = require('ecurve')
const secp256k1 = ecurve.getCurveByName('secp256k1')
const schnorr = require('bip-schnorr')
const bech32 = require('bech32').bech32
const bech32m = require('bech32').bech32m
const tinysecp = require('tiny-secp256k1');
const ECPair = ECPairFactory(tinysecp);
@rjmacarthy
rjmacarthy / git aliases
Created June 20, 2022 14:33
git aliases
alias gp="git push origin HEAD"
alias gf="git fetch upstream && git fetch origin"
alias gld="git log upstream/master..HEAD"
alias grus="git rebase upstream/master"
alias gsa0="git stash apply stash@{0}"
alias gro="git reset --hard origin/master"
alias gru="git reset --hard upstream/master"
alias gsui="git submodule update --init"
@rjmacarthy
rjmacarthy / cra.txt
Created April 19, 2022 09:29
run cra production build
cd build
http-server --push-state
// navigate to http://localhost:8080
@rjmacarthy
rjmacarthy / proxy
Created June 15, 2021 08:49
nginx reverse proxy
server {
listen 443 ssl;
server_name localhost.<domain>.com;
access_log /var/log/nginx/<domain>.log;
client_max_body_size 20M;
ssl_certificate /etc/ssl/certs/<domain>.crt;
ssl_certificate_key /etc/ssl/private/localhost.key;
ssl_ciphers 'ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES128-GCM-SHA256:E CDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-AES256-GCM-SHA384:DHE-RSA-AES128-GCM-SHA2 56:DHE-DSS-AES128-GCM-SHA256:kEDH+AESGCM:ECDHE-RSA-AES128-SHA256:ECDHE-ECDSA-AES 128-SHA256:ECDHE-RSA-AES128-SHA:ECDHE-ECDSA-AES128-SHA:ECDHE-RSA-AES256-SHA384:E CDHE-ECDSA-AES256-SHA384:ECDHE-RSA-AES256-SHA:ECDHE-ECDSA-AES256-SHA:DHE-RSA-AES 128-SHA256:DHE-RSA-AES128-SHA:DHE-DSS-AES128-SHA256:DHE-RSA-AES256-SHA256:DHE-DS S-AES256-SHA:DHE-RSA-AES256-SHA';
ssl_protocols TLSv1.1 TLSv1.2;
ssl_prefer_server_ciphers on;
tree -L 3 -I *node_modules
@rjmacarthy
rjmacarthy / delete_git_submodule.md
Created April 19, 2021 11:33 — forked from myusuf3/delete_git_submodule.md
How effectively delete a git submodule.

To remove a submodule you need to:

  • Delete the relevant section from the .gitmodules file.
  • Stage the .gitmodules changes git add .gitmodules
  • Delete the relevant section from .git/config.
  • Run git rm --cached path_to_submodule (no trailing slash).
  • Run rm -rf .git/modules/path_to_submodule (no trailing slash).
  • Commit git commit -m "Removed submodule "
  • Delete the now untracked submodule files rm -rf path_to_submodule
@rjmacarthy
rjmacarthy / deploy-keys.md
Created May 5, 2020 11:06 — forked from holmberd/deploy-keys.md
Setup GitHub repository SSH deploy keys

Setup GitHub repository SSH deploy keys

  1. Create GitHub repository in github and save the SSH repository url

  2. Init git on server in code directory

  • git init
  1. Create SSH keys on the server
  • ssh-keygen -t rsa -b 4096 -C your@email.here
  • Rename the key that doesn't end with .pub to repo-name.deploy.pem
@rjmacarthy
rjmacarthy / bundle
Created October 3, 2019 10:02
fix bundle warning multiple bundler versions
gem install bundler -v x.x.x
bundle _x.x.x_ install