Skip to content

Instantly share code, notes, and snippets.

View alex-quiterio's full-sized avatar
🌀
rise to see and not to be seen

aIex quiterio alex-quiterio

🌀
rise to see and not to be seen
View GitHub Profile
@alex-quiterio
alex-quiterio / mock.ts
Last active February 18, 2025 08:29
A generic mocking util function for your tests
type UnmockableTypes =
| Number
| Boolean
| String
| Symbol
| BigInt
| Date
| RegExp
| Generator;
@alex-quiterio
alex-quiterio / repo-manager.rb
Created February 7, 2025 20:22
Repository manager written in ruby
require 'fileutils'
require 'optparse'
class RepoSyncConfig
attr_reader :home_path, :code_path, :config_file_path, :command, :repo_url
def initialize
# Set defaults
@home_path = ENV['HOME']
@code_path = "#{@home_path}/code"
require 'fileutils'
# Define file type extensions
IMAGE_EXTENSIONS = %w[.jpg .jpeg .png .gif .bmp .tiff]
PDF_EXTENSIONS = %w[.pdf]
AUDIO_EXTENSIONS = %w[.mp3 .wav .ogg .aac .flac]
VIDEO_EXTENSIONS = %w[.mp4 .mkv .mov .avi .wmv]
ORIGIN_FOLDER = "/Users/alex-quiterio/Desktop/triage"
DESTINATION_FOLDERS = {
@alex-quiterio
alex-quiterio / dump_stream_config_failed_queue.sh
Created October 16, 2023 09:07
dump_stream_config_failed_queue.sh
export PORT=9001
export FILE_NAME=new_dump.txt
function get_redis_data() {
KEY_NAME=$1
configID=$(echo HGET $KEY_NAME data | redis-cli -p $PORT | jq '.streamConfigurationId')
configFailedReason=$(echo "HGET $KEY_NAME failedReason" | redis-cli -p $PORT)
echo "===================" >> $FILE_NAME
echo "configId: $configID\nFailedReason:$configFailedReason" >> $FILE_NAME
@alex-quiterio
alex-quiterio / waste-saver-patch-stream-configurations-v2.md
Last active October 21, 2022 14:02
Waste Saver: Patch Waste Stream Configuration

WasteSaver Audit: Update StreamConfiguration endpoint

  • OLD ENDPOINT: PUT /api/store/locations/:org_location_id/streams/:uuid
  • NEW ENDPOINT: PATCH /api/store/locations/:org_location_id/waste-stream-configurations/:uuid

Request payload proposal:

{
  "quantity": 1,

WasteSaver Audit: Create - StreamConfiguration endpoint

  • OLD ENDPOINT: POST /api/store/locations/:org_location_id/streams
  • NEW ENDPOINT: POST /api/store/locations/:org_location_id/waste-stream-configurations

Request payload proposal:

[
  {
@alex-quiterio
alex-quiterio / waste-saver-stream-configurations-v2.md
Last active October 21, 2022 14:03
WasteSaver Audit: Stream Configurations endpoint

WasteSaver Audit: Index - StreamConfiguration endpoint:

  • OLD ENDPOINT: GET /api/store/locations/:org_location_id/streams
  • NEW ENDPOINT: GET /api/store/locations/:org_location_id/waste-stream-configurations

Payload proposal:

{
  "waste_stream_configurations": [
    {
@alex-quiterio
alex-quiterio / postgres-cheatsheet.md
Created May 31, 2022 08:10 — forked from Kartones/postgres-cheatsheet.md
PostgreSQL command line cheatsheet

PSQL

Magic words:

psql -U postgres

Some interesting flags (to see all, use -h or --help depending on your psql version):

  • -E: will describe the underlaying queries of the \ commands (cool for learning!)
  • -l: psql will list all databases and then exit (useful if the user you connect with doesn't has a default database, like at AWS RDS)
@alex-quiterio
alex-quiterio / ecs-run
Created July 15, 2021 05:33 — forked from vcastellm/ecs-run
Run task and wait for result in AWS ECS
#!/usr/bin/env bash
set -e
function usage() {
set -e
cat <<EOM
##### ecs-run #####
Simple script for running tasks on Amazon Elastic Container Service
One of the following is required:
Required arguments:
@alex-quiterio
alex-quiterio / mysql.database.yml
Created April 24, 2021 17:56 — forked from jwo/mysql.database.yml
Sample config/database.yml from Rails. Postgres, MySQL, and SQLite
#
# Install the MYSQL driver
# gem install mysql2
#
# Ensure the MySQL gem is defined in your Gemfile
# gem 'mysql2'
#
# And be sure to use new-style password hashing:
# http://dev.mysql.com/doc/refman/5.0/en/old-client.html
development: