Skip to content

Instantly share code, notes, and snippets.

View CloverFeywilde's full-sized avatar
🏠
Working from home

Clover Feywilde CloverFeywilde

🏠
Working from home
  • Atlanta, GA
View GitHub Profile
@CloverFeywilde
CloverFeywilde / trim_slow_gif.txt
Created August 22, 2018 16:50
Remove every other frame & slow down gif animation in Linux
#Get the number of frames from the gif:
identify -format "%n\n" path/to/file.gif | head -1
#Use gifsicle to cut frames. replace 99 with total frames.
gifsicle -U input.gif `seq -f "#%g" 0 2 99` -O2 -o output.gif
#Delay gif via gifsicle by first finding the delay between frames, double it
gifsicle -I input.gif
#Proceed to delay. Replace 50 with the doubled number
gifsicle --delay 50 in.gif > out.gif
@CloverFeywilde
CloverFeywilde / zeroBegone.txt
Created August 22, 2018 17:02
Batch Remove or Replace characters from file names
#For use with a set of sequential files that contain extra zeroes. ex: file001.jpg, file002.jpg, file003.jpg ect.
#Replace <firstPartOfName> with everything up until the bit you want to remove. No brackets.
#replace <removeThis> with what you need removed, <replaceWithThis> for what you want in its place.
#You can leave <replaceWithThis> blank if you simply want to remove.
for file in <firstPartOfName>*; do
new_name=$(echo "$file" | sed -E -e 's/<removeThis>+/<replaceWithThis>/')
mv "$file" "$new_name"
done