Skip to content

Instantly share code, notes, and snippets.

@allisontharp
allisontharp / gumain.py
Created November 21, 2015 18:36
gumain.py
# coding: utf-8
import ui
from random import shuffle
from datetime import datetime
global count
count = [0]
def new_game(sender):
global nums, startTime, cards, final
@allisontharp
allisontharp / Pic18f24k20 30 second LED script
Created January 24, 2016 21:24
C++ script for Pic18f24k20 microcontroller that illuminates an LED on pin RA1 for approximately 30 seconds
//******************************************************************************
//Software License Agreement
//
//The software supplied herewith by Microchip Technology
//Incorporated (the "Company") is intended and supplied to you, the
//Company’s customer, for use solely and exclusively on Microchip
//products. The software is owned by the Company and/or its supplier,
//and is protected under applicable copyright laws. All rights are
//reserved. Any use in violation of the foregoing restrictions may
//subject the user to criminal sanctions under applicable laws, as
import glob
from PIL import Image, ImageDraw, ImageFont, PdfImagePlugin, _imaging
from math import ceil
from pyPdf import PdfFileReader,PdfFileWriter
import os
from datetime import datetime
import tkFileDialog
startTime = datetime.now()
@allisontharp
allisontharp / boardgameplays_SQLITE.py
Last active May 8, 2016 22:21
Added more commenting and the ability to create the database if it does not already exist
from boardgamegeek import BoardGameGeek
from datetime import datetime
import sqlite3, re, unicodedata
# # # Notes:
# This script pulls board game play data from www.boardgamegeek.com and places it in a SQLite database.
# To use it:
# 1. Save this file as a .py file in the folder where you would like the database to be created
# 2. Set the board game geek (BGG) username variable, bgg_username, to be the username of the
# BGG profile with which you would like to colect the data.
# -*- coding: utf-8 -*-
"""
Created on Thu Apr 21 19:11:44 2016
@author: Allison
"""
import numpy as np
from sklearn.datasets import load_iris
from sklearn import tree
# This script generates a list of all of the new games you play in a month with a specific person (your partner).
# An example output is available here: https://boardgamegeek.com/geeklist/201514/item/4608920#item4608920
# More information on this script can be found at www.techtrek.io
from boardgamegeek import BoardGameGeek
from collections import Counter
import datetime, unicodedata
def strip_accents(s):
return ''.join(c for c in unicodedata.normalize('NFD', s)
# -*- coding: utf-8 -*-
"""
Created on Mon May 09 19:58:56 2016
@author: Allison
In SQLite, to select for a certain month, do this:
select * from collection where strftime('%m', date) = strftime('%m', julianday('2016-03-01'));
select games.name, collection.owned from games join collection on games.bggid = collection.bggid order by owned desc limit 10;
from boardgamegeek import BoardGameGeek
import sqlite3, unicodedata
##### Functions
def numtopgames(usr):
### Number of games in top X for specific user
print "Top X Games:"
top = raw_input()
query = """ SELECT games.bggid FROM games
# -*- coding: utf-8 -*-
"""
Created on Mon May 09 19:58:56 2016
@author: Allison
In SQLite, to select for a certain month, do this:
select * from collection where strftime('%m', date) = strftime('%m', julianday('2016-03-01'));
select games.name, collection.owned from games join collection on games.bggid = collection.bggid order by owned desc limit 10;
from xml.dom.minidom import parse
import matplotlib.pyplot as plt
import sqlite3, urllib2, unicodedata, time
import numpy as np
import sys
def strip_accents(s):
return ''.join(c for c in unicodedata.normalize('NFD', s)
if unicodedata.category(c) != 'Mn')