Skip to content

Instantly share code, notes, and snippets.

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

rj rjmacarthy

🎮
The Tetris effect
  • The Wilderness
  • 16:19 (UTC)
View GitHub Profile
# Create a temporary directory
mkdir ~/zig-temp
cd ~/zig-temp
# Download Zig 0.13.0
wget https://ziglang.org/download/0.13.0/zig-linux-x86_64-0.13.0.tar.xz
# Extract the archive
tar -xvf zig-linux-x86_64-0.13.0.tar.xz
@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 / 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 [email protected]
  • 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