Push backwards current HEAD, uncommitting last commit but keeping files
git reset HEAD^
Reset to a past HEAD, removing unpushed changes (hard) or keeping modified files (soft)
#!/bin/bash | |
for branch in $(git branch | grep -v master | grep -v '*') | |
do | |
branch_pr_status=$(gh pr view $branch | grep 'state:' | awk '{print $2}') | |
if [[ $branch_pr_status ]] | |
then | |
echo "$branch is $branch_pr_status" | |
if [[ "$branch_pr_status" == "MERGED" ]] | |
then |
#!/bin/bash | |
# Link/copy this file to your bin folder so you can run this easily | |
# | |
# ln -s $PWD/status.sh ~/.local/bin/status | |
pyfiles=$(git status -s | grep -vE '^ ?[DR] ' | awk {'print $2'} | grep '.py') | |
if [[ $pyfiles ]] | |
then |
# Get files from this gist (wkhtmltoimage is optional) | |
wget https://gist.github.com/jaumef/9eb558ac976b2a80269cc51ca8c97087/raw/8d5ceafea1dd387a83eb7eaa699354819b6910d7/wkhtmltopdf | |
# Set permissions | |
chmod +x wkhtmltopdf | |
# Move/copy the files to local binaries (/usr/local/bin) | |
sudo mv wkhtmltopdf /usr/local/bin/ |
# -*- encoding: utf-8 -*- | |
import base64 | |
x = '123456789'*30 | |
# x = '123456789123456789123456789123456789123456789123456789123456789123456789123456789123456789123456789123456789123456789123456789123456789123456789123456789123456789123456789123456789123456789123456789123456789123456789123456789123456789123456789123456789123456789123456789' | |
base64.encodestring(x) | |
# 'MTIzNDU2Nzg5MTIzNDU2Nzg5MTIzNDU2Nzg5MTIzNDU2Nzg5MTIzNDU2Nzg5MTIzNDU2Nzg5MTIz\nNDU2Nzg5MTIzNDU2Nzg5MTIzNDU2Nzg5MTIzNDU2Nzg5MTIzNDU2Nzg5MTIzNDU2Nzg5MTIzNDU2\nNzg5MTIzNDU2Nzg5MTIzNDU2Nzg5MTIzNDU2Nzg5MTIzNDU2Nzg5MTIzNDU2Nzg5MTIzNDU2Nzg5\nMTIzNDU2Nzg5MTIzNDU2Nzg5MTIzNDU2Nzg5MTIzNDU2Nzg5MTIzNDU2Nzg5MTIzNDU2Nzg5MTIz\nNDU2Nzg5MTIzNDU2Nzg5MTIzNDU2Nzg5MTIzNDU2Nzg5MTIzNDU2Nzg5\n' | |
print (base64.encodestring(x)) | |
output = """ | |
MTIzNDU2Nzg5MTIzNDU2Nzg5MTIzNDU2Nzg5MTIzNDU2Nzg5MTIzNDU2Nzg5MTIzNDU2Nzg5MTIz |