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
| # coding: utf-8 | |
| ClassCountry.create(name: "АФГАНИСТАН", full_name: "Переходное Исламское Государство Афганистан", number_code: "004", alfa2: "AF", alfa3: "AFG") | |
| ClassCountry.create(name: "АЛБАНИЯ", full_name: "Республика Албания", number_code: "008", alfa2: "AL", alfa3: "ALB") | |
| ClassCountry.create(name: "АНТАРКТИДА", full_name: nil, number_code: "010", alfa2: "AQ", alfa3: "ATA") | |
| ClassCountry.create(name: "АЛЖИР", full_name: "Алжирская Народная Демократическая Республика", number_code: "012", alfa2: "DZ", alfa3: "DZA") | |
| ClassCountry.create(name: "АМЕРИКАНСКОЕ САМОА", full_name: nil, number_code: "016", alfa2: "AS", alfa3: "ASM") | |
| ClassCountry.create(name: "АНДОРРА", full_name: "Княжество Андорра", number_code: "020", alfa2: "AD", alfa3: "AND") | |
| ClassCountry.create(name: "АНГОЛА", full_name: "Республика Ангола", number_code: "024", alfa2: "AO", alfa3: "AGO") | |
| ClassCountry.create(name: "АНТИГУА И БАРБУДА", full_name: nil, number_code: "028", alfa2: "AG", alfa3: "ATG") |
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
| class PostsController < ApplicationController | |
| # GET /posts | |
| # GET /posts.json | |
| def index | |
| @posts = Post.all | |
| respond_to do |format| | |
| format.html # index.html.erb | |
| format.json { render json: @posts } | |
| end |
###Бенчмарки Машина: Маc ОС Х 10.7.5, 2Ghz Core2Duo, 8Gb RAM
Тестировал средний проект командой:
time bundle exec rake routes
| Ruby version | Time |
|---|---|
| ruby-1.9.3-p125 | 11.85s |
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
| require 'digest/md5' | |
| require 'benchmark' | |
| parts = [] | |
| body = ['Hello World'] | |
| Benchmark.bm do |x| | |
| x.report('each') do | |
| body.each { |part| parts << part } | |
| Digest::MD5.hexdigest(parts.join) |
##Procfile:
- web: bundle exec thin -R config.ru start -p $PORT -e $RACK_ENV
- web: bundle exec unicorn -p $PORT -c ./config/unicorn.rb
- web: bundle exec puma -t 1:4 -b tcp://0.0.0.0:$PORT
##Benchmarks:
~ siege -c500 -t30s www.aijaberjoza.lv
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
| 1. problemu risinasana, ieteikumi | |
| 2. tikai lv valoda | |
| 3. ruby related | |
| 4. katrs var pievienot, bet pec pievienosanas jaunajam vajag par sevi nedaudz pastastit | |
| 5. ja specifisks, tad uz privato |
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
| lv: | |
| views: | |
| pagination: | |
| first: '« pirmā' | |
| last: 'pēdējā »' | |
| previous: '‹ iepriekšējā' | |
| next: 'nākamā ›' | |
| truncate: '...' | |
| en: |
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
| buildscript { | |
| repositories { | |
| mavenCentral() | |
| } | |
| dependencies { | |
| classpath 'com.android.tools.build:gradle:0.5.+' | |
| } | |
| } |
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
| buildscript { | |
| repositories { | |
| mavenCentral() | |
| } | |
| dependencies { | |
| classpath 'com.android.tools.build:gradle:0.5.+' | |
| } | |
| } | |
| apply plugin: 'android-library' |