Skip to content

Instantly share code, notes, and snippets.

View wyattades's full-sized avatar
🐨

Wyatt Ades wyattades

🐨
View GitHub Profile
@wyattades
wyattades / unix_utils.sh
Last active October 14, 2024 22:22
Any node package-manager alias command
# alias `p` to whatever the repo's current package-manager is.
# handles up to 3-levels deep.
p() {
(
if [ -f pnpm-lock.yaml ] || [ -f ../pnpm-lock.yaml ] || [ -f ../../pnpm-lock.yaml ]; then
pnpm $@
elif [ -f yarn.lock ] || [ -f ../yarn.lock ] || [ -f ../../yarn.lock ]; then
yarn $@
elif [ -f package-lock.json ] || [ -f ../package-lock.json ] || [ -f ../../package-lock.json ]; then
npm $@
@wyattades
wyattades / ci.rb
Last active May 10, 2022 06:37
Github Actions for Heroku pipeline: automate prod/staging/review apps & run tests
# .github/ci.rb
require "bundler/inline"
gemfile do
source "https://rubygems.org"
gem "platform-api", "~> 3.3"
gem "activesupport", "~> 6.1", require: false
end
require "active_support"
require "active_support/core_ext"
@wyattades
wyattades / 📊 Weekly development breakdown
Last active July 6, 2022 00:12
Weekly development breakdown
Ruby 9 hrs 46 mins ██████▊░░░░░░░░░░░░░░ 32.4%
JavaScript 9 hrs 16 mins ██████▍░░░░░░░░░░░░░░ 30.8%
Other 5 hrs 10 mins ███▌░░░░░░░░░░░░░░░░░ 17.1%
TypeScript 3 hrs 33 mins ██▍░░░░░░░░░░░░░░░░░░ 11.8%
JSON 37 mins ▍░░░░░░░░░░░░░░░░░░░░ 2.0%
@wyattades
wyattades / firestoreUtils.js
Last active August 5, 2019 04:42
Firebase - Firestore Collection Utilities
/*
* Utility functions for mass updates to Firebase's firestore collections
* Methods: iterate, update, delete, copy
*/
/**
* @callback IterateCollectionCb
* @param {import('firebase-admin').firestore.DocumentSnapshot} doc
* @param {import('firebase-admin').firestore.WriteBatch} [batch]