Skip to content

Instantly share code, notes, and snippets.

View NejcZupec's full-sized avatar

Nejc Župec NejcZupec

  • Ljubljana, Slovenia
View GitHub Profile
@NejcZupec
NejcZupec / cleanup_artifacts.py
Last active December 15, 2022 10:49
Cleanup GitHub Actions artifacts
# Requirements: Python 3.9+
# pip install PyGithub
# Get token here https://github.com/settings/tokens/new (need all repo permissions)
# Run the script: TOKEN='<token>' REPOSITORY=<org>/<repo> python cleanerV2.py <start_page>
import time
import sys
import datetime
import os
@NejcZupec
NejcZupec / ddtrace.log
Created May 29, 2019 09:30
ddtrace logs from nejc.dev.zengrc.com
[2019-05-24 08:38:23,474][DEBUG][ddtrace.sampler][__init__] - initialized RateSampler, sample 100% of traces, 7 additional messages skipped
[2019-05-24 08:38:23,977][DEBUG][ddtrace.sampler][__init__] - initialized RateSampler, sample 100% of traces, 1 additional messages skipped
[2019-05-24 08:39:04,584][DEBUG][ddtrace.span][set_tag] - error setting numeric metric _dd1.sr.eausr:None, 311 additional messages skipped
[2019-05-24 08:39:04,706][DEBUG][ddtrace.api][send_traces] - reported 1 traces in 0.00369s, 19 additional messages skipped
[2019-05-24 08:39:09,646][DEBUG][ddtrace.span][set_tag] - error setting numeric metric _dd1.sr.eausr:None, 186 additional messages skipped
[2019-05-24 08:39:10,155][DEBUG][ddtrace.api][send_traces] - reported 1 traces in 0.08941s, 11 additional messages skipped
[2019-05-24 08:40:04,651][DEBUG][ddtrace.span][set_tag] - error setting numeric metric _dd1.sr.eausr:None, 15 additional messages skipped
[2019-05-24 08:40:04,799][DEBUG][ddtrace.api][send_traces] - reported 1 traces in
@NejcZupec
NejcZupec / game.py
Last active November 21, 2018 14:22
Game of Life
class Game(object):
def __init__(self, initial_state: set):
self.state = initial_state
@staticmethod
def get_neighbours(x: int, y: int) -> set:
offsets = [(-1, -1), (-1, 0), (-1, 1), (0, -1), (0, 1), (1, -1), (1, 0), (1, 1)]
return set([(x + i, y + j) for (i, j) in offsets])
@NejcZupec
NejcZupec / circleci.sh
Last active November 15, 2018 16:09
CircleCI Parallelization
$ circleci tests glob "test/integration/**/test_*.py"
test/integration/test_1.py
test/integration/test_2.py
test/integration/test_3.py
test/integration/test_4.py
test/integration/test_5.py
test/integration/test_6.py
test/integration/test_7.py
test/integration/test_8.py
@NejcZupec
NejcZupec / environment
Created November 13, 2018 08:25
/etc/environment
PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games"
DJANGO_SETTINGS_MODULE="..."
SECRET_KEY="..."
DB_PASSWORD="..."
MEETUP_API_KEY="..."
ubuntu@zupec-hosting:~$ sudo apt-get --purge remove datadog-agent
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following packages will be REMOVED:
datadog-agent*
0 upgraded, 0 newly installed, 1 to remove and 297 not upgraded.
1 not fully installed or removed.
After this operation, 240 MB disk space will be freed.
Do you want to continue? [Y/n]

Keybase proof

I hereby claim:

  • I am nejczupec on github.
  • I am nejc (https://keybase.io/nejc) on keybase.
  • I have a public key ASA10VwD-D9c4K7tW60eZv22KPl7pSEFgKfnaY15tCzLQgo

To claim this, I am signing this object:

@NejcZupec
NejcZupec / fix_headers.sh
Created July 5, 2018 06:55
Fix license header
#!/usr/bin/env bash
for f in $(find . -name '*.sql' -not -path "./node_modules/*")
do
if ! grep -q "Copyright" $f
then
echo $f
cat header_file $f >$f.new && mv $f.new $f
fi
done
import os
from time import sleep
import sys
import serial
commands = {
'on': b'0',
'volume_down': b'1',
'volume_up': b'2',