Skip to content

Instantly share code, notes, and snippets.

View smohammadhn's full-sized avatar
😉
Time for a change

S.Mohammad Hosseininejad smohammadhn

😉
Time for a change
View GitHub Profile
@smohammadhn
smohammadhn / gist:256786b34756f691717c1bf0d5fbbd27
Created April 22, 2024 15:15
Git delete all merged branches locally (except main and develop)
git branch --merged | egrep -v "(^\*|main|develop)" | xargs git branch -d
@smohammadhn
smohammadhn / gist:6b33aa4664c1b6253337e2656156039f
Created March 1, 2024 12:27
ffmpeg command to convert any video to a format which is widely known by older devices (Tvs, etc ...)
ffmpeg -i input.mp4 -vf "fps=24" -c:v libx264 -crf 23 -maxrate 2M -bufsize 2M -c:a aac -b:a 192k output.mp4
def change(string):
arr = ""
for char in string:
if char == "0":
arr += "1"
else:
arr += "0"
return arr