Skip to content

Instantly share code, notes, and snippets.

View yellowled's full-sized avatar

Matthias Mees yellowled

View GitHub Profile
@yellowled
yellowled / .htaccess
Created April 1, 2013 14:35
gzip aktivieren auf Uberspace
<IfModule mod_deflate.c>
AddOutputFilterByType DEFLATE application/atom+xml \
application/javascript \
application/json \
application/rss+xml \
application/vnd.ms-fontobject \
application/x-font-ttf \
application/xhtml+xml \
application/xml \
font/opentype \
@yellowled
yellowled / s9y-version.php
Created December 15, 2015 10:11
Check/switch version in s9y backend files
// do not use in 2.0 versions
if ($serendipity['version'][0] == '1') {
// do something old version
} else {
// new
}
if ($serendipity['version'][0] == '2') { // new }
@yellowled
yellowled / srcsetsizes.html
Created December 17, 2017 12:18
Responsive images w/ srcset & sizes
<img
<!-- Fallback: smallest image in our srcset, see below -->
src="small.jpg"
<!-- srcset consists of three versions of the same image:
* large.jpg is 1280px wide
* medium.jpg is 768px wide
* small.jpg is 320pw wide
@yellowled
yellowled / ffmpeg-html5
Created December 6, 2011 19:39
Convert videos to proper formats for HTML5 video on Linux shell using ffmpeg. Will probably convert this to a bash script later, but for the time being, here's some examples. Not sure there have actually sensible dimensions and bitrates for web video.
# webm
ffmpeg -i IN -f webm -vcodec libvpx -acodec libvorbis -ab 128000 -crf 22 -s 640x360 OUT.webm
# mp4
ffmpeg -i IN -acodec aac -strict experimental -ac 2 -ab 128k -vcodec libx264 -vpre slow -f mp4 -crf 22 -s 640x360 OUT.mp4
# ogg (if you want to support older Firefox)
ffmpeg2theora IN -o OUT.ogv -x 640 -y 360 --videoquality 5 --audioquality 0 --frontend