Skip to content

Instantly share code, notes, and snippets.

View rodrigopedra's full-sized avatar

Rodrigo Pedra Brum rodrigopedra

  • São Carlos, Brazil
View GitHub Profile
@rodrigopedra
rodrigopedra / try-catch.ts
Created March 20, 2025 07:09 — forked from t3dotgg/try-catch.ts
Theo's preferred way of handling try/catch in TypeScript
// Types for the result object with discriminated union
type Success<T> = {
data: T;
error: null;
};
type Failure<E> = {
data: null;
error: E;
};
@rodrigopedra
rodrigopedra / XGH - de-de.txt
Created March 7, 2025 06:50 — forked from banaslee/XGH - de-de.txt
eXtreme Go-Horse Process
eXtreme Go Horse (XGH) Process
Quelle: http://gohorseprocess.wordpress.com
Übersetzung ursprünglich von https://gist.github.com/Neffez/f8d907ba8289f14e23f3855011fa4e2f
1. Ich denke, also ist es nicht XGH.
In XGH wird nicht gedacht, es wird das erste gemacht, was in den Sinn kommt. Es gibt auch keine zweite Option, die erste ist schneller.
2. Es gibt 3 Wege ein Problem zu lösen: den richtigen Weg, den falschen Weg und den XGH Weg, welcher exakt wie der falsche ist, aber schneller.
#!/bin/bash
# SPDX-License-Identifier: MIT
## Copyright (C) 2009 Przemyslaw Pawelczyk <[email protected]>
##
## This script is licensed under the terms of the MIT license.
## https://opensource.org/licenses/MIT
#
# Lockable script boilerplate
@rodrigopedra
rodrigopedra / javascript_engines_and_runtimes.md
Created October 11, 2024 03:43 — forked from guest271314/javascript_engines_and_runtimes.md
A list of JavaScript engines, runtimes, interpreters

V8 is Google’s open source high-performance JavaScript and WebAssembly engine, written in C++. It is used in Chrome and in Node.js, among others. It implements ECMAScript and WebAssembly, and runs on Windows 7 or later, macOS 10.12+, and Linux systems that use x64, IA-32, ARM, or MIPS processors. V8 can run standalone, or can be embedded into any C++ application.

SpiderMonkey is Mozilla’s JavaScript and WebAssembly Engine, used in Firefox, Servo and various other projects. It is written in C++, Rust and JavaScript. You can embed it into C++ and Rust projects, and it can be run as a stand-alone shell. It can also be [compiled](https://bytecodealliance.org/articles/making-javascript-run-fast-on

@rodrigopedra
rodrigopedra / OpenSuSE_MicroOS_ROCm_CUDA_ollama.md
Created September 18, 2024 01:18 — forked from torsten-online/OpenSuSE_MicroOS_ROCm_CUDA_ollama.md
OpenSUSE MicroOS Howto with AMDGPU / ROCm - To run CUDA AI Apps like Ollama

Howto run Ollama "local AI" with ROCm on OpenSUSE Tumbleweed / MicroOS / AEON Desktop with AMDGPU / ROCm

ITs just totally easy to install amdgpu-dkms kernel driver with ROCm/AMDGPU on OpenSUSE Tumbleweed or better MicroOS/AEON, if you know what to do...

  • Install Longtime Kernel Support + Devel Packages
sudo transactional-update --continue pkg install kernel-longterm kernel-longterm-devel
@rodrigopedra
rodrigopedra / sw-test-cleaup.js
Created April 22, 2024 05:02 — forked from gauntface/sw-test-cleaup.js
Function to unregister SW and clear out old caches.
window.__testCleanup = () => {
const unregisterSW = () => {
return navigator.serviceWorker.getRegistrations()
.then((registrations) => {
const unregisterPromise = registrations.map((registration) => {
return registration.unregister();
});
return Promise.all(unregisterPromise);
});
};
@rodrigopedra
rodrigopedra / cap.sh
Created November 23, 2023 21:35 — forked from patillacode/cap.sh
#!/bin/bash
################################################################################
# cap - capture your screen
#
# This script allows you to capture your screen on Linux or macOS systems using
# the appropriate tools available on each platform. On Linux, it uses 'slop'
# and 'ffmpeg', while on macOS, it utilizes 'screencapture'. The script prompts
# you to select a desktop area for recording and saves the recording as an MP4/MOV
# file with customizable video quality.
@rodrigopedra
rodrigopedra / peek.sh
Created November 23, 2023 21:32 — forked from jpenalbae/peek.sh
Record desktop area on linux using slop and ffmpeg
#!/bin/bash
# Video Quality
# The range of the CRF scale is 0–51, where 0 is lossless, 23 is the default,
# and 51 is worst quality possible. A lower value generally leads to higher
# quality, and a subjectively sane range is 17–28
QUALITY=28
# check if slop command exists
if ! command -v slop &> /dev/null
@rodrigopedra
rodrigopedra / vidqgif.sh
Created November 23, 2023 21:27 — forked from bodqhrohro/vidqgif.sh
Compress a video to a tiny GIF with a very strong quantization and no dithering
#!/bin/sh
# parameters: input, output
# make a 256-colors palette first
palettefull=$( mktemp --suffix=.png )
ffmpeg -i "$1" -vf 'palettegen' -y "$palettefull"
# quantize the palette (palettegen's builting limiter
# tries to preserve too much similar shades)
palettequant=$( mktemp --suffix=.png )
@rodrigopedra
rodrigopedra / README.md
Last active November 11, 2023 22:13
Generate Breeze opaque local Plasma Styles

Generate Breeze opaque local Plasma Styles

Tested on Plasma 5.27

I understand many people like transparency and blur, and many folks I introduced to Plasma, made the switch by features like that.

But for me, it is highly distracting, and a big focus grabber.

I spent countless hours looking for a solution to this, and pushed every knob