Beide Seiten, vorherige ÜberarbeitungVorherige ÜberarbeitungNächste Überarbeitung | Vorherige ÜberarbeitungNächste ÜberarbeitungBeide Seiten, nächste Überarbeitung |
snippets [2017/09/15 09:32] – add git aliases ojdo | snippets [2018/03/13 14:13] – [Git aliases] add lb ojdo |
---|
===== Convert pictures to lower resolution in subfolder ===== | ===== Convert pictures to lower resolution in subfolder ===== |
| |
**Bash** ''mkdir export && magick mogrify -resize 3000x3000 -quality 80 -path export *.jpg'' | Using [[http://imagemagick.org/script/index.php|ImageMagick]] (version 7), this is a handy one-liner, ready to be integrated into an only slightly longer script, moving the result to a fixed, desired output location: |
| |
**PowerShell** ''mkdir export; magick mogrify -resize 3000x3000 -quality 80 -path export *.jpg'' | ==== Bash ==== |
| <code bash>mkdir export && magick mogrify -resize 3000x3000 -quality 80 -path export *.jpg</code> |
| |
| ==== PowerShell ==== |
| |
| <code bash>mkdir (get-item $PWD).Name; magick mogrify -resize 3000x3000 -quality 80 -path (get-item $PWD).Name *.jpg</code> |
| |
===== Git aliases ===== | ===== Git aliases ===== |
| |
Heavy-branching-capable ''lg'' command. Not as commonly used ''ls'' short (no graph) and ''ll'' long (file stats) forms. ''la'' is nice in that it lists all aliases. I hardly remember the ''d'' and ''dc'' aliases, sadly. But then, typing them out does not hurt too much. | Heavy-branching-capable ''lg'' command. Not as commonly used ''ls'' short (no graph) and ''ll'' long (file stats) forms. ''la'' is nice in that it lists all aliases. Saying ''git dc'' instead of ''git diff --cached'' for a commit preview is very nice. I hardly remember the ''git d'' instead of ''git diff'', though. But then, typing that out does not hurt too much. Newcomer: ''lb'' lists all local branches, together with its latest commit. It's designed to look similar to the output of ''lg''. I might extend it to output remotes in red; it already can list them by calling ''git lb refs/remotes''. |
| |
<code> | <code ini> |
[alias] | [alias] |
lg = log --pretty=tformat:'%C(auto)%h %C(dim white)%cd %Creset%<(50,trunc)%s %C(bold blue)%aN%Creset%C(auto)%w(0,0,7)%+d%Creset' --decorate --graph --abbrev-commit --date=short | lg = log --pretty=tformat:'%C(auto)%h %C(dim white)%cd %Creset%<(50,trunc)%s %C(bold blue)%aN%Creset%C(auto)%w(0,0,7)%+d%Creset' --decorate --graph --abbrev-commit --date=short |
d = diff | d = diff |
dc = diff --cached | dc = diff --cached |
| lb = for-each-ref --format='%(align:50,left)%(color:bold green)%(refname:short)%(color:reset)%(end)%0a %(color:dim green)%(objectname:short)%(color:reset) %(color:dim cyan)%(authordate:short)%(color:reset) %(color:cyan)%(authorname)%(color:reset) %(subject)%0a' --sort=-authordate refs/heads/ |
la = "!git config -l | grep "^alias" | cut -c 7-" | la = "!git config -l | grep "^alias" | cut -c 7-" |
</code> | </code> |
| |