Skip to content

Instantly share code, notes, and snippets.

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

Ricardo Rodrigues rickkk856

🏠
Working from home
View GitHub Profile
@korakot
korakot / draw.py
Last active March 28, 2025 11:38
Drawing on Google Colab
from IPython.display import HTML, Image
from google.colab.output import eval_js
from base64 import b64decode
canvas_html = """
<canvas width=%d height=%d></canvas>
<button>Finish</button>
<script>
var canvas = document.querySelector('canvas')
var ctx = canvas.getContext('2d')
@loisaidasam
loisaidasam / rename_images.py
Created August 7, 2012 22:06
Rename images for use by ImageMagick convert or ffmpeg convert
# Goes a little something like this:
import os
files = [ f for f in os.listdir('.') if os.path.isfile(os.path.join('.',f)) and f.endswith('.jpg') ]
for i, file in enumerate(sorted(files)):
os.rename(file, 'image%03d.jpg' % i)
# Now with them renamed you can do something like: