Skip to content

Instantly share code, notes, and snippets.

View .stylelintrc.js
module.exports = {
extends: ['stylelint-config-standard-scss', 'stylelint-config-prettier'],
rules: {
indentation: 4,
'no-descending-specificity': null,
'alpha-value-notation': [
'percentage',
{
exceptProperties: ['opacity'],
},
@yellowled
yellowled / srcsetsizes.html
Created Dec 17, 2017
Responsive images w/ srcset & sizes
View srcsetsizes.html
<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 / s9y-version.php
Created Dec 15, 2015
Check/switch version in s9y backend files
View s9y-version.php
// 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 / .htaccess
Created Apr 1, 2013
gzip aktivieren auf Uberspace
View .htaccess
<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 / ffmpeg-html5
Created Dec 6, 2011
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.
View ffmpeg-html5
# 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