Skip to content

Instantly share code, notes, and snippets.

View cssence's full-sized avatar

Matthias Zöchling cssence

View GitHub Profile
@cssence
cssence / utf8.sh
Last active March 9, 2016 11:22
Convert text files to UTF-8
#!/usr/bin/env bash
if [[ $1 == -f ]]; then
format="$2"
shift 2
fi
for file in $@; do
iconv -f ${format-"windows-1252"} -t "UTF-8" "$file" > "${file%.*}.utf8.$(echo $file |awk -F . '{if (NF>1) {print $NF}}')"
done
@cssence
cssence / open.sh
Last active March 9, 2016 11:22
Linux equivalent of Mac's "open"
#!/usr/bin/env bash
xdg-open $@ > /dev/null 2>&1 &
@cssence
cssence / git-deploy.sh
Last active March 9, 2016 11:23
git subtree for github pages
#!/usr/bin/env bash
git subtree push --prefix ${2-"public"} ${1-"origin"} gh-pages
@cssence
cssence / git-config.sh
Last active November 12, 2018 05:52
git config --global
#!/usr/bin/env bash
git config --global user.name "$1"
git config --global user.email "$2"
git config --global core.excludesfile ~/.gitignore
git config --global log.date iso
git config --global format.pretty "%C(magenta)%h %C(cyan)%cd %Creset%C(reverse)%s%Creset <%ae>"
git config --global diff.context 0
git config --global alias.st status
git config --global alias.lo "log -n9"
@cssence
cssence / .gitignore
Created December 16, 2014 12:51
.gitignore
*~
.DS_Store