Skip to content

Instantly share code, notes, and snippets.

@Artanis
Artanis / randmap.py
Created March 18, 2011 21:20
Generates a rectangular, randomized field of characters.
"""Generates a rectangular, randomized field of characters.
Intended to be used in a pathfinding discussion in the Dwarf Fortress
forums: http://www.bay12forums.com/smf/index.php?topic=76278
Author: Erik Youngren <[email protected]>
License: Any GNU compatible license.
"""
import random
@Artanis
Artanis / perfectlysafe.py
Created January 18, 2011 10:00
A module to make any value perfectly safe.
"""A quick sanitization module.
Released under None.
You didn't receive a copy of None with this module. If you search for
it, I'm sure you'll locate a copy somewhere. Any version will do. Pick
one that's good for you.
If you think a different license would suit your needs better, please
do not send me an email at None. In the event that I am disinclined to
@Artanis
Artanis / overgrowth_exmaple.yaml
Created November 23, 2010 07:42
An example YAML version of the XML file in Overgrowth Alpha 106 at 1:18
---
guard2:
appearance:
obj_path: Data/Objects/IDF_Characters/IGF_
skeleton: Data/Seletons/r_rig.xml
animations:
idle: Data/Animations/r_idle2.xml
jump: Data/Animations/r_jump.xml
roll: Data/Animations/r_roll.xml
movement: Data/Animations/r_movement.xml
@Artanis
Artanis / .gitconfig
Created October 22, 2010 10:39
I kept finding myself trying to "git ignore 'pattern'", so I made it work.
[alias]
ignore = "!f() { echo \"$1\" >> .gitignore; echo \"git: ignoring: $1\";}; f"
@Artanis
Artanis / exec-changes.sh
Created June 9, 2010 05:36
Watches a file for changes and executes a command every time it does.
#! /bin/bash
# Watches a file for changes and executes a command every time it does.
# Need to enclose COMMAND in quotes, script dumbly calls $2.
#
# USE:
# exec-changes FILENAME COMMAND
LAST=`stat -c '%Y' $1`
from __future__ import division
from random import uniform
from pyglet import clock, font, image, window
from pyglet.gl import *
class Entity(object):
def __init__(self, id, size, x, y, rot):
self.id = id
#include<iostream> // for toupper()
#include<cstring> // for strlen()
using namespace std;
int main() {
char ch[] = "Character Array";
// get the length of the
int len = strlen(ch);
@Artanis
Artanis / 960gs.less
Created February 25, 2010 05:51
LessCSS and 960gs don't play well together normally. Here's the definitions for 960gs to let LessCSS work with it. Looks like we can pull all grid data out of the HTML.
/**
* A LessCSS version of the 960 Grid System
*
* http://lesscss.org/
* http://960.gs/
*/
/*********************************************************************
* Settings *
*********************************************************************/
# This doesn't really do anything outside of post a text label at the
# lower left hand corner of #the screen right now.
from pyglet import window, font
class as_pyglet_text(object):
""" Decorator class
Modifies a function that returns a value (or tuple of values,)
to output to a pyglet window via a font.Text object.