Skip to content

Instantly share code, notes, and snippets.

View ronnycoding's full-sized avatar
🇻🇪
The only way to do great work is to love what you do.

Ronny Freites ronnycoding

🇻🇪
The only way to do great work is to love what you do.
View GitHub Profile
@ronnycoding
ronnycoding / google_drive_backup.py
Last active May 25, 2025 21:12
🚀 Google Drive Backup Script 🗂️✨
#!/usr/bin/env python3
"""
Google Drive Backup Script
Downloads and backs up files from a shared Google Drive or My Drive folder to local storage.
"""
import os
import io
import json
from pathlib import Path
@ronnycoding
ronnycoding / icloud_backup.py
Last active May 21, 2025 23:40
📸 iCloud Photo Backup & Cleanup Script A Python utility that securely logs into your iCloud account (with 2FA), downloads your entire photo library into a structured year/month folder hierarchy, and automatically deletes each photo from iCloud after a successful backup — freeing up space while keeping your memories safe. Built with pyicloud, pat…
from pyicloud import PyiCloudService
from pathlib import Path
from datetime import datetime
from getpass import getpass
# Backup destination, update the url path to point to your backup volume
backup_root = Path("/Volumes/MYDISK/folder")
# iCloud login
username = input("Enter your iCloud username/email: ")
@ronnycoding
ronnycoding / remove-cache-from-mac.sh
Last active September 20, 2024 22:16
Dynamic Mac Cache Cleanup Script
#!/bin/bash
# Function to get list of installed applications
get_installed_apps() {
find /Applications -maxdepth 1 -name "*.app" -print0 | xargs -0 -n1 basename | sed 's/\.app$//' | tr '[:upper:]' '[:lower:]'
find ~/Applications -maxdepth 1 -name "*.app" -print0 2>/dev/null | xargs -0 -n1 basename | sed 's/\.app$//' | tr '[:upper:]' '[:lower:]'
}
# Get list of installed apps
INSTALLED_APPS=($(get_installed_apps))
@ronnycoding
ronnycoding / tmux-cheat-sheet.md
Created December 31, 2021 16:19 — forked from michaellihs/tmux-cheat-sheet.md
tmux Cheat Sheet
@ronnycoding
ronnycoding / Link-usage.js
Created August 31, 2021 00:39 — forked from aweber1/Link-usage.js
Next.js custom routes with regex + Server support + Client-side routing
@ronnycoding
ronnycoding / post-merge
Created August 13, 2021 03:56 — forked from sindresorhus/post-merge
git hook to run a command after `git pull` if a specified file was changed.In this example it's used to run `npm install` if package.json changed and `bower install` if `bower.json` changed.Run `chmod +x post-merge` to make it executable then put it into `.git/hooks/`.
#!/usr/bin/env bash
# MIT © Sindre Sorhus - sindresorhus.com
# git hook to run a command after `git pull` if a specified file was changed
# Run `chmod +x post-merge` to make it executable then put it into `.git/hooks/`.
changed_files="$(git diff-tree -r --name-only --no-commit-id ORIG_HEAD HEAD)"
check_run() {
echo "$changed_files" | grep --quiet "$1" && eval "$2"
@ronnycoding
ronnycoding / RequestService.ts
Last active July 23, 2021 18:43
OOP - Request Service
import axios, { AxiosStatic, AxiosResponse } from 'axios';
interface IJson {
[key: string]: string | IJson;
}
/**
* Internal types
*/
@ronnycoding
ronnycoding / strapi-docker-compose.yml
Created July 17, 2021 20:28
Strapi docker compose
version: "3.1"
services:
strapi:
image: strapi/strapi
volumes:
- ./swap-backend:/srv/app
- /srv/app/node_modules
ports:
- 1337:1337
@ronnycoding
ronnycoding / ControlProps4.js
Created July 9, 2021 05:01
React Patterns
// Control Props
// 💯 don't warn in production
import * as React from 'react'
import warning from 'warning'
import {Switch} from '../switch'
const callAll = (...fns) => (...args) => fns.forEach(fn => fn?.(...args))
const actionTypes = {