Skip to content

Instantly share code, notes, and snippets.

@drew2a
drew2a / text.md
Created March 16, 2025 10:45
Израильско-палестинский конфликт: исторический очерк

Израильско-палестинский конфликт: исторический очерк

Израильско-палестинский конфликт – один из самых длительных и сложных конфликтов современности, носящий одновременно политический, этнический и религиозный характер (Палестино-израильский конфликт — Википедия). Его предметом являются земли бывшей Подмандатной Палестины (территория между Средиземным морем и рекой Иордан), раздел которых после 1947 года оспаривается сторонами ([Палестино-израильский конфликт — Википедия](https://ru.wikipedia.org/wiki/%D0%9F%D0%B0%D0%BB%D0%B5%D1%81%D1%82%D0%B8%D0%BD%D0%BE-%D0%B8%D0%B7%D1%80%D0%B0%D0%B8%D0%BB%D1%8C%D1%81%D0%BA%D0%B8%D0%B9

@drew2a
drew2a / plot_number_of_contributors.py
Last active July 16, 2024 09:45
Plot contributors for repository history
from collections import defaultdict
from datetime import datetime, timedelta
import matplotlib.dates as mdates
import matplotlib.pyplot as plt
from git import Repo
from matplotlib.ticker import MaxNLocator
# Function to read and parse the .mailmap file
@drew2a
drew2a / fetch_issues_and_releases.py
Last active June 14, 2024 08:17
Fetch issues with 'type: bug' label and visualise them
import json
import requests
def fetch_github_data(repo, endpoint, params={}):
""" Fetch data from a GitHub repository endpoint. """
data = []
page = 1
base_url = f'https://api.github.com/repos/{repo}/{endpoint}'
@drew2a
drew2a / branch_age.py
Created November 22, 2023 11:29
Calculate a git branch age
import datetime
import subprocess
def run_git_command(command, repo_path):
return subprocess.check_output(command, cwd=repo_path, shell=True).decode('utf-8').strip()
# Repository path
repo_path = 'path/to/tribler/repo'
import sys
from elasticsearch import Elasticsearch
elastic_client = Elasticsearch('http://localhost:9200', request_timeout=120)
print('query:')
for line in sys.stdin:
query = {
"simple_query_string": {
import asyncio
import datetime
import logging
import math
import time
from pathlib import Path
from typing import Optional
from elastic_transport import TransportError
from elasticsearch import Elasticsearch
"""
Pydantic configuration BaseModels for IPv8.
If you want to see the available configuration options, print the schema as follows:
::
from json import dumps
print(dumps(format_schema_recursive(IPv8Configuration), indent=4))
@drew2a
drew2a / gist:a0a1123f9b976fe45df64ca0bb413de0
Created September 13, 2022 10:23
mergeGitRepositories.sh
#!/bin/bash
#
################################################################################
## Script to merge multiple git repositories into a new repository
## - The new repository will contain a folder for every merged repository
## - The script adds remotes for every project and then merges in every branch
## and tag. These are renamed to have the origin project name as a prefix
##
## Usage: mergeGitRepositories.sh <new_project> <my_repo_urls.lst>
## - where <new_project> is the name of the new project to create
@dataclass
class Ping:
...
@dataclass
class Pong:
...
import argparse
import asyncio
import logging
from pathlib import Path
from types import SimpleNamespace
import libtorrent
from pony.orm import db_session
from tribler_core.modules.libtorrent.torrentdef import TorrentDef