Skip to content

Instantly share code, notes, and snippets.

import pygame
from random import randint
class Player():
def __init__(self, player, it, x, y, width, height, sprite):
players.append(self)
self.player = player
self.it = it
from random import randint
from random import choice
from time import sleep
class Settings:
"""Configure the settings for the current game session"""
def __init__(self):
# operator = + - * /
self.operator = self.set_operator()
@mikemedina
mikemedina / AtlasPediaToCSV.js
Created December 12, 2015 18:23
Pulls the currently generated unit stats from AtlasPedia for Artillery's new RTS
var getTableData = function(originalTable) {
var tableData = [];
var tableCols = originalTable.rows[0].children.length
var tableRows = originalTable.rows.length
for (var i = 0; i < tableCols; i++) {
var tempRow = []
for (var j = 0; j < tableRows; j++) {
tempRow.push(originalTable.rows[j].children[i].innerText);
}
tableData.push(tempRow)
@mikemedina
mikemedina / magic_gui.pyw
Last active August 29, 2015 14:21
Magic: The Gathering HUD
# To Do
#
# 1. Implement menu button
# a. A way to add players on the fly
# b. Player color picker
# i. Error checking on color entry
# 2. An 'X' to remove a player panel
# 3. Fix documentation and indentation
# 4. Fix frm_menu columnspan
# 5. Fix win label overlap when single digit health
@mikemedina
mikemedina / download_calls.py
Last active October 8, 2015 12:00
Call Downloader
import datetime
import getpass
import os
import shutil
import time
from selenium import webdriver
from selenium.common.exceptions import NoSuchElementException
from selenium.webdriver.common.keys import Keys
from selenium.webdriver.firefox.firefox_binary import FirefoxBinary
@mikemedina
mikemedina / wallpapers.py
Created February 1, 2015 23:17
Uses PRAW to download wallpapers from r/wallpapers and r/minimalwallpapers
from urllib.request import urlretrieve
import praw
# ID for Reddit to monitor
user_agent = ("Wallpaper Downloader v1.0 by /u/80blite")
r = praw.Reddit(user_agent=user_agent)
# Subreddit objects
wall_top_ten = r.get_subreddit('wallpapers').get_hot(limit=10)
@mikemedina
mikemedina / Flatten.py
Last active August 29, 2015 14:13
Takes an origin directory and a destination directory from a browse window and allows the user to either flatten the origin directory in place or into the destination directory.
#!usr/bin/env/python
from os import walk, remove
from os.path import normpath, join
from tkinter import *
from tkinter.filedialog import askdirectory
from shutil import copy2, rmtree, move, Error as ShutilError
def flatten(origin, destination, in_place, rmv_empty_dirs=False):
"""Flattens the origin directory into the destination directory or itself"""