Skip to content

Instantly share code, notes, and snippets.

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

richy rjmacarthy

🎮
The Tetris effect
View GitHub Profile
@rjmacarthy
rjmacarthy / bitcoind-ubuntu-install
Last active April 14, 2024 16:11
Install Bitcoind Ubuntu
** Add repository and install bitcoind **
sudo apt-get install build-essential
sudo apt-get install libtool autotools-dev autoconf
sudo apt-get install libssl-dev
sudo apt-get install libboost-all-dev
sudo add-apt-repository ppa:luke-jr/bitcoincore
sudo apt-get update
sudo apt-get install bitcoind
mkdir ~/.bitcoin/ && cd ~/.bitcoin/
@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 / 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 / rename_js_files.sh
Created September 4, 2019 10:56 — forked from afternoon/rename_js_files.sh
Rename .js files to .ts
find app/src -name "*.js" -exec sh -c 'mv "$0" "${0%.js}.ts"' {} \;