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 Customer < ApplicationRecord | |
has_many :customer_documents | |
has_many :documents, through: :customer_documents | |
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
ab -t 180 -c 1 https://autorambler.ru/vne-dorog/chudesa-tekhniki-niva-na-gusenicakh.htm | |
This is ApacheBench, Version 2.3 <$Revision: 1796539 $> | |
Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/ | |
Licensed to The Apache Software Foundation, http://www.apache.org/ | |
Benchmarking autorambler.ru (be patient) | |
Finished 2036 requests | |
Server Software: nginx |
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
<?xml version="1.0" encoding="UTF-8"?> | |
<rss xmlns:yandex="http://news.yandex.ru" xmlns:media="http://search.yahoo.com/mrss/" version="2.0"> | |
<channel> | |
<title>RNS</title> | |
<link>https://stage.rns.online/</link> | |
<yandex:logo>https://rns.online/pics/logo100x100.png</yandex:logo> | |
<yandex:logo type="square">https://rns.online/pics/logo.png</yandex:logo> | |
<description>Первоисточник новостей о бизнесе и финансах.</description> | |
<yandex:analytics type="Yandex" id="32047971"/> | |
<yandex:adNetwork type="AdFox" turbo-ad-id="Content1_Turbo"> |
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
package main | |
import ( | |
"fmt" | |
"sync" | |
"time" | |
) | |
type Fetcher interface { | |
// Fetch returns the body of URL and |
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
swagger: '2.0' | |
info: | |
title: URL Shortener service API | |
description: Shorten your URL on the fly | |
version: "1.0.0" | |
host: shorty-url-shortener.herokuapp.com | |
schemes: | |
- http | |
basePath: / | |
consumes: |
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
# Convert human entered string into number | |
class StringDecoder | |
# Hash with powers of 10 by names | |
POWERS = { | |
'trillion' => 10**12, | |
'trillions' => 10**12, | |
'billion' => 10**9, | |
'billions' => 10**9, | |
'million' => 10**6, | |
'millions' => 10**6, |
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
require 'rails_helper' | |
RSpec.describe StringDecoder do | |
let(:decoder) { StringDecoder.new } | |
it 'decodes numeric string' do | |
input = '1231412353' | |
expect(decoder.call(input)).to equal(1231412353.0) | |
end |