Skip to content

Instantly share code, notes, and snippets.

View johnashu's full-sized avatar

John Ashurst - Maffaz.eth johnashu

View GitHub Profile
@345161974
345161974 / splashscreen_demo_1.py
Created March 15, 2017 13:02
PyQt SplashScreen Demo
from PyQt4.QtCore import *
from PyQt4.QtGui import *
import time
class Form(QDialog):
""" Just a simple dialog with a couple of widgets
"""
def __init__(self, parent=None):
super(Form, self).__init__(parent)
@rsheldiii
rsheldiii / chess.py
Created June 26, 2012 04:07
chess program for python
"""CONVENTIONS:
positions are done row-column from the bottom left and are both numbers. This corresponds to the alpha-number system in traditional chess while being computationally useful. they are specified as tuples
"""
import itertools
WHITE = "white"
BLACK = "black"
@ringe
ringe / file1.rb
Created May 4, 2012 10:18
Find and extract every email address from IMAP folder
chars = %w{ | / - \\ }
def find_all_email_addresses_in(base_folder)
# Bash goodness :P
a=`find #{base_folder} -type d -name cur`.split("\n") +`find #{base_folder} -type d -name new`.split("\n")
@emails=[]
# http://stackoverflow.com/questions/535644/find-email-addresses-in-large-data-stream
a.each do |folder|
Dir[folder+"/*"].each do |email|
content = File.read(email)
r1 = Regexp.new(/(((From|^To|Cc):.*<)\b[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,4}\b(>))/)