Skip to content

Instantly share code, notes, and snippets.

View regispires's full-sized avatar

Regis Pires Magalhaes regispires

View GitHub Profile
@regispires
regispires / colab_gpu_pytorch.py
Last active April 13, 2025 14:06 — forked from ronaldseoh/colab_gpu_pytorch.py
Google Colaboratory PyTorch GPU/TPU Setup - Automatically switch between GPUs and CPUs. I make the code here the second cell to run on all the Colab notebooks.
'''
MIT License
Copyright (c) 2020 Ronald Seoh
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
@regispires
regispires / SimpleHTTPServerWithUpload.py
Created June 4, 2019 12:02 — forked from touilleMan/SimpleHTTPServerWithUpload.py
Simple Python Http Server with Upload - Python3 version
#!/usr/bin/env python3
"""Simple HTTP Server With Upload.
This module builds on BaseHTTPServer by implementing the standard GET
and HEAD requests in a fairly straightforward manner.
see: https://gist.github.com/UniIsland/3346170
"""