See how a minor change to your commit message style can make you a better programmer.
Format: <type>(<scope>): <subject>
<scope> is optional
| bump_version () { | |
| git fetch origin | |
| git checkout develop | |
| git pull origin develop | |
| npm version patch --no-git-tag-version | |
| VERSION=$(grep -m1 version package.json | awk -F: '{ print $2 }' | sed 's/[", ]//g') | |
| git commit package.json -m "chore(package): Bump version up to $VERSION" | |
| git push origin develop | |
| git checkout master | |
| git pull origin master |
Last updated March 13, 2024
This Gist explains how to sign commits using gpg in a step-by-step fashion. Previously, krypt.co was heavily mentioned, but I've only recently learned they were acquired by Akamai and no longer update their previous free products. Those mentions have been removed.
Additionally, 1Password now supports signing Git commits with SSH keys and makes it pretty easy-plus you can easily configure Git Tower to use it for both signing and ssh.
For using a GUI-based GIT tool such as Tower or Github Desktop, follow the steps here for signing your commits with GPG.
See this issue.
Docker best practise to Control and configure Docker with systemd.
Create daemon.json file in /etc/docker:
{"hosts": ["tcp://0.0.0.0:2375", "unix:///var/run/docker.sock"]}
| version: '3' | |
| services: | |
| app: | |
| image: nginx:alpine | |
| ports: ["80:80"] | |
| restart: unless-stopped | |
| restarter: | |
| image: docker:cli | |
| volumes: ["/var/run/docker.sock:/var/run/docker.sock"] |
| -- run first thing in the morning, e.g., from cron | |
| tell application "Things3" | |
| set theToken to "your-auth-token" | |
| set theTodos to to dos of list "Today" | |
| repeat with aTodo in theTodos | |
| set tagList to tags of aTodo | |
| repeat with aTag in tagList | |
| if (name of aTag as text) is "Evening" |
| #!/bin/sh | |
| git filter-branch --env-filter ' | |
| OLD_EMAIL="[email protected]" | |
| CORRECT_NAME="Ayo" | |
| CORRECT_EMAIL="[email protected]" | |
| if [ "$GIT_COMMITTER_EMAIL" = "$OLD_EMAIL" ] | |
| then | |
| export GIT_COMMITTER_NAME="$CORRECT_NAME" | |
| export GIT_COMMITTER_EMAIL="$CORRECT_EMAIL" |
| procedure squarify(list of real children, list of real row,real w) | |
| begin | |
| real c = head(children); | |
| if worst(row, w) ≤ worst(row++[c], w) then | |
| squarify(tail(children), row++[c], w) | |
| else | |
| layoutrow(row); | |
| squarify(children, [], width()); | |
| fi | |
| end |
| function squarify (children, row, width) { | |
| if (children.length === 1) { | |
| layoutLastRow(row, children, width) | |
| return | |
| } | |
| const rowWithChild = [...row, children[0]] | |
| if (row.length === 0 || worst(row, width) >= worst(rowWithChild, width)) { |
| REMOTE=origin | |
| BRANCH=$(git rev-parse --abbrev-ref HEAD) | |
| BATCH_SIZE=10 | |
| # check if the branch exists on the remote | |
| # if git show-ref --quiet --verify refs/remotes/$REMOTE/$BRANCH; then | |
| # # if so, only push the commits that are not on the remote already | |
| # range=$REMOTE/$BRANCH..HEAD | |
| # else | |
| # # else push all the commits |