Skip to content

Instantly share code, notes, and snippets.

View 9seconds's full-sized avatar
💭
I can't actively participate because of family reasons

Sergey Arkhipov 9seconds

💭
I can't actively participate because of family reasons
View GitHub Profile
@9seconds
9seconds / example.py
Created May 21, 2024 07:29
Concatenation
import timeit
import string
SAMPLE = """
[
{
"url": "https://api.github.com/repos/octocat/Hello-World/releases/1",
"html_url": "https://github.com/octocat/Hello-World/releases/v1.0.0",
"assets_url": "https://api.github.com/repos/octocat/Hello-World/releases/1/assets",

Keybase proof

I hereby claim:

  • I am 9seconds on github.
  • I am 9seconds (https://keybase.io/9seconds) on keybase.
  • I have a public key ASBiWuv5KuJMZGUtR7jY0Mzrb4mhajMYZdED6paQCGC7Swo

To claim this, I am signing this object:

@9seconds
9seconds / wgeasy_migrate.py
Created October 13, 2022 09:06
Migrate from https://www.linuxserver.io/ WireGuard to WGEasy
#!/usr/bin/env python
import argparse
import datetime
import ipaddress
import json
import pathlib
import sys
import uuid
@9seconds
9seconds / comparators.py
Last active November 20, 2020 14:09
Example of inlined datetime comparators
import enum
import datetime
import pydantic
class Comparator(enum.Enum):
LT = "<"
GT = ">"
EQ = "="
@9seconds
9seconds / coins.py
Created December 28, 2018 12:17
Coins task solution
#!/usr/bin/env python3
import sys
import itertools
COINS = [1, 5, 10, 50, 100, 200, 500, 1000, 2500]
CACHE = {}
def change_number(money):
@9seconds
9seconds / coins.txt
Created December 16, 2018 09:26
Dojo tasks
В России есть такие монеты:
- 1 копейка
- 5 копеек
- 10 копеек
- 50 копеек
- 1 рубль
- 2 рубля
- 5 рублей
- 10 рублей
- 25 рублей
@9seconds
9seconds / curl.py
Created February 26, 2018 14:07
pycurl http2
import io
import pycurl
curl = pycurl.Curl()
curl.setopt(curl.URL, "https://nghttp2.org")
curl.setopt(pycurl.HTTP_VERSION, pycurl.CURL_HTTP_VERSION_2_0)
curl.setopt(pycurl.VERBOSE, 1)
@9seconds
9seconds / example-log.py
Created September 12, 2017 09:49
log.py example
# -*- coding: utf-8 -*-
# vim: set et sw=4 ts=4:
import logging
import logging.config
import flask
@9seconds
9seconds / ranntsbuilder.py
Created April 28, 2017 14:39
Script which builds rannts website
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
# vim: set ft=python:
import argparse
import contextlib
import json
import logging
import os
@9seconds
9seconds / ranntsbuilder.yaml
Last active April 28, 2017 14:30
Script used to build rannts website on remote machines
---
# vim: set ft=ansible:
# Mandatory: copy_back - drectory path without trailing slash
# commit_hash - commit to work with
- hosts: all
become: true
gather_facts: false