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 / stream_file.php
Created May 9, 2022 07:16 — forked from fideloper/stream_file.php
Stream file from S3 to browser, assume Laravel Filesystem usage
<?php
/*************************************************************************
* Get File Information
*/
// Assuming these come from some data source in your app
$s3FileKey = 's3/key/path/to/file.ext';
$fileName = 'file.ext';
### Flatpak Repos
List packages on a repo :
flatpak remote-ls repon-name --user
flatpak remote-ls
Install packages :
flatpak --user install repo-name package-name io.liri.Platform
Flathub:
@rodrigopedra
rodrigopedra / generate.php
Created April 17, 2022 04:22
PHP import CSV
<?php
$file = fopen('php://output', 'w');
fputcsv($file, ['ID', 'NAME', 'AGE']);
for ($index = 0; $index < 21_000_000; $index++) {
fputcsv($file, [$index + 1, bin2hex(random_bytes(20)), random_int(18, 65)]);
}
@rodrigopedra
rodrigopedra / Akonadi-MySQL-workaround.md
Created January 5, 2022 18:59 — forked from aldolat/Akonadi-MySQL-workaround.md
If MySQL is installed, Akonadi doesn't work anymore. This is a possible workaround to get Akonadi back to work.
@rodrigopedra
rodrigopedra / userChrome.css
Last active April 26, 2021 11:11
Customize Firefox Proton Tabs
/*
@see https://www.reddit.com/r/FirefoxCSS/comments/73dvty/tutorial_how_to_create_and_livedebug_userchromecss/
@see https://www.reddit.com/r/firefox/comments/mxqc71/this_community_complains_a_lot_but_this_time_i/
@see https://gist.github.com/Speedy37/63d37931601123178ac2221533292cdd
*/
.tab-stack {
margin-top: 1px;
}
.tabbrowser-tab {
margin: 0px !important;
@rodrigopedra
rodrigopedra / AppServiceProvider.php
Last active February 8, 2023 23:16
Laravel 8 Job Rate Limiter that can be used without Redis
<?php
namespace App\Providers;
use Illuminate\Cache\RateLimiter;
use Illuminate\Cache\RateLimiting\Limit;
use Illuminate\Support\ServiceProvider;
class AppServiceProvider extends ServiceProvider
{
<template>
<!-- ... -->
</template>
<script>
export default {
// ...
beforeRouteLeave (vm, options, event) {
// vm will now refer to this component instead of the link
return window.confirm(vm.$trans('ticket.confirm_leave_creation'));
@rodrigopedra
rodrigopedra / firefox-developer-edition.md
Created February 6, 2020 19:43 — forked from mahammad/firefox-developer-edition.md
How To install Firefox Developer Edition and create desktop icon for Ubuntu 14.04 LTS

chose other install way

  1. Open Terminal Ctrl+Alt+T Download Firefox Developer Edition tar file

    wget https://download.mozilla.org/?product=firefox-aurora-latest-ssl&os=linux64&lang=en-US

  2. Copy tar file to opt sudo cp -rp firefox-35.0a2.en-US.linux-x86_64.tar.bz2

  3. Open opt folder (cd /opt/) and untar file sudo tar xjf firefox-35.0a2.en-US.linux-x86_64.tar.bz2

@rodrigopedra
rodrigopedra / MigrateTenant.php
Last active April 29, 2020 21:58
Laravel Tenant Migration commands
<?php
namespace App\Console\Commands;
use App\Models\Tenants\Tenant;
use Illuminate\Support\Facades\DB;
use Illuminate\Console\ConfirmableTrait;
use Illuminate\Database\Console\Migrations\MigrateCommand;
class MigrateTenant extends MigrateCommand
const AssetsManager = {
name : 'AssetsManager',
template : '#assets-manager-template',
components : { ImageForm, LinkForm },
data () {
return {
showImageForm : false,