class Person < ActiveRecord::Base
has_one :address, :as => :addressable
end
class Company < ActiveRecord::Base
has_one :address, :as => :addressable
end
class Address < ActiveRecord::Base
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export $(grep -v "^#" .env | xargs) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* File ~/.config/gtk-3.0/gtk.css */ | |
.titlebar { | |
color:white; | |
} | |
.titlebar:backdrop { | |
background: #333; | |
color:#666; | |
} |
The goal of this cheatsheet is to make it easy to add hand-rolled authentication to any rails app in a series of layers.
First the simplest/core layers, then optional layers depending on which features/functionality you want.
Specs |
|
---|---|
AUTHOR | Ira Herman |
LANGUAGE/STACK | Ruby on Rails Version 4 or 5 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
docker run --name $@ \ | |
-d \ | |
-e POSTGRES_PASSWORD=postgres \ | |
-e POSTGRES_USER=postgres \ | |
-v $(pwd)/database:/var/lib/postgresql/data \ | |
-p 5432:5432 \ | |
postgres:11 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
tell application "Microsoft Outlook" | |
set background autodiscover of exchange account "ACCOUNT_NAME" to false | |
end tell |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Check for Hardware, GCC, Kernel | |
lspci | grep -i nvidia | |
gcc --version | |
uname -r | |
sudo apt-get install linux-headers-$(uname -r) | |
# Install Docker CE | |
sudo apt-get install apt-transport-https ca-certificates curl software-properties-common |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
default: &default | |
adapter: postgresql | |
encoding: unicode | |
# For details on connection pooling, see Rails configuration guide | |
# http://guides.rubyonrails.org/configuring.html#database-pooling | |
pool: <%= ENV.fetch("RAILS_MAX_THREADS") { 5 } %> | |
username: <%= ENV.fetch("DB_USER") { "postgres" } %> | |
password: <%= ENV.fetch("DB_PASSWORD") { "postgres" } %> | |
host: <%= ENV.fetch("DB_HOST") { "localhost" } %> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Rails: | |
Enabled: true | |
AllCops: | |
TargetRubyVersion: 2.5 | |
Exclude: | |
- bin/* | |
- Gemfile | |
- vendor/**/* | |
- node_modules/**/* | |
- db/schema.rb |
# config/application.rb
# Generators
config.generators do |g|
g.test_framework(false)
g.stylesheets(false)
g.javascripts(false)
g.helper(false)
g.channel(assets: false)
OlderNewer