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
| User.limit(2).as_json | |
| # User Load (2.0ms) SELECT "users".* FROM "users" LIMIT ? [["LIMIT", 2]] | |
| #=> [{"id"=>1, "name"=>"Анна Терентьева", "created_at"=>Wed, 23 Jan 2019 21:47:37 UTC +00:00, "updated_at"=>Wed, 23 Jan 2019 21:47:37 UTC +00:00, "photo_url"=>nil, "nickname"=>nil, "first_name"=>nil, "last_name"=>nil, "about"=>nil, "birthday"=>nil}, {"id"=>2, "name"=>"Абрамова София", "created_at"=>Wed, 23 Jan 2019 21:47:38 UTC +00:00, "updated_at"=>Wed, 23 Jan 2019 21:47:38 UTC +00:00, "photo_url"=>nil, "nickname"=>nil, "first_name"=>nil, "last_name"=>nil, "about"=>nil, "birthday"=>nil}] | |
| User.select(:id, :name).limit(2).as_json | |
| # User Load (1.4ms) SELECT "users"."id", "users"."name" FROM "users" LIMIT ? [["LIMIT", 2]] | |
| #=> [{"id"=>2, "name"=>"Абрамова София"}, {"id"=>20, "name"=>"Ангелина Нестерова"}] | |
| User.select(:id, :name).where('start_at > ?', Time.now).limit(2).as_json |
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
| sudo: required | |
| notifications: | |
| email: false | |
| language: node_js | |
| node_js: | |
| - "10" | |
| cache: |
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
| sudo: required | |
| notifications: | |
| email: false | |
| language: node_js | |
| node_js: | |
| - "10" | |
| cache: |
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 Server | |
| 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
| <p class="tiny"><img src="https://recommendations764305033.files.wordpress.com/2018/03/russianpulse-ru.jpg?w=1100" alt="russianpulse.ru" class="img-responsive center-block"></p> | |
| <p>Ни для кого не секрет, что доход от природных ископаемых составляет львиную долю вливаний в российский госбюджет. Не первый год эксперты и аналитики обеспокоены тем, что будет с экономикой после того, когда запасы нефти иссякнут, а произойдет это уже в ближайшем будущем. Считается, что добыча черного золота начнет падать уже в 2020 году, потому экономистам следует задуматься о развитии других сфер — <span class="caps">IT</span>-технологий, промышленности, внутреннего туризма с <a href="https://otdyh.onlinetours.ru/russia" target="_blank">https://otdyh.onlinetours.ru/russia</a>.</p> | |
| <h2>Эпохальный 44 год повторится</h2> | |
| <p>Глава Минприроды Сергей Донской сообщил, что в недрах российской земли осталось около 200 миллиардов баррелей нефти, которой хватит приблизительно до 2073 года, если добыча и производство останутся на пр |
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
| # gem 'roar-rails' | |
| # gem 'roar-jsonapi' | |
| class V2::BasePresenter | |
| include ActiveModel::Validations | |
| # Десериализация из JSON | |
| # @return [V2::BasePresenter] | |
| def self.from_json(json) |
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
| alias ga='git add' | |
| alias gl='git log' | |
| alias gb='git branch' | |
| alias gco='git checkout' | |
| alias gd='git diff' | |
| alias s='gs' | |
| alias a='ga' | |
| alias c='gc' | |
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
| concurrent = 20 | |
| check_interval = 0 | |
| [[runners]] | |
| name = "gitlab-runner-master" | |
| url = "https://gitlab.sourcelab.technology" | |
| token = "aaabbbccc123" | |
| executor = "docker+machine" | |
| limit = 20 | |
| [runners.docker] |
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
| def generate_hashes_data(n) | |
| arr = [] | |
| n.times do |i| | |
| arr << { id: i, name: "John Smith #{n}" } | |
| end | |
| arr | |
| 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
| import "github.com/beefsack/go-rate" | |
| func limitRate(handler func(w http.ResponseWriter, r *http.Request), max_requests int, period time.Duration) func(w http.ResponseWriter, r * http.Request) { | |
| rl := rate.New(max_requests, period) | |
| return func(w http.ResponseWriter, r *http.Request) { | |
| ok, _ := rl.Try() | |
| if ok { | |
| handler(w, r) |