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 / dwm.diff
Last active January 15, 2022 02:23
dwm diff
diff --git a/config.def.h b/config.def.h
index a2ac963..4be4c06 100644
--- a/config.def.h
+++ b/config.def.h
@@ -2,9 +2,14 @@
/* appearance */
static const unsigned int borderpx = 1; /* border pixel of windows */
-static const unsigned int snap = 32; /* snap pixel */
-static const int showbar = 1; /* 0 means no bar */
@r0x0d
r0x0d / startup-dwm
Created November 24, 2021 15:45
Initialization script for dwm
#!/bin/bash
pkill -9 slstatus
pkill -9 nm-applet
slstatus &
nm-applet &
diff --git a/config.def.h b/config.def.h
index 6f05dce..3d83772 100644
--- a/config.def.h
+++ b/config.def.h
@@ -174,7 +174,9 @@ static uint forcemousemod = ShiftMask;
*/
static MouseShortcut mshortcuts[] = {
/* mask button function argument release */
- { XK_ANY_MOD, Button2, selpaste, {.i = 0}, 1 },
+ { XK_ANY_MOD, Button4, kscrollup, {.i = 1}, 0, },
#!/usr/bin/env bash
readarray -td: REMOTE_AND_BRANCH <<< $1; declare REMOTE_AND_BRANCH;
REPOSITORY="${2:-convert2rhel}"
REMOTE=$(echo -n ${REMOTE_AND_BRANCH[0]})
BRANCH=$(echo -n ${REMOTE_AND_BRANCH[1]})
echo "Testing for remote '$REMOTE'"
git ls-remote --exit-code $REMOTE >/dev/null 2>&1
@r0x0d
r0x0d / git-commit-template.md
Last active December 9, 2021 14:49 — forked from lisawolderiksen/git-commit-template.md
Use a Git commit message template to write better commit messages

Using Git Commit Message Templates to Write Better Commit Messages

One of my colleagues shared an article on writing (good) Git commit messages today: 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

diff --git a/convert2rhel/checks.py b/convert2rhel/checks.py
index 874b152..dedd806 100644
--- a/convert2rhel/checks.py
+++ b/convert2rhel/checks.py
@@ -160,14 +160,8 @@ def check_custom_repos_are_valid():
logger.info("Skipping the check of repositories due to the use of RHSM for the conversion.")
return
- # Without clearing the metadata cache, the `yum makecache` command may
- # return 0 (everything's ok) even when the baseurl of a repository is not
diff --git a/config.def.h b/config.def.h
index 91ab8ca..2bea6d9 100644
--- a/config.def.h
+++ b/config.def.h
@@ -176,7 +176,8 @@ static uint forcemousemod = ShiftMask;
*/
static MouseShortcut mshortcuts[] = {
/* mask button function argument release */
- { XK_ANY_MOD, Button2, selpaste, {.i = 0}, 1 },
+ { XK_ANY_MOD, Button4, kscrollup, {.i = 1}, 0, /* !alt */ -1 },
@r0x0d
r0x0d / oog.sh
Created February 14, 2022 17:32
Open on github based on path and line number
#!/usr/bin/env bash
FILE="$1"
LINE="$2"
REMOTE_URL=$(git config --get remote.origin.url)
REMOTE_REPOSITORY=$(echo $REMOTE_URL | awk -F '/|.git' '{print $3}' )
REMOTE_USER=$(echo $REMOTE_URL | awk -F ':|/' '{print $2}')
CURRENT_BRANCH=$(git branch --show-current)
if [ -z "$FILE" ]
# Primitivos
## `String` - `str`
string = "Oi, Adam. 123459 | ^ ~ ÇÇ #" # ''
string_kernel = ['O', "i", ",", "A", "d", "a", "m", ...]
string_ascii = [3, 8, 10, 1, ...]
ascii_to_bytes = [ 0x10, ]
# Em C - Execução
ascii_to_bytes > string_ascii > string_kernel > string
# Documentações válidas para esse módulo:
# * Módulo random: https://docs.python.org/3/library/random.html
# * Função randomint: https://docs.python.org/3/library/random.html#random.randint
# * Função input: https://docs.python.org/3/library/functions.html#input
# * Funções básicas do Python: https://docs.python.org/3/library/functions.html#built-in-functions
# * Funções de conversão de valores:
# str() -> https://docs.python.org/3/library/functions.html#func-str
# int() -> https://docs.python.org/3/library/functions.html#int
# float() -> https://docs.python.org/3/library/functions.html#float
#