Skip to content

Instantly share code, notes, and snippets.

@kelso
kelso / template.rb
Last active August 25, 2024 11:55
How to generate Rails 7 app with Bootstrap 5 from template file
# Usage:
# rails new my_app -m template.rb
#
# or for existing app (inside an app folder):
# rails app:template LOCATION=../template.rb
# Gemfile
gem 'bootstrap', '~> 5.3.3'
gem 'sass-rails', '~> 6.0.0'
gem_group :development, :test do
@kelso
kelso / active-record-basics.md
Last active March 29, 2023 13:54
Active Record - sample project

Active Record - sample project

Step by step tutorial to create very simple Contacts listing.

1. Generate new project

Open Terminal and run:

mkdir ~/Code
@kelso
kelso / backup_photos.sh
Created August 7, 2024 09:06
My photos backup script
#!/bin/bash
# Function to perform each backup option
function backup_option() {
case $1 in
1)
rsync -aWh --delete --info=progress2 "/Users/sh/Pictures/Lightroom Catalogs/" "/Volumes/T7 Shield/Lightroom Catalog Backups (Do Not Edit Here)/"
;;
2)
rsync -aWh --delete --ignore-errors --info=progress2 "/Volumes/T7 Shield/" "/Volumes/8TB_WD_RED_1/T7 Shield/"