Skip to content

Instantly share code, notes, and snippets.

View MarceauKa's full-sized avatar
🚀
Working hard!

Marceau Casals MarceauKa

🚀
Working hard!
View GitHub Profile
@jioo
jioo / share-git-stash.md
Last active April 13, 2026 11:24
How to export stash as a file, and apply it to another computer

Stash current changes

  • git > Stash > Stash (Include Untracked)

Create stash as patch

git stash show "stash@{0}" -p > changes.patch

Apply patch

@jhoneill
jhoneill / Chrome Databases.ipynb
Last active June 6, 2025 07:50
Exploring data saved by Chrome/Edge/Any Chromium (passwords done in another Gist)
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@sixteenmillimeter
sixteenmillimeter / capture.sh
Last active January 30, 2026 02:27
Capture a livestream using youtube-dl and ffmpeg.
#!/bin/bash
#################################
# Instructions
#
# First, install ffmpeg and youtube-dl
#
# https://ffmpeg.org/download.html
# https://ytdl-org.github.io/youtube-dl/download.html
#
@abdoulmouctard
abdoulmouctard / lazy-collection.php
Last active September 20, 2023 19:03
Laravel Lazy Collection From CSV
<?php
LazyCollection::macro("fromCsv", function (string $path, int $chunk = 0, string $separator = ";"): LazyCollection {
/** @var LazyCollection $collection */
$collection = static::make(function () use (&$separator, &$path, &$chunk) {
$handle = fopen($path, 'r');
while ($line = fgetcsv(stream: $handle, separator: $separator)) {
yield array_map(fn ($item) => trim($item), $line);
}
});
@pxlrbt
pxlrbt / PageTemplates_Faq.php
Last active February 21, 2025 07:47
Filament Template
<?php
namespace App\Filament\PageTemplates;
use Filament\Forms\Components\Repeater;
use Filament\Forms\Components\RichEditor;
use Filament\Forms\Components\TextInput;
final class Faq
{
@JustSteveKing
JustSteveKing / pint.json
Last active September 14, 2026 09:29
Laravel Pint configuration
{
"preset": "per",
"rules": {
"align_multiline_comment": true,
"array_indentation": true,
"array_syntax": true,
"blank_line_after_namespace": true,
"blank_line_after_opening_tag": true,
"combine_consecutive_issets": true,
"combine_consecutive_unsets": true,
@kmuenkel
kmuenkel / DuskTestCase.php
Created February 2, 2023 17:04
Control which browser plugin will be used by Dusk by .env values
<?php
namespace Tests;
use InvalidArgumentException;
use Illuminate\Support\Collection;
use Laravel\Dusk\TestCase as BaseTestCase;
use Facebook\WebDriver\Chrome\ChromeOptions;
use Facebook\WebDriver\Firefox\FirefoxOptions;
use Facebook\WebDriver\Remote\RemoteWebDriver;
@jexio
jexio / ffmpeg-livestream-to-streaming-sites-vaapi-nvenc.md
Created July 23, 2023 04:20 — forked from Brainiarc7/ffmpeg-livestream-to-streaming-sites-vaapi-nvenc.md
ffmpeg livestreaming to youtube via Nvidia's NVENC and Intel's VAAPI on supported hardware

Streaming your Linux desktop to Youtube and Twitch via Nvidia's NVENC and VAAPI:

Considerations to take when live streaming:

The following best practice observations apply when using a hardware-based encoder for live streaming to any platform:

  1. Set the buffer size (-bufsize:v) equal to the target bitrate (-b:v). You want to ensure that you're encoding in CBR mode.

  2. Set up the encoders as shown:

@HelgeSverre
HelgeSverre / HtmlCompressor.php
Created December 3, 2023 20:36
Experimental code to compres HTML without losing the "structure", for a web scraping with ai use-case to reduce required token-usage.
<?php
namespace App;
use Illuminate\Support\Str;
use Symfony\Component\DomCrawler\Crawler;
class HtmlCompressor
{
protected bool $removeComments = true;