Skip to content

Instantly share code, notes, and snippets.

Avatar
🙄

Santiago Espinosa Saigesp

🙄
View GitHub Profile
@wenbert
wenbert / Python save image from URL
Created Dec 29, 2010
Python save image from URL
View Python save image from URL
import cStringIO # *much* faster than StringIO
import urllib
import Image
try:
file = urllib.urlopen('http://freegee.sourceforge.net/FG_EN/src/teasers_en/t_gee-power_en.gif')
im = cStringIO.StringIO(file.read()) # constructs a StringIO holding the image
img = Image.open(im)
img.save('/home/wenbert/uploaderx_files/test.gif')
except IOError, e:
@sebdah
sebdah / threading_example.py
Last active Jul 5, 2021
Running a background thread in Python
View threading_example.py
import threading
import time
class ThreadingExample(object):
""" Threading example class
The run() method will be started and it will run in the background
until the application exits.
"""
@stephenhardy
stephenhardy / git-clearHistory
Created Apr 26, 2013
Steps to clear out the history of a git/github repository
View git-clearHistory
-- Remove the history from
rm -rf .git
-- recreate the repos from the current content only
git init
git add .
git commit -m "Initial commit"
-- push to the github remote repos ensuring you overwrite history
git remote add origin git@github.com:<YOUR ACCOUNT>/<YOUR REPOS>.git