Skip to content

Instantly share code, notes, and snippets.

@neingeist
neingeist / ffmpeg.md
Last active November 6, 2025 01:15
ffmpeg cheat sheet

Set audio language tag

E.g. for the first audio track (a:0). This example also resets the title of the audio track.

ffmpeg -i Godzilla.vs..Megalon.1973.1080p.mp4 \
    -c copy \
    \
    -metadata:s:a:0 language=jpn \
@joachimesque
joachimesque / config.php
Created January 4, 2018 15:19
CSP headers with a script-src nonce directive for Kirby
<?php
/*
---------------------------------------
CSP
---------------------------------------
*/
$csp_nonce = base64_encode(random_bytes(20));
$csp_header = "Content-Security-Policy: default-src 'self'; script-src 'self' 'nonce-" . $csp_nonce . "';";
// set `csp-nonce` so it's accessable
@enwin
enwin / WSL_and_frond-end.md
Last active September 12, 2018 14:03
(WIP) Windows / WSL configuration to get a nice front-end setup
@sam0737
sam0737 / clock.html
Last active January 22, 2026 16:59
OBS Studio: A HTML page for showing current date and time in the video
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>A simple clock</title>
</head>
<body translate="no" >
@ivomynttinen
ivomynttinen / srcset.php
Last active February 7, 2017 06:51
Kirby CMS Tag for srcset images. Supports the attributes "retina" (file name of the @2x resource), "alt" (alt text on img), "class" (additional class on the img element). Place under /site/tags/
<?php
kirbytext::$tags['srcset'] = array(
'attr' => array(
'retina',
'alt',
'class'
),
'html' => function($tag) {
<!-- create the complete html img tag for a given image -->
<?= $page->image()->html() ?>
<!-- modify the attributes of the img tag -->
<?= $page->image()->html(['class' => 'myImage']) ?>
<!-- resize an image first and then get the img tag for it -->
<?= $page->image()->resize(300,200)->html() ?>
<?
/////////////////////
// slack2html
// by @levelsio
/////////////////////
//
/////////////////////
// WHAT DOES THIS DO?
/////////////////////
//
@rutger1140
rutger1140 / .htaccess
Created October 8, 2014 15:30
Kirby CMS htaccess file - SEO optimized - 1000+ spam related IP blocks
# pass the default character set
AddDefaultCharset utf-8
php_flag short_open_tag on
ErrorDocument 404 /error
# Kirby .htaccess
# exclude panel from trailing slash removal
@bastianallgeier
bastianallgeier / statify.php
Last active October 4, 2022 17:12
A first draft for a script, which converts a Kirby site into a static site. It's a rough first draft, so don't expect it to be perfect. Play with it, if you like it!
<?php
/**
* Instructions:
*
* 1. Put this into the document root of your Kirby site
* 2. Make sure to setup the base url for your site correctly
* 3. Run this script with `php statify.php` or open it in your browser
* 4. Upload all files and folders from static to your server
* 5. Test your site
@Cybso
Cybso / adblock.sh
Last active April 4, 2025 21:37 — forked from teffalump/README.md
#!/bin/sh
#Put in /etc/adblock.sh
#Script to grab and sort a list of adservers and malware
#Check proper DHCP config and, if necessary, update it
uci get dhcp.@dnsmasq[0].addnhosts > /dev/null 2>&1 || uci add_list dhcp.@dnsmasq[0].addnhosts=/etc/block.hosts && uci commit
#Leave crontab alone, or add to it
grep -q "/etc/adblock.sh" /etc/crontabs/root || echo "0 4 * * 0,3 sh /etc/adblock.sh" >> /etc/crontabs/root