Skip to content

Instantly share code, notes, and snippets.

View Phlow's full-sized avatar
🐙
🎛️ 🔊

Moritz »mo.« Sauer Phlow

🐙
🎛️ 🔊
View GitHub Profile
@Phlow
Phlow / html-typografie-test.html
Last active August 8, 2022 14:31
Test-Webseite, um alle HTML-Typografie-Elemente zu testen. #HTML
<!doctype html>
<html lang="de">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<title>HTML-Typographie – Alle HTML5-Elemente testen</title>
<meta name="description" content="Test-Webseite, um alle HTML-Typografie-Elemente zu testen.">
<meta name="viewport" content="width=device-width, initial-scale=1">
@Phlow
Phlow / box-shadow.css
Created February 6, 2016 09:29
Simple but elegant looking box-shadow to make a <div> look like a sheet of paper
.box-shadow { box-shadow: 0 2px 2px 0 rgba(0,0,0,0.14),
0 1px 5px 0 rgba(0,0,0,0.12),
0 3px 1px -2px rgba(0,0,0,0.2);
}
@Phlow
Phlow / dateien-verzeichnis-ausgeben.php
Last active November 22, 2024 14:43
Dateien innerhalb eines Verzeichnisses ausgeben
<!doctype html>
<html class="no-js" lang="de">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Index</title>
<style type="text/css">
body,html {
margin: 0;
@Phlow
Phlow / vorlage-readibility-artikel.html
Last active August 8, 2022 14:32
Diese Vorlage basiert auf der Vorgabe des Microformats von Readability. Mehr zu diesen »Article Publishing Guidelines« liest man auf der Website › https://www.readability.com/developers/guidelines #HTML
<article class="hentry">
<header>
<h1 class="entry-title"></h1>
<h2 class="entry-summary"></h2>
<time class="published" datetime="2012-01-07 11:11:03-0400">
01-07-2012
</time>
<p class="byline author vcard">
Von <span class="fn"></span>
</p>
@Phlow
Phlow / gzip-htaccess
Last active November 24, 2021 16:00
enable gzip compression via .htaccess – Useful for WordPress and other sites
<IfModule mod_deflate.c>
# Komprimiere HTML, CSS, JavaScript, Text, XML und fonts
AddOutputFilterByType DEFLATE application/javascript
AddOutputFilterByType DEFLATE application/rss+xml
AddOutputFilterByType DEFLATE application/vnd.ms-fontobject
AddOutputFilterByType DEFLATE application/x-font
AddOutputFilterByType DEFLATE application/x-font-opentype
AddOutputFilterByType DEFLATE application/x-font-otf
AddOutputFilterByType DEFLATE application/x-font-truetype
@Phlow
Phlow / Hide wp-config.php and .htaccess
Last active August 17, 2022 05:14
Harden your WordPress and hide wp-config.php and .htaccess for attackers.
# Prevent wp-config.php and .htaccess
# from being accessed use this code
<Files wp-config.php>
order allow,deny
deny from all
</Files>
<Files .htaccess>
order allow,deny
@Phlow
Phlow / pagination-collection.liquid
Last active October 13, 2023 03:10
If you need pagination for a collection in a Jekyll theme, you can use the following Liquid logic which works also on Github pages
{% comment %}
#
# I modified the original code from http://anjesh.github.io/2015/01/25/collection-pagination-working-github-pages/
#
# Make a collection in _config.yml and create the folder _your_collection in your root.
#
# collections:
# your_collection:
# output: true
# permalink: /:collection/:title/
@Phlow
Phlow / nested-for-loop.liquid
Created January 6, 2017 20:08
This is a nested liquid loop for Jekyll to iterate through YAML data with a depth of three levels. The example loops through a potential table of contents of a book.
{% comment %}
#
# This is a nested liquid loop for Jekyll to iterate through YAML data with
# a depth of three levels. The example loops through a potential table of
# contents of a book.
#
# This is the example YAML content'
- chapters: 'Einführung'
sub_chapters:
@Phlow
Phlow / rename_file_with_file_date.sh
Created January 11, 2017 14:17
When renaming files in terminal, you can use their time stamp. This bash/shell script helps you. It uses `stat` to get the information, formats the time stamp with `date` and renames each file with `mv`.
#
# When renaming files in terminal, you can use their time stamp. This bash/shell script helps you.
#
# One liner: for f in *.jpg; do D=$(date -r $(stat -f %B $f) +%Y-%m-%d-%H-%M-%S); mv -vi "$f" "$D-$f"; done
for datei in *.jpg
do VARIABLE_WITH_FORMATTED_DATE=$(date -r $(stat -f %B $datei) +%Y-%m-%d-%H-%M-%S)
mv -vi "$datei" "$VARIABLE_WITH_FORMATTED_DATE-$file"
done
@Phlow
Phlow / renamedate.sh
Last active January 12, 2017 16:21
Bash Script um Dateien mit eigenem Entstehungsdatum und einer gewünschten Zeichenfolge umzubenennen.
#!/bin/bash
# Rename Files with Date from File plus Extra Characters
clear;
# Farben zurücksetzen
printf '\e[0m'
echo " ____ ____ ____ ____ ____ ____ ____ "
echo " ||R |||e |||n |||a |||m |||e |||r ||"
echo " ||__|||__|||__|||__|||__|||__|||__||"
echo " |/__\|/__\|/__\|/__\|/__\|/__\|/__\|"
echo