Skip to content

Instantly share code, notes, and snippets.

View licatajustin's full-sized avatar

Justin Licata licatajustin

View GitHub Profile
@licatajustin
licatajustin / controller.rb
Last active November 10, 2020 16:40 — forked from itisjustlu/readme.md
Count sql queries in ActiveRecord, Rails
class SomeController
around_action :record_sql_queries
private
def record_sql_queries
ActiveRecord::Base.count_queries do
yield
end
end
@licatajustin
licatajustin / city-lights.terminal
Created June 26, 2018 01:25
City Lights - macOS Terminal theme
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>ANSIBlackColor</key>
<data>
YnBsaXN0MDDUAQIDBAUGKyxYJHZlcnNpb25YJG9iamVjdHNZJGFyY2hpdmVyVCR0b3AS
AAGGoKcHCBMZHSQoVSRudWxs1QkKCwwNDg8QERJcTlNDb21wb25lbnRzVU5TUkdCXE5T
Q29sb3JTcGFjZV8QEk5TQ3VzdG9tQ29sb3JTcGFjZVYkY2xhc3NPECgwLjIwNzg0MzEz
NzMgMC4yNDcwNTg4MjM1IDAuMjg2Mjc0NTA5OCAxTxAnMC4xNTc1NDY3NDM4IDAuMTg4
@licatajustin
licatajustin / .zshrc
Created August 15, 2016 18:32
Terminal -- open tabs in same directory
# Set Apple Terminal.app resume directory
if [[ $TERM_PROGRAM == "Apple_Terminal" ]] && [[ -z "$INSIDE_EMACS" ]] {
function chpwd {
local SEARCH=' '
local REPLACE='%20'
local PWD_URL="file://$HOSTNAME${PWD//$SEARCH/$REPLACE}"
printf '\e]7;%s\a' "$PWD_URL"
}
chpwd
class Contact < ActiveRecord::Base
after_create :send_email
private
def send_email
ContactMailer.contact_email(self).deliver
end
end