Шпаргалка с командами Docker
git clone [email protected]:YandexPraktikum/first-project.git
(от англ. clone, «клон», «копия») — склонируй репозиторий с URL first-project.git
из аккаунта YandexPraktikum
на мой локальный компьютер.
git branch feature/the-finest-branch
(от англ. branch, «ветка») — создай ветку от текущей с названием feature/the-finest-branch
;
git checkout -b feature/the-finest-branch
— создай ветку feature/the-finest-branch
и сразу переключись на неё.
git branch
(от англ. branch, «ветка») — покажи, какие есть ветки в репозитории и в какой из них я нахожусь (текущая ветка будет отмечена символом *
);
This file contains hidden or 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 ( | |
"crypto/ed25519" | |
"crypto/rand" | |
"crypto/tls" | |
"crypto/x509" | |
"crypto/x509/pkix" | |
"fmt" | |
"math/big" |
This file contains hidden or 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 ( | |
"crypto/tls" | |
"crypto/x509" | |
"fmt" | |
"io" | |
"log" | |
) |
This file contains hidden or 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 ( | |
"context" | |
"flag" | |
"log" | |
"net" | |
"net/http" | |
"os" | |
"os/signal" |
This file contains hidden or 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
import os | |
import redis | |
def upload_questions_into_redis(text, redis_conn): | |
question, answer = None, None | |
counter = 1 | |
for contents in text: |
This file contains hidden or 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 ( | |
"bufio" | |
"bytes" | |
"fmt" | |
"io/ioutil" | |
"net/http" | |
"os" | |
"sync" |
This file contains hidden or 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
import argparse | |
from concurrent.futures import ThreadPoolExecutor, as_completed | |
import logging | |
import random | |
import sys | |
import requests | |
from fake_useragent import UserAgent | |
This file contains hidden or 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 ( | |
"errors" | |
"fmt" | |
"strconv" | |
"strings" | |
) | |
// CheckCommission проверяет значение комиссии. |
This file contains hidden or 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
while True: | |
try: | |
async with session.get(url, timeout=5) as response: | |
... | |
... | |
except asyncio.TimeoutError: | |
print('Timeout Error') | |
await asyncio.sleep(5) # можно подождать перед повторным запросом | |
continue | |
else: |
NewerOlder