Skip to content

Instantly share code, notes, and snippets.

@ov7a
ov7a / close_upsource_reviews.py
Created July 20, 2020 07:39
Batch close upsource reviews
import requests
import argparse
REVIEWS_LIST_PATH = "{host}/~rpc/getReviews"
CLOSE_REVIEW_PATH = "{host}/~rpc/closeReview"
REVIEWS_REQUEST = "(state: open) and (accepted-by: 1 or (not (updated: {this month})))"
def parse_args():
@ov7a
ov7a / get_branches_jira_status.py
Created August 6, 2020 10:47
Print related jira issue status for each branch in git repo to find branches which can be closed
import argparse
import subprocess
from jira import JIRA
from getpass import getpass
import requests
EXCLUDE_BRANCHES = {"master", "develop"}
COMMON_BRANCH_PREFIX = "feature/"
COMMON_BRANCH_SUFFIX = "-epic"
HEADS_PREFIX = "refs/heads/"
@ov7a
ov7a / buenos_aires.py
Created November 28, 2020 16:40
Simple check of Buenos Aires Constant (aka prime generating constant)
import math
import sys
BAC = 2.920050977316134
def primes_BAC():
item = BAC
while True:
next_prime = int(math.floor(item))
yield next_prime
@ov7a
ov7a / pom.xml
Created October 23, 2021 10:57
Integrating bpmnlint with maven
<plugin>
<groupId>com.github.eirslett</groupId>
<artifactId>frontend-maven-plugin</artifactId>
<version>1.12.0</version>
<executions>
<execution>
<id>install node and npm</id>
<goals>
<goal>install-node-and-npm</goal>
</goals>
import fileinput
import z3
import sys
def solve(sizes, prices, capacity):
coeffs = list()
solver = z3.Optimize()
price = 0
weight = 0
@ov7a
ov7a / Main.java
Last active June 7, 2023 14:16
WalkTree link visiting
package org.example;
import java.io.IOException;
import java.nio.file.*;
import java.nio.file.attribute.BasicFileAttributes;
import java.util.EnumSet;
public class Main {
public static void main(String[] args) {
Path rootDir;
@ov7a
ov7a / App.java
Created October 17, 2023 21:18
Java folder creating utf inconsistency
package test;
import java.io.File;
import java.io.IOException;
import java.nio.file.Files;
import java.nio.file.Path;
import java.util.concurrent.Callable;
import java.util.function.Consumer;
import java.util.function.Function;