FridayHug.com http://fridayhug.com
The Smallest Rails App http://thesmallestrailsapp.com
%w(action_controller/railtie coderay).each &method(:require)FridayHug.com http://fridayhug.com
The Smallest Rails App http://thesmallestrailsapp.com
%w(action_controller/railtie coderay).each &method(:require)| OpenSSL::SSL::SSLError: SSL_connect returned=1 errno=0 state=SSLv3 read server certificate B: certificate verify failed |
| # I'm no benchmark guru. Just did a bunch of: | |
| $ time ruby <filename> | |
| # Note: This is just an 80mb XML file with 38,000 nodes. | |
| ox_dom.rb 4.56s user 0.78s system 93% cpu 5.714 total (550mb) | |
| ox_dom.rb 4.58s user 0.79s system 87% cpu 6.126 total (550mb) | |
| ox_dom.rb 4.60s user 0.80s system 87% cpu 6.140 total (550mb) | |
| nokigiri_dom.rb 11.75s user 1.02s system 94% cpu 13.518 total (895mb) | |
| nokigiri_dom.rb 11.36s user 1.02s system 93% cpu 13.211 total (895mb) |
| set :stages, %w(production staging) #various environments | |
| load "deploy/assets" #precompile all the css, js and images... before deployment.. | |
| require "bundler/capistrano" # install all the new missing plugins... | |
| require 'capistrano/ext/multistage' # deploy on all the servers.. | |
| require "rvm/capistrano" # if you are using rvm on your server.. | |
| require './config/boot' | |
| require 'delayed/recipes' # load this for delayed job.. | |
| require "whenever/capistrano" | |
| require './config/boot' | |
| require 'airbrake/capistrano' |
| # Nginx+Unicorn best-practices congifuration guide. Now with SPDY! | |
| # We use latest stable nginx with fresh **openssl**, **zlib** and **pcre** dependencies. | |
| # Some extra handy modules to use: --with-http_stub_status_module --with-http_gzip_static_module | |
| # | |
| # Deployment structure | |
| # | |
| # SERVER: | |
| # /etc/init.d/nginx (1. nginx) | |
| # /home/app/public_html/app_production/current (Capistrano directory) | |
| # |
| require 'mina/bundler' | |
| require 'mina/rails' | |
| require 'mina/git' | |
| require 'mina/rvm' | |
| # Usually mina focuses on deploying to one host and the deploy options are therefore simple. | |
| # In our case, there is a number of possible servers to deploy to, it is therefore necessary to | |
| # specify the host that we are targeting. | |
| server = ENV['server'] | |
| # Since the same host can have multiple applications running in parallel, it is necessary to |
| # A sample Gemfile | |
| source 'https://rubygems.org' | |
| gem 'aws-sdk' | |
| gem 'pit' |
| ./bin/runscala.sh -DskipErrors com.wordnik.swagger.codegen.BasicRubyGenerator http://churn.picoappz.com/api-docs "key" | |
| base path is http://churn.picoappz.com/api-docs | |
| ********* Failed to read swagger json! | |
| Error: Operation - responseClass | missing required field | |
| **** ignoring errors and continuing | |
| swagger version: 1.2 | |
| basePath: | |
| api version: 1.0 | |
| missing models: Set() | |
| ---------- |
| module PostRepresenter | |
| include Representer | |
| using Representer | |
| def basic(post) | |
| select(post, :id, :name) | |
| end | |
| def details(post) | |
| basic(post) & comments(post) |
| ### Install Oracle Java 8, this means you agree to their binary license!! | |
| cd ~ | |
| sudo add-apt-repository -y ppa:webupd8team/java | |
| sudo apt-get update | |
| echo debconf shared/accepted-oracle-license-v1-1 select true | sudo debconf-set-selections | |
| echo debconf shared/accepted-oracle-license-v1-1 seen true | sudo debconf-set-selections | |
| sudo aptitude -y install oracle-java8-installer | |
| ### Download and Install ElasticSearch |