Skip to content

Instantly share code, notes, and snippets.

View bytehead's full-sized avatar
🏄‍♂️

David Greminger bytehead

🏄‍♂️
View GitHub Profile
@glen-cheney
glen-cheney / encoding-video.md
Last active November 24, 2024 10:09
Encoding video for the web

Encoding Video

Installing

Install FFmpeg with homebrew. You'll need to install it with a couple flags for webm and the AAC audio codec.

brew install ffmpeg --with-libvpx --with-libvorbis --with-fdk-aac --with-opus
@guillaumevoisin
guillaumevoisin / php-cs-fixer-git-files
Created June 18, 2015 10:05
PHP-CS-Fixer on modified files
git diff --name-only --cached --diff-filter=ACMRTUXB | while read filename; do php-cs-fixer --level=symfony fix $filename; done;
@midwire
midwire / ffmpeg-install.sh
Last active September 4, 2018 08:00 — forked from clayton/ffmpeg-install.sh
Install FFMPEG on OS X with HomeBrew and all libs and support
brew install ffmpeg \
--with-dcadec \
--with-faac \
--with-fdk-aac \
--with-ffplay \
--with-fontconfig \
--with-freetype \
--with-frei0r \
--with-libass \
--with-libbluray \
@scottopell
scottopell / fix_exfat_drive.md
Last active April 28, 2025 01:04
Fix corrupted exFAT disk macOS/OSX

exFAT support on macOS seems to have some bugs because my external drives with exFAT formatting will randomly get corrupted.

If Disk Utility is unable to repair, consider trying this:

  1. In Disk Utility, ensure that the drive is not mounted, eject it if it is mounted.
  2. Use diskutil list to find the right drive id.
  3. You want the id under the IDENTIFIER column, it should look like disk1s1
  4. Run sudo fsck_exfat -d <id from above>. eg sudo fsck_exfat -d disk1s3
  5. -d is debug so you'll see all your files output as they're processed.
@Toflar
Toflar / index.php.patch
Last active November 7, 2018 12:09
Symfony 4 index.php with env data for production
<?php
use App\Kernel;
use Symfony\Component\Debug\Debug;
use Symfony\Component\Dotenv\Dotenv;
use Symfony\Component\HttpFoundation\Request;
require __DIR__.'/../vendor/autoload.php';
// The check is to ensure we don't use .env in production
@MogulChris
MogulChris / resize.bash
Created October 19, 2020 22:40
Recursively resize images in a directory tree with imagemagick / mogrify
#1. find files matching a pattern
#2. use mogrify to resize them.
# -quality 94 = jpeg quality.
# -verbose so you can tell where it's at in the directory tree
# -resize 2000x\> = resize to a maximum of 2000px wide, automatic height (2000x). Only resize larger images, no upscaling (>). Because > is a special character it is escaped with \
# Aspect ratio is automatically maintained.
#3. write new image in place
#TEST THIS THOROUGHLY AND KEEP A BACKUP OF YOUR ORIGINAL DIRECTORY TREE
@fritzmg
fritzmg / BreadcrumbController.php
Last active March 7, 2025 16:10
Drop-in replacement for Contao's breadcrumb module, in order to have the correct news, event, etc. titles for the active page
<?php
// src/Controller/FrontendModule/BreadcrumbController.php
declare(strict_types=1);
namespace App\Controller\FrontendModule;
use Contao\CoreBundle\DependencyInjection\Attribute\AsFrontendModule;
use Contao\CoreBundle\Routing\ResponseContext\HtmlHeadBag\HtmlHeadBag;
use Contao\CoreBundle\Routing\ResponseContext\ResponseContextAccessor;