Skip to content

Instantly share code, notes, and snippets.

View cmartello's full-sized avatar

cmartello cmartello

  • Earth
View GitHub Profile
@cmartello
cmartello / clues.py
Created June 28, 2011 14:37 — forked from anonymous/clues.py
Current candidates
from sqlite3 import connect
db = connect('All Sets-2011-06-19.db')
mechanics = ['Banding', 'Rampage', 'Cumulative Upkeep', 'Living Weapon', 'Phasing', 'Flanking', 'Storm', 'Affinity', 'Buyback', 'Soulshift', 'Kicker', 'Multikicker', 'Modular', 'Cycling', 'Storm', 'Madness', 'Threshhold', 'Ripple', 'Devour', 'Battle Cry', 'Infect', 'Rebound', 'Cascade', 'Champion', 'Reinforce', 'Provoke', 'Sunburst', 'Frenzy', 'Gravestorm', 'Retrace', 'Annihilator', 'Evoke', 'Hideaway', 'Totem Armor', 'Transmute', 'Ninjutsu', 'Split Second', 'Absorb', 'Convoke', 'Entwine', 'Bushido', 'Soulshift', 'Wither', 'Recover']
# get a list of cards that have been in a core set
corecards = set([x[0] for x in db.execute("SELECT name FROM published WHERE expansion IN ('A', 'B', 'U', 'RV', '4E', '5E', '6E', '7E', '8ED', '9ED', '10E', 'M10', 'M11')")])
# get a list of cards from sets that maro worked on but didn't lead
@cmartello
cmartello / mkpics.py
Created October 20, 2011 08:43
quick tool to create pngs from a minecraft savefile
# ./mcmap ~/.minecraft/saves/207.191.202.180 -file defakto-2011-10-14-west.png -north
from time import strftime
from os import system
when = strftime('%Y-%m-%d-%H%M')
for direction in ['north', 'south', 'east', 'west']:
system('./mcmap ~/.minecraft/saves/207.191.202.180 -file defakto-' + when + '-' + direction + '.png -' + direction)
system('./mcmap ~/.minecraft/saves/207.191.202.180 -cave -file defakto-' + when + '-' + direction + '-cave.png -' + direction)
@cmartello
cmartello / gofirst.py
Created September 20, 2012 18:31
"Go First Dice" implemented and tested.
# see : http://www.guardian.co.uk/science/alexs-adventures-in-numberland/2012/sep/18/puzzler-go-first-dice
from random import randint, shuffle
from itertools import product
dice = [[1, 8, 11, 14, 19, 22, 27, 30, 35, 38, 41, 48], [2, 7, 10, 15, 18, 23, 26, 31, 34, 39, 42, 47], [3, 6, 12, 13, 17, 24, 25, 32, 36, 37, 43, 46], [4, 5, 9, 16, 20, 21, 28, 29, 33, 40, 44, 45]]
def test():
"""Runs a test to make sure that the dice are fair. a = test() should
give :
@cmartello
cmartello / mergentr.py
Created June 4, 2017 13:48
Takes a directory of screenshots taken by NTR and stitches them together.
"""NTR for 3DS screenshots are dumped into two seperate files (top_ and bot_) and stored
in .bmp format. This script lets you merge those files into one (as a .png) fairly quickly.
Some caveats:
- This script is not clever and will not protect you from yourself. It pretty much expects
these files to be exactly 400x240 and 320x240 BMPs in RGB format. Anything else will
probably crash it.
- NTR has a habit of truncating screenshots randomly. As such, some files will be malformed
and the first point will apply.
Some good news though, this process takes a little over a minute for 140 odd screenshots, so
you won't be waiting long for your output. Also my one test run took my storage from 70 megs
Mi4wMDQyfHwxNTAyOTQ3ODQyNTExOzE0ODAxNzIzMDIyMDM7MTUwNDE3NDQ1MDE3NDtzcG9vazttcWFzZHzDpcKwwoAIfDEuMDczMzM0NzE5Nzc2NzA4NGUrMzU7OC40NDQzNDE2MDg2NjQ4ODFlKzM1Ozg3MzEwMTsyMzkzOTszLjcyMDU3MDEwNDM4NTM4MzVlKzM1OzY1MTs0OzE4OzEuMzI5NzgxNDIxMjExODU4ZSszNjswOzEwOzA7MDstMTsxNjs0NDE7NC42MDk4OTk4OTgzOTg3MzRlKzMyOzEzMDsxNDszNTs0NDc4ODQ7NTtmb29sczswOzA7MTA5OTY2NDIwOzc4MzEzNDE4OzMxNjUzMDAyOzA7MDszMjI7MTg5OzUyOzUzOzg2OzIyOzE1OzEwOzA7MDswOzA7MDsyMTsxNTA0MTU0NTk3NzM5O3w1MzAsODgwLDYuODcwODUzODY5ODA2ZSszMSw2OzUyMCw4NzAsNS40ODIxMjEyODEyNjA5NjhlKzMwLDA7NTAwLDg1MCw3LjY3MDYyNDc4NDM2OTIzZSszMCwwOzQ5MCw4NDAsNC41NDk0MDk3NzI2NDYxMzVlKzMyLDA7NDYwLDgxMCw5LjUxMDc0MDE1OTkzNzY3ZSszMSwwOzQ1MCw4MDAsMi42MDYxNTc1MzY1NDAxNTdlKzMxLDA7NDMwLDc4MSwxLjAzOTEyMzA5MDU1MjA1NDllKzMyLDA7NDEwLDc2MCw0Ljc5NjgyMzEwOTU3MTg5N2UrMzEsMDs0MDAsNzUwLDIuMDQ5NjA2NTQwNTc1NjY3M2UrMzEsMDszODAsNzMwLDEuMDM1NDE5MTA5MjUxNTE0OGUrMzIsMDszNTAsNzAwLDUuNTgwNzU4OTcwNDQyNjA5ZSszMiwwOzM0MCw2OTAsMy4zMTcxMTI0NjQ1MjUzMjdlKzMzLDA7MzIwLDY3MCwyLjY2NDk5OTIzMjkxODMwNzdlKzM0LDA7MzEwLDY2MCw4Ljg
"""This is a simple script I originally wrote for finding solutons in
the "wordscapes" program; it presents you with a series of letters
that you unjumble in various manners to form words which are
then arranged on an empty crossword puzzle.
Currently, it'll search a supplied dictionary for possible words, but on
my TODO list is to add functionality to seach for patterns and
lengths of words.
"""
<HTML>
<HEAD>
<TITLE>tick tock</TITLE>
<SCRIPT>
var x = 0;
var z = 1325 / 3600
function rightnow() {
var out = document.getElementById("write");