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
@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);
}
});
@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
#
@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.
@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

@dudewheresmycode
dudewheresmycode / FFMPEG Scene Detection.md
Last active April 27, 2026 11:49
Notes on scene detection with FFMPEG

Basic ffmpeg scene detection:

ffmpeg -i input.flv -filter:v "select='gt(scene,0.4)',showinfo" -f null -

scene (video only) value between 0 and 1 to indicate a new scene; a low value reflects a low probability for the current frame to introduce a new scene, while a higher value means the current frame is more likely to be one (see the example below) https://ffmpeg.org/ffmpeg-filters.html#select_002c-aselect

Set the scene change detection threshold as a percentage of maximum change on the luma plane. Good values are in the [8.0, 14.0] range. Scene change detection is only relevant in case combmatch=sc. The range for scthresh is [0.0, 100.0].

@Jabarabo
Jabarabo / githubpull.md
Last active July 21, 2026 00:00
Gist of a stolen gist
@MarceauKa
MarceauKa / The Matrix.md
Last active July 2, 2019 18:34
The Matrix
@calebporzio
calebporzio / tinker_helper.php
Created January 30, 2019 23:56
A quick, memorable way to initiate an "artisan tinker" session and play with variables.
<?php
function tinker(...$args) {
// Because there is no way of knowing what variable names
// the caller of this function used with the php run-time,
// we have to get clever. My solution is to peek at the
// stack trace, open up the file that called "tinker()"
// and parse out any variable names, so I can load
// them in the tinker shell and preserve their names.
@calebporzio
calebporzio / chain_helper.php
Last active July 23, 2023 04:27
Handy "chain()" helper method for making non-fluent classes/objects fluent.
<?php
function chain($object)
{
return new class ($object) {
protected $lastReturn = null;
public function __construct($object)
{
$this->wrapped = $object;