Skip to content

Instantly share code, notes, and snippets.

View topherhunt's full-sized avatar
🦕

Topher Hunt topherhunt

🦕
View GitHub Profile
@selvan
selvan / application.rb
Created June 15, 2012 10:18
Custom Log Formatting - Rails 3
logger = Logger.new(File.join( Rails.root, "log", "my_#{ Rails.env}.log"), 'daily')
logger.level = Logger::INFO
logger.formatter = proc do |severity, datetime, progname, msg|
"#{datetime.strftime("%B %d %H:%M:%S")} #{Socket.gethostname}, [#{$$}]:, #{severity} MY_WEBAPP, #{msg}\n"
end
tag_log = ActiveSupport::TaggedLogging.new(logger)
config.logger = tag_log
# above code will produce log in format as shown below,
@trey
trey / happy_git_on_osx.md
Last active February 18, 2024 10:46
Creating a Happy Git Environment on OS X

Creating a Happy Git Environment on OS X

Step 1: Install Git

brew install git bash-completion

Configure things:

git config --global user.name "Your Name"

git config --global user.email "you@example.com"