This file contains 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 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 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 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 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 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 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 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 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) |
This file contains 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
func limitConnections(handler func(w http.ResponseWriter, r *http.Request), max_connections int) func(w http.ResponseWriter, r *http. Request) { | |
connections := make(chan bool, max_connections) | |
for i := 0; i < max_connections; i++ { | |
connections <- true | |
} | |
return func(w http.ResponseWriter, r *http.Request) { | |
select { | |
case <-connections: |