Skip to content

Instantly share code, notes, and snippets.

@orlando
orlando / mac-setup.md
Last active November 6, 2026 01:40 — forked from todc/mac-setup.md
Fresh Mac OS Setup

Mac setup

Config lives in a private repo, orlando/dotfiles, applied with chezmoi (replaces mackup and iCloud). The app list lives in its Brewfile. Keep the username orlando so ~/www/<org>/<repo> paths match across machines.

1. Software Update

Update macOS and everything in the App Store.

require 'active_record'
require 'database_cleaner'
connection_info = YAML.load_file("config/database.yml")["test"]
ActiveRecord::Base.establish_connection(connection_info)
RSpec.configure do |config|
config.before(:suite) do
DatabaseCleaner.strategy = :transaction
DatabaseCleaner.clean_with(:truncation)
@orlando
orlando / activeadmin-cancan.rb
Created November 25, 2012 01:54
Deep integration of CanCan into ActiveAdmin
# blog post:
# Before using this initializer, you must set up Cancan. First, add the gem to your Gemfile:
#
# gem 'cancan'
#
# Next, generate and edit an Ability class:
#
# rails generate cancan:ability
#
@orlando
orlando / haml_converter.rb
Created July 22, 2011 04:38 — forked from radamant/haml_converter.rb
Simple haml-sass conversion for jekyll
module Jekyll
require 'haml'
class HamlConverter < Converter
safe true
priority :low
def matches(ext)
ext =~ /haml/i
end
@orlando
orlando / database.rb
Created June 28, 2011 19:08 — forked from jacquescrocker/database.rb
configures padrino to use config/mongoid.yml
# config/database.rb
config_file = Padrino.root("config", "mongoid.yml")
if File.exists?(config_file)
settings = YAML.load(ERB.new(File.read(config_file)).result)[Padrino.env.to_s]
::Mongoid.from_hash(settings) if settings.present?
end