Skip to content

Instantly share code, notes, and snippets.

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

Moritz »mo.« Sauer Phlow

🐙
🎛️ 🔊
View GitHub Profile
@Phlow
Phlow / dateien-verzeichnis-ausgeben.php
Created February 21, 2016 14:03
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 / 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
@Phlow
Phlow / template.adoc
Created March 6, 2017 19:38
Asciidoc Asciidoctor Starter Template for Articles

Template

@Phlow
Phlow / schrifteninstallieren.sh
Last active March 10, 2017 13:12
Fonts Schriften Linux Installation installieren
#!/bin/bash
# Get script › wget https://gist.githubusercontent.com/Phlow/94ebb77a6b6cc6dccd3451436be43096/raw/2fee13d632dec696483d42f84c734e37fe17577a/schrifteninstallieren.sh
# Google Fonts
cd && wget https://raw.githubusercontent.com/hotice/webupd8/master/install-google-fonts
chmod +x install-google-fonts
./install-google-fonts
# Linux Libertine und EB Garamond
sudo apt-get install ttf-linux-libertine
sudo apt-get install fonts-ebgaramond fonts-ebgaramond-extra
sudo apt-get install ttf-mscorefonts-installer
@Phlow
Phlow / resize-rename-sips-information.sh
Last active December 6, 2017 16:02
This script makes a copy of images, resizes the copied images and renames the copied images with the correct width and height. The information gets the script from sips.
#!/bin/bash
#
# 1. This script copies all *.jpg-files to a new folder
# 2. Jumps into folder and resizes all files with sips
# 3. Renames all files and uses information from sips
#
folder="processed"
height="320"
width="160" # not used
@Phlow
Phlow / posting.sh
Last active January 23, 2018 12:17
Ask for a title and create a post for Jekyll in _posts and open in in your favorite editor
#!/bin/bash
#
# Create a post for Jekyll
# Configuration
EDITOR='Atom'
DATE=`date +%Y-%m-%d`
DOCFORMAT='md' # Without Point (!)
DIRECTORY='./_posts/'
@Phlow
Phlow / jeykll-post-counter.liquid
Last active November 22, 2019 00:27
Counter: This code snippet just counts your jekyll posts and spits out the result
{% comment %}
*
* Counter: This include counts your jekyll posts
*
{% endcomment %}{% assign counter = 0 %}{% for item in site.posts %}{% unless item.published == false %}{% assign counter=counter | plus:1 %}{% endunless %}{% endfor %}{{ counter }}
@Phlow
Phlow / jekyll-loop-all-collections.liquid
Created December 26, 2015 13:20
Loop through all collections of a Jekyll website
{% for c in site.collections %}
{% assign docs=c[1].docs %}
{% for doc in docs %}
// do something
{% endfor %}
{% endfor %}
@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);
}