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 / 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

@rodrigopedra
rodrigopedra / toggle-decorations.c
Created October 23, 2023 18:51 — forked from muktupavels/toggle-decorations.c
Simple app to toggle window decorations.
/*
* Copyright (C) 2017 Alberts Muktupāvels
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
<?php
/**
* PHP XML to dynamic table
*
* @link http://stackoverflow.com/q/16997835/367456
*/
require('.../Iterator-Garden/src/autoload.php'); // for DecoratingIterator - use development branch
@rodrigopedra
rodrigopedra / BladeServiceProvider.php
Last active December 8, 2022 09:47
Blade Optimizations
<?php
namespace App\Providers;
use Illuminate\Support\ServiceProvider;
use Illuminate\View\Compilers\BladeCompiler;
// @see https://laravel-news.com/faster-laravel-optimizations
class BladeServiceProvider extends ServiceProvider
{
@rodrigopedra
rodrigopedra / README
Created September 15, 2022 18:15 — forked from awerlang/README
A zypper wrapper that maximizes network throughput
zypper-download
===============
Downloads packages using any amount of available openSUSE mirrors.
Installation
------------
Copy both files to the following locations:
export default defineConfig({
plugins: [
laravel(['resources/js/app.js']),
{
name: 'ziggy',
enforce: 'post',
handleHotUpdate({ server, file }) {
if (file.includes('/routes/') && file.endsWith('.php')) {
exec('php artisan ziggy:generate', (error, stdout) => error === null && console.log(` > Ziggy routes generated!`))
}