Skip to content

Instantly share code, notes, and snippets.

View AndreyDodonov-EH's full-sized avatar
🎯
Focusing

Andrey Dodonov AndreyDodonov-EH

🎯
Focusing
View GitHub Profile
@AndreyDodonov-EH
AndreyDodonov-EH / example.md
Last active July 12, 2025 15:02
Deduplicate console output live and/or show timestamps
Before After
$ ./printer.sh 
@AndreyDodonov-EH
AndreyDodonov-EH / watch_any_script.sh
Created July 6, 2025 15:08
nodemon: watch ANY script (including non-node)
npm install -g nodemon
nodemon --exec python my_program.py
@AndreyDodonov-EH
AndreyDodonov-EH / permit_team.sh
Created May 23, 2023 15:07
Give permission to all repos in a GitHub organisation for a certain team
#name of your ogranisation
#ORG=some_org
#name of your team
#TEAM_SLUG=some_team
#permission to be given. Possible values are pull, triage, push, maintain, admin
#PERMISSION=pull
#more details on listing repos: https://docs.github.com/en/rest/repos/repos?apiVersion=2022-11-28#list-organization-repositories
#more details on giving permission to a team https://docs.github.com/en/rest/teams/teams?apiVersion=2022-11-28#add-or-update-team-repository-permissions
@OleksiyRudenko
OleksiyRudenko / why-newline.md
Last active October 7, 2025 15:29
Why should text files end with a newline?

Why should text files end with a newline?

Reasons:

  • UNIX standard
  • If the last line in a file doesn't end with a newline then addition of next line affects two lines instead of one. This also pollutes diff on multiple files, so reader may wonder what has changed in a line whereas no significant change has occured.

Multiple newlines at the file end are also redundant as well as spaces at the end of line.

@vmandic
vmandic / dotnet core .gitignore
Last active October 24, 2025 15:16
A default .NET Core project .gitignore file - or just type `dotnet new gitignore`
# From .NET Core 3.0 you can use the command: `dotnet new gitignore` to generate a customizable .gitignore file
*.swp
*.*~
project.lock.json
.DS_Store
*.pyc
# Visual Studio Code
.vscode
@mydreambei-ai
mydreambei-ai / convert_struct_to_bytes.py
Last active August 2, 2023 15:03
Python ctypes Structure to bytes
from ctypes import *
def convert_bytes_to_structure(st, byte):
# sizoef(st) == sizeof(byte)
memmove(addressof(st), byte, sizeof(st))
def convert_struct_to_bytes(st):
buffer = create_string_buffer(sizeof(st))
memmove(buffer, addressof(st), sizeof(st))