Skip to content

Instantly share code, notes, and snippets.

@schoblaska
schoblaska / chess_fen.py
Created March 11, 2012 20:09
Chess FEN plugin for Anki, modified to display the board from black's perspective if it is his turn to move: http://uucode.com/blog/2011/06/27/chess-fen-plugin-for-anki/
# chess fen
# Anki plugin to generate chess diagramms
# ===========================================================
#
# The plugin converts "fen" tag to a corresponding image.
#
# The original text:
#
# :: Do you like this position?
# :: [fen]rnbqkbnr/pppppppp/8/8/8/8/PPPPPPPP/RNBQKBNR w KQkq - 0 1[/fen]
# This is a blog post I wrote almost two years ago. It was some of the first Ruby I ever uttered, and not
# entirely useful or elegant, but I'm reposting it now because I recently received a requst for it.
# Ruby on Rails: Working With a Legacy Database With a Non-Integer Primary Key
# For a project I'm currently working on, I needed to get my Rails application to work with a legacy
# database that used a non-integer primary key (in this case, a field called "loginID", which is basically
# a username). First, I tried to use "set_primary_key" to define my PK, but Rails was having none of that.