Skip to content

Instantly share code, notes, and snippets.

View icarovirtual's full-sized avatar
🐕
É o Bubu Show

Ícaro icarovirtual

🐕
É o Bubu Show
View GitHub Profile
@icarovirtual
icarovirtual / is_platypus.py
Last active July 7, 2019 14:33
guard clauses: bad example
# Sorry for the silly example
def is_platypus(self):
if self.is_mammal():
if self.has_fur():
if self.has_beak():
if self.has_tail():
if self.can_swim():
# It's a platypus!
return True
# Not a platypus
@icarovirtual
icarovirtual / thumbfromvid.sh
Created May 31, 2019 18:47
Create a thumbnail from a frame of a video URL using ffmpeg
ffmpeg -itsoffset -4 -i "https://scontent.xx.fbcdn.net/v/t50.12441-16/61340994_435915640302058_n.mp4?_nc_cat=106&_nc_ht=scontent.xx&oh=19858915f178f4854a789438b3d9d24b&oe=5D5B3C92" -vcodec mjpeg -vframes 1 -an -f rawvideo test.jpg