FridayHug.com http://fridayhug.com
The Smallest Rails App http://thesmallestrailsapp.com
%w(action_controller/railtie coderay).each &method(:require)| # This is a skeleton for testing models including examples of validations, callbacks, | |
| # scopes, instance & class methods, associations, and more. | |
| # Pick and choose what you want, as all models don't NEED to be tested at this depth. | |
| # | |
| # I'm always eager to hear new tips & suggestions as I'm still new to testing, | |
| # so if you have any, please share! | |
| # | |
| # This skeleton also assumes you're using the following gems: | |
| # | |
| # rspec-rails: https://github.com/rspec/rspec-rails |
| inputs = %w[ | |
| CollectionSelectInput | |
| DateTimeInput | |
| FileInput | |
| GroupedCollectionSelectInput | |
| NumericInput | |
| PasswordInput | |
| RangeInput | |
| StringInput | |
| TextInput |
| sum = ->(num_list) { num_list.reduce(:+) } | |
| square = ->(number ) { number * number } | |
| squares = ->(num_list) { num_list.map {|num| square.(num) } } | |
| sum_squares = ->(num_list) { sum.(squares.(num_list)) } | |
| square_sum = ->(num_list) { square.(sum.(num_list)) } | |
| gem 'minitest' | |
| require 'minitest/autorun' | |
| describe "sum_squares" do |
FridayHug.com http://fridayhug.com
The Smallest Rails App http://thesmallestrailsapp.com
%w(action_controller/railtie coderay).each &method(:require)| --- | |
| - :cod_uf: '52' | |
| :uf: Goiás | |
| :city_id: '00050' | |
| :city: Abadia de Goiás | |
| :sigla_uf: GO | |
| :city_code: '5200050' | |
| - :cod_uf: '31' | |
| :uf: Minas Gerais | |
| :city_id: '00104' |
| require 'rubygems' | |
| require 'aws-sdk' | |
| # This code snippet sends a push notification to a device using the Amazon SNS service. | |
| # | |
| # It is using the preview V2 amazon gem as per: | |
| # https://aws.amazon.com/sdk-for-ruby/ | |
| # | |
| # This was installed using: | |
| # $ gem install aws-sdk --pre |
| require 'omniauth-oauth2' | |
| # this OmniAuth-Strategy uses the Keyrock Identity Management | |
| # see http://catalogue.fiware.org/enablers/identity-management-keyrock | |
| # The server url is from the public FIWARE Lab instance. | |
| module OmniAuth | |
| module Strategies | |
| class FilabStrategy < OmniAuth::Strategies::OAuth2 | |
| option :name, "filab" | |
| option :client_options, { |
CloudFlare is an awesome reverse cache proxy and CDN that provides DNS, free HTTPS (TLS) support, best-in-class performance settings (gzip, SDCH, HTTP/2, sane Cache-Control and E-Tag headers, etc.), minification, etc.
| After automatically updating Postgres to 9.6.1 via Homebrew, the pg_ctl start command didn't work. | |
| The error was something like "database files are incompatible with server". | |
| Database files have to be updated before starting the server, here are the steps that had to be followed: | |
| # need to have both 9.6.1 and latest 9.5.x installed, and keep 9.6.1 as default | |
| brew unlink postgresql | |
| brew install postgresql95 | |
| brew unlink postgresql95 | |
| brew link postgresql |