Notes from CodeSchool's "Sequel to SQL"
Some commonly used aggregate functions are: min, max, avg, sum, and count.
Examples:
| module Decorator | |
| def initialize(component) | |
| @component = component | |
| end | |
| def method_missing(meth, *args) | |
| if @component.respond_to?(meth) | |
| @component.send(meth, *args) | |
| else | |
| super |
| heroku pg:reset DATABASE_URL --remote heroku-dev | |
| heroku run rake db:migrate --remote heroku-dev | |
| heroku run bash --remote heroku-dev | |
| bundle install --with development | |
| rake db:seed_fu RAILS_ENV=development |
| This is an interesting post about api messages and status codes, with examples from top apis: http://apigee.com/about/blog/technology/restful-api-design-what-about-errors | |
| The TL;DR is that only about 8 status codes should be used as a maximum, and they should be used accurately to describe the error obviously. | |
| These 8 statuses are: | |
| 200 - OK | |
| 404 - Not Found | |
| 500 - Internal Server Error | |
| 201 - Created |
Without this config update bundler will raise errors, it's a weird default they use (see this issue):
bundle config disable_local_branch_check true
The add the config for the gem to make bundler look to the path you specify rather than where it has downloaded the gem too, as source:
bundle config local.YOUR_GEM_NAME YOUR_GEMS_PATH
| $spacer: 1rem !default; | |
| $spacer-x: $spacer !default; | |
| $spacer-y: $spacer !default; | |
| $spacers: ( | |
| 0: ( | |
| x: 0, | |
| y: 0 | |
| ), | |
| half: ( | |
| x: ($spacer-x * 0.5), |
Some queries can contain other queries (bool), some can contain filters (constant_score), and others can contain both (filtered).
| rails generate react_on_rails:install --redux --server-rendering --ruby-linters --heroku-deployment --skip-bootstrap |
RSpec.configure do |config|
config.before(:each, type: :controller) do |example|
unless example.metadata[:skip_login_mock]
allow_any_instance_of(ApiController).to receive(:restrict_access)
.and_return(true)
end
end
end