- Josh Goebel (@yyyc514): suggested lazy evaluation on
set
This file contains hidden or 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
source "https://rubygems.org" | |
ruby "2.2.2" | |
gem "rails", "4.2.0" | |
group :development do | |
gem "foreman" | |
gem "guard-livereload", require: false | |
gem "rack-livereload" | |
end |
This file contains hidden or 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
Quando ocorrer esse erro: | |
altere: | |
# /etc/sysctl.conf | |
e acrescente as linhas: | |
net.ipv6.conf.all.disable_ipv6 = 1 | |
net.ipv6.conf.default.disable_ipv6 = 1 | |
net.ipv6.conf.lo.disable_ipv6 = 1 |
This file contains hidden or 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
Spree API Server Needs | |
- Easy Setup & Deployment (Dokku) | |
- New Relic | |
- Error Monitoring (Raven) | |
- Performance Monitoring (Skylight) | |
- Logging (Loggly or Logentries?) | |
- SSL (Dokku handles this) | |
- Database Backups (http://donpottinger.net/blog/2014/11/22/bye-bye-heroku-hello-dokku-part-2.html (See Clockwork section)) | |
- Caching (Memcached + Dalli) | |
- Worker (Sidekiq) |
This file contains hidden or 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
HTTP status code symbols for Rails | |
Thanks to Cody Fauser for this list of HTTP responce codes and their Ruby on Rails symbol mappings. | |
Status Code Symbol | |
1xx Informational | |
100 :continue | |
101 :switching_protocols | |
102 :processing |
#Goal Deploy your Rails App super easily with Dokku on Digital Ocean cheap cheap!
##Notes
- Follow 12 factor design (include the rails_12factor gem)
- Don't forget your
Procfile
with the command to start up your application server - I prefer using external hosted logging services like
Logentries
(not in this guide) - Set up performance monitoring
AppSignal
orNew Relic
(not in this guide)
This file contains hidden or 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
#login | |
curl -v -H "Accept: application/json" -H "Content-type: application/json" -X POST -d ' {"user":{"email":"<email>","password":"<passwd>"}}' http://localhost:3000/api/v1/sign_in.json | |
#logout | |
curl -v -H "Accept: application/json" -H "Content-type: application/json" -X DELETE http://localhost:3000/api/v1/sign_out.json?auth_token=<token> |
Magic words:
psql -U postgres
Some interesting flags (to see all, use -h
or --help
depending on your psql version):
-E
: will describe the underlaying queries of the\
commands (cool for learning!)-l
: psql will list all databases and then exit (useful if the user you connect with doesn't has a default database, like at AWS RDS)
This file contains hidden or 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
<?xml version="1.0" encoding="UTF-8"?> | |
<persistence xmlns="http://java.sun.com/xml/ns/persistence" | |
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | |
xsi:schemaLocation="http://java.sun.com/xml/ns/persistence | |
http://java.sun.com/xml/ns/persistence/persistence_1_0.xsd" | |
version="1.0"> | |
<!-- derby --> |