Skip to content

Instantly share code, notes, and snippets.

View paderinandrey's full-sized avatar

Andrey Paderin paderinandrey

View GitHub Profile
@paderinandrey
paderinandrey / solution.rb
Created December 16, 2024 01:29
TH: ruby-c11y-hw1
# Генерация файлов для примера
files = 5.times.map do |i|
filename = "file_#{i}.txt"
File.open(filename, 'w') { |f| f.puts(Array.new(100_000) { "Line from #{filename}" }) }
filename
end
require 'parallel'
def process_files_with_parallel(files)
# frozen_string_literal: true
require 'rails_helper'
using TestProf::AnyFixture::DSL
describe 'Home' do
let(:scopes) { 'read:statuses' }
let_it_be(:bob) { Fabricate(:account) }
require 'debug'
target = ENV.fetch('TARGET', 'spec/requests')
run :event_prof, event: 'factory.create', top_count: 10, paths: target, rank_by: :time
total_run_time = report.raw_report['absolute_run_time']
total_event_time = report.raw_report['total_time']
threshold = 0.5 * total_run_time
# frozen_string_literal: true
require 'test_prof/recipes/rspec/any_fixture'
require 'test_prof/any_fixture/dsl'
using TestProf::AnyFixture::DSL
require 'test_prof/ext/active_record_refind'
using TestProf::Ext::ActiveRecordRefind
@paderinandrey
paderinandrey / starship.toml
Created November 19, 2022 17:52 — forked from nukopy/starship.toml
Nerd Font Symbols created by Starship. This is a Starship default config.
# Starship default config, extracted from the source
# Configure the format of the prompt
format = """\
$username\
$hostname\
$shlvl\
$singularity\
$kubernetes\
$directory\
<?xml version="1.0"?>
<clickhouse>
<clickhouse_remote_servers>
<local>
<shard>
<internal_replication>false</internal_replication>
<replica>
<host>64.225.65.90</host>
<port>9000</port>
</replica>
@paderinandrey
paderinandrey / 0003_metric.py
Last active January 4, 2022 20:56
Rebrain:Python Django
# Generated by Django 4.0 on 2022-01-04 00:43
from django.db import migrations, models
import django.db.models.deletion
import django.utils.timezone
class Migration(migrations.Migration):
dependencies = [
@paderinandrey
paderinandrey / api_client.py
Last active January 6, 2022 05:13
Rebrain:Python. Task-15
import requests
import os
import json
from logger import logging
class APIClient:
def __init__(self, server_addr):
self.server_addr = server_addr
self.hostname = "hostname"
@paderinandrey
paderinandrey / 0002_server_server_is_active.py
Last active January 2, 2022 18:28
Rebrain:Python. Task-14
# Generated by Django 4.0 on 2022-01-02 17:59
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('rbr_srv_side', '0001_initial'),
]
@paderinandrey
paderinandrey / ldeq.go
Created December 27, 2021 00:55
RDS-06
package main
import (
"context"
"fmt"
"os"
"strconv"
"github.com/go-redis/redis/v8"
)