Skip to content

Instantly share code, notes, and snippets.

View r0x0d's full-sized avatar
:shipit:
Working from home

Rodolfo Olivieri r0x0d

:shipit:
Working from home
View GitHub Profile
@r0x0d
r0x0d / actions---__init__.diff
Last active January 15, 2024 14:44
extending the action framework
diff --git a/convert2rhel/actions/__init__.py b/convert2rhel/actions/__init__.py
index ce8c06f..1ae7375 100644
--- a/convert2rhel/actions/__init__.py
+++ b/convert2rhel/actions/__init__.py
@@ -691,7 +691,7 @@ def resolve_action_order(potential_actions, previously_resolved_actions=None):
)
-def run_actions():
+def run_pre_actions():
@abadger
abadger / decorate.py
Last active March 6, 2023 18:22
How to write a unittest that ignores a decorator
# let's say we have a function "testing" which is decorated by "my_decorator"
import functools
def my_decorator(func):
@functools.wraps(func)
def wrapped(*args, **kwargs):
print("In real decorator")
print(func.__name__)
print(args)
print(kwargs)
@abadger
abadger / gist:2e9bdb59ee7d42dfc0d612dcef07d67d
Created November 10, 2021 18:10
Convert2rhel unit testing discussion 11-10-2021
* Integration tests
* DevDocTest
* Hackathon that made the new CI framework work with testing_farm (and
Artemis) and pakit. These are used in Fedora and RHEL
* https://packit.dev/docs/testing-farm/
* Developers should be able to write these but now that we have a QE team then
they can write them
* We might re-evaluate having the developers write these in the future.
* Runs the whole conversion:
* Set up the system
@gamozolabs
gamozolabs / vimrc
Last active November 23, 2021 17:41
" An example for a vimrc file.
"
" Maintainer: Bram Moolenaar <Bram@vim.org>
" Last change: 2019 Jan 26
"
" To use it, copy it to
" for Unix and OS/2: ~/.vimrc
" for Amiga: s:.vimrc
" for MS-DOS and Win32: $VIM\_vimrc
" for OpenVMS: sys$login:.vimrc
@lisawolderiksen
lisawolderiksen / git-commit-template.md
Last active March 21, 2026 08:40
Use a Git commit message template to write better commit messages

Using Git Commit Message Templates to Write Better Commit Messages

The always enthusiastic and knowledgeable mr. @jasaltvik shared with our team an article on writing (good) Git commit messages: How to Write a Git Commit Message. This excellent article explains why good Git commit messages are important, and explains what constitutes a good commit message. I wholeheartedly agree with what @cbeams writes in his article. (Have you read it yet? If not, go read it now. I'll wait.) It's sensible stuff. So I decided to start following the

@mort3za
mort3za / git-auto-sign-commits.sh
Last active December 11, 2025 14:52
Auto sign your git commits
# Generate a new pgp key: (better to use gpg2 instead of gpg in all below commands)
gpg --gen-key
# maybe you need some random work in your OS to generate a key. so run this command: `find ./* /home/username -type d | xargs grep some_random_string > /dev/null`
# check current keys:
gpg --list-secret-keys --keyid-format LONG
# See your gpg public key:
gpg --armor --export YOUR_KEY_ID
# YOUR_KEY_ID is the hash in front of `sec` in previous command. (for example sec 4096R/234FAA343232333 => key id is: 234FAA343232333)
@vinicius73
vinicius73 / post.md
Created November 22, 2016 12:26
["LÓGICA DE PROGRAMAÇÃO" É BOBAGEM, e explicarei porquê.]

#["LÓGICA DE PROGRAMAÇÃO" É BOBAGEM, e explicarei porquê.]

Se preparem que o texto é longo.

Várias vezes chegam novatos aqui perguntando como começar, e a galera diz "estuda lógica primeiro, depois vai pra linguagem X". Vivo dizendo que é bobagem. Ontem, em particular, falei isso, e vieram várias pessoas por inbox me perguntar porquê (e uma pra me xingar, achando que falei por arrogância).

Pra facilitar, eu vou escrever uma boa explicação de porquê "lógica de programação" é furada, doa a quem doer, e postar na APDA e no fórum da EnergyLabs (para futuras referências, porque esse assunto vai voltar, ctz).

@cam8001
cam8001 / dapply
Last active February 6, 2026 14:22
Apply a patch directly from a URL without downloading it first.
#!/bin/bash
# Downloads and applies a patch from Drupal.org.
if [ -z "$1" ]
then
echo "You need to supply a URL to a patch file."
exit
fi
URL=$1;