Skip to content

Instantly share code, notes, and snippets.

Avatar
🐙
🎛️ 🔊

Moritz »mo.« Sauer Phlow

🐙
🎛️ 🔊
View GitHub Profile
@Phlow
Phlow / #Liquid #Jekyll List Archive by Year
Last active Aug 29, 2015
#Jekyll Archivseite nach Jahren sortiert
View #Liquid #Jekyll List Archive by Year
{% comment %}
*
* List Archive by Year
*
{% endcomment %}
<section id="archive">
<h3>This year's posts</h3>
{%for post in site.posts %}
{% unless post.next %}
<ul class="this">
@Phlow
Phlow / Phlow Index Webseite
Last active Aug 8, 2022
Phlow Index Webseite #HTML
View Phlow Index Webseite
<!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>Phlow</title>
<style>
body {
background: #222;
color: #fabb00;
@Phlow
Phlow / Phlow Index Webseite V2
Last active Aug 8, 2022
Phlow Index Webseite V2 #HTML
View Phlow Index Webseite V2
<!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>Startseite</title>
<link href='http://fonts.googleapis.com/css?family=Roboto:900,300,700' rel='stylesheet' type='text/css'>
<style type="text/css">
@Phlow
Phlow / for-loop-sorted-collection
Last active Apr 20, 2022
This Liquid loop for Jekyll sorts a collection by date in reverse order
View for-loop-sorted-collection
{% comment %}
*
* This loop loops through a collection called `collection_name`
* and sorts it by the front matter variable `date` and than filters
* the collection with `reverse` in reverse order
*
* To make it work you first have to assign the data to a new string
* called `sorted`.
*
{% endcomment %}
@Phlow
Phlow / Loop through all pages of all collections
Created Jul 28, 2015
Loop through all pages of all collections
View Loop through all pages of all collections
{% comment %}
#
# Loop through all pages of all collections
#
{% endcomment %}
{% for c in site.collections %}
{% assign docs=c[1].docs %}
{% for doc in docs %}
// do something
{% endfor %}
@Phlow
Phlow / MySQL Queries When Moving WordPress.sql
Last active May 6, 2020
MySQL Queries When Moving WordPress
View MySQL Queries When Moving WordPress.sql
/*
There's a better tool https://interconnectit.com/products/search-and-replace-for-wordpress-databases/
MySQL Queries When Moving WordPress
To use this snippet, you have to:
1. Change the table prefix according your installation. In the example it's: wp_
2. Change http://old-domain.com to your old domain.
@Phlow
Phlow / batch_download.sh
Last active Aug 29, 2015
Batch Download via Terminal with explanation
View batch_download.sh
#
# 1. Download file › batch_download.sh
# 2. Edit file › URLs for wget to download
# 3. With -O you can rename the output file
# 4. Change permissions of file $ chmod 755 batch_download.sh
# 5. Start the batch $ ./batch_download.sh
#
wget https://archive.org/compress/kpu008 -O kpu008.zip
wget https://archive.org/compress/kpu009 -O kpu009.zip
@Phlow
Phlow / rename-files.sh
Created Aug 15, 2015
A collection of methods to rename files in terminal
View rename-files.sh
#
# Rename multiple files and replace name with number and prefix
# %02 › digits of numbers (increase when lots of files)
#
# counter=1
# for i in *.*
# do new=$(printf "%02d.jpg" "$counter")
# mv -- "$i" "screenshot-realaudio-$new"
# let counter=counter+1
# done
@Phlow
Phlow / rename-files-and-replace.sh
Last active Sep 30, 2015
Rename files and replace text with new text
View rename-files-and-replace.sh
# Rename file and replace OLDTEXT with NEWTEXT
# for filename in *.jpg; do mv "$filename" "${filename//OLDTEXT/NEWTEXT}"; done
# replace large with nothing
for filename in *.jpg; do mv "$filename" "${filename//large/}"; done
for filename in *.xml; do mv "$filename" "${filename//_meta.xml/.md}"; done
@Phlow
Phlow / wordpress-downloader.sh
Last active May 25, 2020
Batch Script – Download, Extract, Prepare WordPress and Plugins
View wordpress-downloader.sh
# This script fetches WordPress plus some plugins with Wget,
# extracts everything, removes clutter and moves plugins into
# the right places.
#
# Option -e prints escape sequences like breaks \n
#
reset='\x1B[0m'
green='\x1b[0;32m'
yellow='\x1b[0;33m'