Skip to content

Instantly share code, notes, and snippets.

View Alexander-Krause-Glau's full-sized avatar

Alexander Krause-Glau Alexander-Krause-Glau

View GitHub Profile
@Alexander-Krause-Glau
Alexander-Krause-Glau / remove-branches.md
Last active December 17, 2018 23:03
Remove all branches by pattern recognition
  1. Clean your list of remote-tracking branches with
git remote update --prune
  1. Show and verify the to-be deleted remote branches (change greenkeeper to your pattern):
git branch -r | grep "greenkeeper" | sed "s/origin\///"
  1. Remove remote branches, where origin is your remote name:
@Alexander-Krause-Glau
Alexander-Krause-Glau / how-to-ubuntu-desktop-shortcut.md
Last active September 22, 2018 09:46
Ubuntu Desktop Shortcut (Eclipse example)
  1. vim ~/.local/share/applications/eclipse.desktop
  2. Inside file, paste
[Desktop Entry]
Name=Eclipse
Type=Application
Exec=/YOUR/PATH/TO/ECLIPSE/EXECUTABLE/eclipse
Terminal=false
Icon=YOUR/PATH/TO/ECLIPSE/ICON/icon.xpm
Comment=Integrated Development Environment
@Alexander-Krause-Glau
Alexander-Krause-Glau / cleanup-vpp.sh
Last active November 5, 2018 08:46
Cleanup all temporary Visual Paradigm files
#!/bin/bash
# macOS: Copy to /usr/local/bin
if [ -d $1 ]; then
find $1 -maxdepth 1 -name \*.bak* -delete
find $1 -maxdepth 1 -name \*.vux* -delete
find $1 -maxdepth 1 -name \*.vbak* -delete
echo "Cleanup done."
else
@Alexander-Krause-Glau
Alexander-Krause-Glau / Keeping-Fork-Up-To-Date.md
Last active September 26, 2018 05:12 — forked from CristinaSolana/gist:1885435
Keeping a fork up to date

1. Clone your fork:

git clone [email protected]:YOUR-USERNAME/YOUR-FORKED-REPO.git

2. Add remote from original repository in your forked repository:

cd into/cloned/fork-repo
git remote add upstream git://github.com/ORIGINAL-DEV-USERNAME/REPO-YOU-FORKED-FROM.git
git fetch upstream
@Alexander-Krause-Glau
Alexander-Krause-Glau / cleanup-latex.sh
Last active November 5, 2018 08:46
Cleanup all LaTex temporary files in a given directory
#!/bin/bash
# macOS: Copy to /usr/local/bin
if [ -d $1 ]; then
find $1 -maxdepth 1 -name \*.pyc -delete
find $1 -maxdepth 1 -name \*.bbl -delete
find $1 -maxdepth 1 -name \*.blg -delete
find $1 -maxdepth 1 -name \*.aux -delete
find $1 -maxdepth 1 -name \*.log -delete
@Alexander-Krause-Glau
Alexander-Krause-Glau / Git-Sparse-Checkout
Last active August 18, 2017 06:47 — forked from sumardi/gist:5559896
Subdirectory checkouts with Git sparse-checkout
# New repository
mkdir <repo> && cd <repo>
git init
git remote add –f <name> <url>
git config core.sparsecheckout true
echo some/dir/ >> .git/info/sparse-checkout
echo another/sub/tree >> .git/info/sparse-checkout
git pull <remote> <branch>
# Existing repository
@Alexander-Krause-Glau
Alexander-Krause-Glau / gist:8d1cccd8834b86f0cedc3bbb2087861c
Last active June 29, 2017 13:08
Sublime Text 3 - Useful Mac Shortcuts (German Layout)

Sublime Text 3 – Useful Shortcuts (MAC)

Loosely ordered with the commands I use most towards the top. Sublime also offer full documentation.

Editing

Ctrl+C copy current line (if no selection)
Ctrl+X cut current line (if no selection)
Ctrl+⇧+K delete line
CMD+↩ insert line after