Skip to content

Instantly share code, notes, and snippets.

View lewkoo's full-sized avatar

Levko Ivanchuk lewkoo

View GitHub Profile
@lewkoo
lewkoo / determine-cuda-verion.sh
Created March 9, 2023 15:08
Scripts determines the currently installed CUDA version
#!/bin/bash
# Determine CUDA installation
if nvcc --version 2&> /dev/null; then
# Determine CUDA version using default nvcc binary
CUDA_VERSION=$(nvcc --version | sed -n 's/^.*release \([0-9]\+\.[0-9]\+\).*$/\1/p');
elif /usr/local/cuda/bin/nvcc --version 2&> /dev/null; then
# Determine CUDA version using /usr/local/cuda/bin/nvcc binary
CUDA_VERSION=$(/usr/local/cuda/bin/nvcc --version | sed -n 's/^.*release \([0-9]\+\.[0-9]\+\).*$/\1/p');
@lewkoo
lewkoo / example.editorconfig
Created November 22, 2022 09:44
PyCharm editorconfig
[*]
charset = utf-8
end_of_line = lf
indent_size = 4
indent_style = space
insert_final_newline = false
max_line_length = 120
tab_width = 4
ij_continuation_indent_size = 8
ij_formatter_off_tag = @formatter:off
@lewkoo
lewkoo / Coverage Badges
Created November 30, 2021 10:47
Coverage Badges
Coverage Badges
@lewkoo
lewkoo / expand-intents.js
Created November 18, 2021 08:28
Expand all follow-up intents on Dialogflow Web UI
document.querySelectorAll('[class^="md-icon-button exist-follow-up ico-item md-button md-ink-ripple"]').forEach(element => {element.click();})

Keybase proof

I hereby claim:

  • I am lewkoo on github.
  • I am lewkoo (https://keybase.io/lewkoo) on keybase.
  • I have a public key whose fingerprint is FB21 D86F D40C BE2B 42AB 5BEE FF7E 2F5B 2137 632F

To claim this, I am signing this object:

@lewkoo
lewkoo / remove_remote_tags.sh
Created July 10, 2020 07:10
Remove tags from remote repo that match a certain pattern
#!/bin/bash
tag_names=""
git ls-remote --tags --refs origin |
{
while read old_t; do
tag_names+=":refs/tags/${old_t##*refs/tags/} "
done
git push origin $tag_names
}
@lewkoo
lewkoo / rename_tags.sh
Created July 10, 2020 07:09
Batch rename all tags inside a Git repo
git tag -l | while read old_t; do
new_t="${old_t//v/}"
new_t="${new_t//-alpha/}"
echo $new_t
git tag $new_t $old_t
git push --tags
git tag -d $old_t
git push origin :refs/tags/$old_t
done
#!/usr/bin/env bash
function find_in_list()
{
[[ "$2" == *"$1"* ]] && return 0 || return 1;
}
function add_path_to_rules()
{
# The idea was to pass an extra path
@lewkoo
lewkoo / remove_remote_tags.sh
Last active July 6, 2020 13:05
Removes all tags on a remote.
#!/bin/bash
tag_names=""
git ls-remote --tags --refs ci |
{
while read old_t; do
tag_names+=":refs/tags/${old_t##*refs/tags/} "
done
git push origin $tag_names
}
@lewkoo
lewkoo / add_all_untracked_to_gitignore.sh
Created December 10, 2014 07:50
Add all untracked files to .gitignore
git status -s | grep -e "^\?\?" | cut -c 4- >> .gitignore