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 / timezones.json
Last active December 4, 2023 16:37
JSON Timezone List
[
   {
      "value": -12,
      "text": "(GMT -12:00) Eniwetok, Kwajalein"
   },
   {
      "value": -11,
      "text": "(GMT -11:00) Midway Island, Samoa"
   },
   {
@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
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 / 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 / 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 / .gitconfig
Last active January 19, 2022 21:15
Handy Git Aliases
[alias]
b = branch
bd = branch -D
c = commit -m
co = checkout
cob = checkout -b
p = pull
pune = pull --prune
s = status
undo = reset HEAD^
@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 / checkWebPSupport.js
Created February 20, 2019 15:02
Check WebP support browser-side
const supportsWebP = () => new Promise(resolve => {
const webP = new Image();
webP.src = 'data:image/webp;base64,UklGRh4AAABXRUJQVlA4TBEAAAAvAAAAAAfQ//73v/+BiOh/AAA='; // 1x1 black pixel
webP.onload = webP.onerror = () => resolve(webP.height === 1);
})
supportsWebP().then(hasWebP => console.log(hasWebP));
@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