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
@OrionReed
OrionReed / dom3d.js
Last active May 5, 2024 14:09
3D DOM viewer, copy-paste this into your console to visualise the DOM topographically.
// 3D Dom viewer, copy-paste this into your console to visualise the DOM as a stack of solid blocks.
// You can also minify and save it as a bookmarklet (https://www.freecodecamp.org/news/what-are-bookmarklets/)
(() => {
const SHOW_SIDES = false; // color sides of DOM nodes?
const COLOR_SURFACE = true; // color tops of DOM nodes?
const COLOR_RANDOM = false; // randomise color?
const COLOR_HUE = 190; // hue in HSL (https://hslpicker.com)
const MAX_ROTATION = 180; // set to 360 to rotate all the way round
const THICKNESS = 20; // thickness of layers
const DISTANCE = 10000; // ¯\\_(ツ)_/¯
@HelgeSverre
HelgeSverre / SelectorFinder.php
Created December 3, 2023 20:39
Experimental approach to selector finding using AI
<?php
namespace App\Scraping;
use App\HtmlCompressor;
use Closure;
use OpenAI;
use Spatie\Fork\Fork;
class SelectorFinder
@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:

@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;
@JustSteveKing
JustSteveKing / pint.json
Last active March 1, 2024 19:28
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,
@pxlrbt
pxlrbt / PageTemplates_Faq.php
Last active April 10, 2024 01:44
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
{
@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);
}
});
@jioo
jioo / share-git-stash.md
Last active March 13, 2024 14:59
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

@MarceauKa
MarceauKa / The Matrix.md
Last active July 2, 2019 18:34
The Matrix