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 / 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 / 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-add-suffix.sh
Created Sep 23, 2015
Rename files and add a suffix
View rename-files-and-add-suffix.sh
for file in *; do mv $file `basename $file `.md; 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 / rename-files-with-date.sh
Created Oct 11, 2015
Rename files and use their date
View rename-files-with-date.sh
#!/bin/bash
# Copy MP3 files in a directory to a new name based solely on creation date
# FROM: foo.mp3 Created on: 2012-04-18 18:51:44
# TO: 20120418_185144.mp3
for i in *.mp3
do
# mod_date=$(stat -c "%y" "$i"|sed 's/\..*$//')
# mod_date=$(stat -c "%y" "$i"|awk '{print $1"_"$2}'|sed 's/\..*$//')
mod_date=$(stat --format %y "$i"|awk '{print $1"_"$2}'|cut -f1 -d'.'|sed 's/[: -]//g')
cp "$i" "$mod_date".mp3
@Phlow
Phlow / screenshot-optimizer.sh
Last active Oct 11, 2015
Shell-Script renaming screenshots, making thumbnails and optimizing images with ImageOptim
View screenshot-optimizer.sh
#
# Rename Screenshots, Make Thumbnails, Optimize Images with Imageoptim
#
clear;
echo -e '\n- - - - - - - - - - - - - - - - -';
echo -e '\n Screenshotter V.1.0 ';
echo -e '\n- - - - - - - - - - - - - - - - -';
# Wenn Variablen gesetzt sind, dann bitte los...
@Phlow
Phlow / .bash_profile
Created Oct 23, 2015 — forked from natelandau/.bash_profile
Mac OSX Bash Profile
View .bash_profile
# ---------------------------------------------------------------------------
#
# Description: This file holds all my BASH configurations and aliases
#
# Sections:
# 1. Environment Configuration
# 2. Make Terminal Better (remapping defaults and adding functionality)
# 3. File and Folder Management
# 4. Searching
# 5. Process Management
@Phlow
Phlow / mailchimp-merge-tags-ansprache
Created Nov 28, 2015
Mailchimp IF ELSEIF Loop für die Ansprache der Empfänger
View mailchimp-merge-tags-ansprache
*|IF:ANSPRACHE = Familie|*
Liebe Familie *|LNAME|*
*|ELSEIF:ANSPRACHE = Ehepaar|*
Liebes Ehepaar *|LNAME|*
*|ELSEIF:ANSPRACHE = Frau|*
*|IFNOT:FNAME|*
Liebe Frau *|LNAME|*
*|ELSE|*
Liebe *|FNAME|*
*|END:IF|*