Skip to content

Instantly share code, notes, and snippets.

@Vostbur
Vostbur / README.md
Created December 16, 2022 17:03
Stepic. Golang. Work with json

Данная задача ориентирована на реальную работу с данными в формате JSON. Для решения мы будем использовать справочник ОКВЭД (Общероссийский классификатор видов экономической деятельности), который был размещен на web-портале data.gov.ru.

Необходимая вам информация о структуре данных содержится в файле structure-20190514T0000.json, а сами данные, которые вам потребуется декодировать, содержатся в файле data-20190514T0100.json. Файлы размещены в нашем репозитории на github.com.

Для того, чтобы показать, что вы действительно смогли декодировать документ вам необходимо в качестве ответа записать сумму полей global_id всех элементов, закодированных в преложенном файле.

@Vostbur
Vostbur / birthdays.csv
Created May 28, 2022 13:25
Birthday announcements Telegram bot
date person
28-05-1981 Person One
28-05-1981 Person Two
05-06-1980 Person Three
@Vostbur
Vostbur / gists_backup.py
Created March 13, 2022 08:12
Backup (clone) all your own gists
#!/usr/bin/env python -B
# pip install PyGithub
from github import Github
import pathlib
import json
import os
gists = []
@Vostbur
Vostbur / .vimrc
Created February 6, 2022 13:59
Vim configuration file for python
" включить подсветку синтаксиса
syntax enable
" показывать номера строк
set number
" установить tab равным 4 пробелам
set tabstop=4
" отступ при переходе на следующую строку при написании кода
@Vostbur
Vostbur / subclass_tree.py
Created December 9, 2021 07:53
Print subclass tree
def format_output(class_name, prefix, is_last):
left_simbol = "└" if is_last else "├"
return prefix + left_simbol + "───" + class_name
def print_subclass_tree(thisclass, prefix=""):
for count, subclass in enumerate(thisclass.__subclasses__(), start=1):
is_last = count == len(thisclass.__subclasses__())
print(format_output(subclass.__name__, prefix, is_last))
@Vostbur
Vostbur / parser_actors.py
Created January 20, 2021 09:48
Parser public bank with actors
import csv
import logging
import collections
import bs4
import requests
logging.basicConfig(level=logging.INFO)
logger = logging.getLogger('faces')
@Vostbur
Vostbur / main.go
Created September 11, 2020 17:18
control sequence of goroutines
package main
import (
"fmt"
"time"
)
func A(a, b chan struct{}) {
<-a
fmt.Println("exec A()")
@Vostbur
Vostbur / main.go
Created September 10, 2020 20:30
Perceptron without any external library
package main
import (
"fmt"
"math"
"math/rand"
)
/* The code does the same as Python code, but does not use an external library such as numpy
import numpy as np
@Vostbur
Vostbur / main.go
Last active September 7, 2020 18:31
Sort without sorting (fun)
package main
import (
"fmt"
"os"
"strconv"
"sync"
"time"
)
@Vostbur
Vostbur / whatchange.py
Created August 30, 2020 19:15
Checking and logging changes in the folder
import tkinter as tk
from tkinter import messagebox
from watchdog.observers import Observer
from watchdog.events import FileSystemEventHandler
from queue import Queue
import sys
import time
class CustomHandler(FileSystemEventHandler):