Skip to content

Instantly share code, notes, and snippets.

View bejaneps's full-sized avatar

Bezhan Mukhidinov bejaneps

  • Outland Legends
  • Cyprus
View GitHub Profile
#include <iostream> //std::cout
#include <vector> //std::vector
#include <algorithm> //std::find
#include <ctime> //std::time
#include <random> //std::mt19937
#include <functional> //std::bind
// в задании не указано какой массив использовать и можно ли вообще использовать стандартные библиотеки C++ , так что для удобности и простоты я использую массив std::vector и алгоритм std::find
int same_elements_1(const std::vector<int> &, const std::vector<int> &);
package main
import (
"encoding/json"
"fmt"
"io/ioutil"
"testing"
)
type Response struct {
@bejaneps
bejaneps / websites.csv
Created August 28, 2020 18:09
List of top 1000 websites
1 fonts.googleapis.com 10
2 facebook.com 10
3 twitter.com 10
4 google.com 10
5 youtube.com 10
6 s.w.org 10
7 instagram.com 10
8 googletagmanager.com 10
9 linkedin.com 10
10 ajax.googleapis.com 10
[]fixture.RawMessage{
fixture.RawMessage{
Key:"1da698dc-568b-438d-abac-b63373acc6aa~~~d6a76684-f53b-491e-9e16-9f2ab51a952a",
Value:"^{"before":{.+}$",
Topic:"user-device-metadata-table"
},
fixture.RawMessage{
Key:"1da698dc-568b-438d-abac-b63373acc6aa~~~263098cb-75b9-4548-b60d-2814158f0422",
@bejaneps
bejaneps / main.go
Last active November 29, 2023 09:29
Graceful shutdown
package main
func main() {
cfg := config{}
if err := env.Parse(&cfg); err != nil {
log.Fatal(err.Error())
}
ctx, cancelFunc := context.WithCancel(context.Background())
ctx = log.ContextWithAttributes(ctx, log.Attributes{"serverPort": cfg.ServerPort})