Skip to content

Instantly share code, notes, and snippets.

@jaredreich
jaredreich / nodejs-cicd-github-actions.md
Created January 6, 2024 05:54 — forked from danielwetan/nodejs-cicd-github-actions.md
Deploy Node.js to VPS using Github Actions

Deploy Node.js to VPS using Github Actions

Steps to deploy Node.js to VPS using PM2 and Github Actions

1. Clone repo to VPS folder

@jaredreich
jaredreich / 01.js
Last active December 1, 2023 21:02
AOC 2023
import fs from 'fs';
const input = fs.readFileSync('./01/input.txt', { encoding: 'utf8' });
const injectNumbers = (text, name, value) => {
while (text.search(name) > -1) {
const index = text.search(name);
text = [text.slice(0, index + 1), value, text.slice(index + 1)].join('');
}
return text;
@jaredreich
jaredreich / README.md
Created July 1, 2022 01:34
PowKiddy V90 Custom Firmware

https://github.com/TriForceX/MiyooCFW/wiki/Custom-Firmware-Setup

PowKiddy Q90-V90 (Download)

  1. You need to remove all partitions of SD card using: Partition Wizard or SD Card Formatter
  2. If the CFW file is compressed on .7zip just extract using 7zip before proceeding
  3. Execute Win32DiskImager, select SD card, load the .IMG file and press Write button to proceed.
  4. Once the image is burned on the SD card, open Partition Wizard and choose Disk Management.
  5. Then right click on the "main" partition and choose extend (Set it to the maximum) and apply.
  6. Insert the SD into your console and turn it on. If it boots it is a success.
@jaredreich
jaredreich / README.md
Last active August 12, 2022 14:27
M1 MacBook - Override F5 and F6 keys (dictation and do not disturb) to change keyboard brightness
@jaredreich
jaredreich / script.sh
Last active June 9, 2022 18:19
youtube-dl download playlist as mp4 to directory (macOS)
# Playlist
# playlist id: PLNw_hEO5pK1pzbx5q5mcdpSKzHzgDSPjR
youtube-dl -f 'bestvideo[ext=mp4]+bestaudio[ext=m4a]/mp4' -o '~/Downloads/%(playlist_index)s-%(title)s.%(ext)s' -i PLNw_hEO5pK1pzbx5q5mcdpSKzHzgDSPjR
# or
youtube-dl -f mp4 -o '~/Downloads/%(playlist_index)s-%(title)s.%(ext)s' -i PLNw_hEO5pK1pzbx5q5mcdpSKzHzgDSPjR
# or
# 135 = 480p mp4, 140 = m4a
youtube-dl -f '135+140/mp4' -o '~/Downloads/%(playlist_index)s-%(title)s.%(ext)s' -i PLNw_hEO5pK1pzbx5q5mcdpSKzHzgDSPjR
@jaredreich
jaredreich / git_cli_reset_password.sh
Created February 18, 2020 16:33
git cli reset password
git config --global credential.helper osxkeychain
@jaredreich
jaredreich / mac_mouse_acceleration.sh
Created November 29, 2019 23:36
Turn off mac mouse acceleration
defaults write -g com.apple.mouse.scaling -1
defaults write -g com.apple.trackpad.scaling -1
@jaredreich
jaredreich / withAsyncErrorHandling.js
Created September 16, 2019 15:46
Scoped component async event error handling in React
const reservedClassMethodNames = {
componentDidCatch: 1,
componentDidMount: 1,
componentDidUpdate: 1,
componentWillMount: 1,
componentWillReceiveProps: 1,
componentWillUnmount: 1,
componentWillUpdate: 1,
constructor: 1,
getDerivedStateFromError: 1,
@jaredreich
jaredreich / git_fetch_fork_upstream.txt
Created May 8, 2019 23:40
Git fetch fork upstream
git fetch upstream
git checkout master
git merge upstream/master
git push
@jaredreich
jaredreich / crypto_browser.js
Created April 11, 2019 14:23
Browser-side JavaScript AES Encryption
const crypto = require('sjcl')
const iter = 1000
const ks = 256
export const decrypt = (password, encrypted) => crypto.decrypt(password, encrypted)
export const encrypt = (password, text) => crypto.encrypt(password, text, { iter, ks })