Skip to content

Instantly share code, notes, and snippets.

@lexrus
lexrus / ForkWeeklyReport.sh
Last active November 28, 2023 09:58
Fork custom command which export weekly report of current git user.
cd $path
DATE=`date -v-6d +"%Y-%m-%d"`
AUTHOR=`git config user.name`
LOG=`git log --branches --pretty=format:"\n%ad: %s" --date=short --after=$DATE --author="$AUTHOR"`
CHANGES=`git log --branches --date=short --after=$DATE --author="$AUTHOR" --pretty=tformat: --numstat | awk '{ add += $1; subs += $2; loc += $1 - $2 } END { printf "本周贡献代码: +%s行, -%s行, 总行数: %s\n", add, subs, loc }' -`
WEEKSTART=`date -v"monday" +"%-m月%d"`
TODAY=`date +"%-m月%d"`
REPORT="【周报】$WEEKSTART ~ $TODAY \n\n$CHANGES\n$LOG\n"
@chaomai
chaomai / check_time_and_mv.sh
Created November 12, 2020 03:05
check google takeout images, set a time for those without timestamp, and move them to destination directory
#!/usr/bin/env bash
function set_ts() {
local f=$1
dto=$($GNUBIN_COREUTILS/date -d "$dir_t" "+%Y:%m:%d 00:00:00")
echo exiftool -datetimeoriginal="$dto" "$f"
exiftool -datetimeoriginal="$dto" "$f"
local dest_path=$dest_dir/$dir_d
@marco79cgn
marco79cgn / spotify-now-playing.js
Last active May 2, 2024 15:22
A Scriptable iOS widget that shows what‘s playing on Spotify
let spotifyCredentials
let widget = await createWidget()
Script.setWidget(widget)
Script.complete()
async function createWidget() {
let widget = new ListWidget()
let spotifyIcon = await getImage("spotify-icon.png")
widget.backgroundColor = new Color("1e2040")
@joshbuchea
joshbuchea / semantic-commit-messages.md
Last active May 3, 2024 15:55
Semantic Commit Messages

Semantic Commit Messages

See how a minor change to your commit message style can make you a better programmer.

Format: <type>(<scope>): <subject>

<scope> is optional

Example