Skip to content

Instantly share code, notes, and snippets.

@gaikaz
gaikaz / mass_git_clone.sh
Last active September 22, 2022 21:11
Clone multiple repositories at once using Github CLI
#!/bin/bash
# Info
b=$(tput bold)
n=$(tput sgr0)
help="Clones all repositories from Github of a given owner
\nchecking out specific branch and optionally filtering by a topic.
\n\n${b}Requires Github CLI (https://cli.github.com) to be installed!${n}
\n\n${b}USAGE${n}\n $0 [-h] -o OWNER -b BRANCH -t TOPIC -d DIR\n"
@gaikaz
gaikaz / codecov_update_branch.sh
Created October 22, 2021 22:21
Updates the default branch on all repositories on Codecov using the API
#!/bin/bash
# !! Script depends on jq !!
# https://stedolan.github.io/jq/
# Updates the default branch on all repositories on Codecov using the API (v4.6)
# https://docs.codecov.com/reference/authorization
token=xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx # Your API token here
platform=gh # { gh - Github | gl - Gitlab | bb - Bitbucket }
@gaikaz
gaikaz / cursor_rollbacks.py
Last active January 15, 2021 12:29
Odoo request transaction logic example
# PSQL DB cursor mock
class Cursor:
def __init__(self):
print('cursor: BEGIN')
def commit(self):
print('cursor: COMMIT')
def rollback(self):
print('cursor: ROLLBACK')
def close(self):
print('cursor: CLOSE')