Skip to content

Instantly share code, notes, and snippets.

@Artanis
Artanis / gist:62937
Created February 12, 2009 23:21
Removes spaces from posted Powder Game save codes.
CmdUtils.CreateCommand({
name: "dust",
homepage: "http://gist.github.com/62937",
author: { name: "Artanis", email: "artanis.00@gmail.com"},
license: "Public Domain",
description: "Removes spaces from <a href='http://dan-ball.jp/en/javagame/dust/'>Powder Game</a> save codes. Execute command to replace selection with formatted code, even in the save game text box.",
help: "dust (code|selection)",
takes: {"code": noun_arb_text},
preview: function( pblock, input ) {
var template = "${code}";
@Artanis
Artanis / radio
Created February 26, 2009 19:08
Script to open radio streams in Totem Player.
#! /bin/bash
if [ "$1" = "" ]; then
echo "Opens selected station audio stream in totem-player"
echo "Available radio stations:"
echo " kfi KFI AM 640"
echo " kabc KABC AM 790"
fi
#KFI AM 640
@Artanis
Artanis / google_if_layout_columns.user.js
Created February 26, 2009 20:07
A Greasemonkey script that alters the widths of the columns.
// ==UserScript==
// @name Google IG layout columns fixed-fluid-fixed (v4)
// @namespace artanis_premier
// @description Widens middle column for more reading space
// @include http://google.*/ig*
// @include http://www.google.*/ig*
// ==/UserScript==
var navbar_width = 359;
var col1_width = 275;
class Base(object):
def __init__(self):
pass
def combine(self, other):
""" Performs class husbandry
Returns: A tuple containing an instance of and reference to a
new class created with the two supplied classes as parents.
"""
# Get the list of base classes
# 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.
@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 *
*********************************************************************/
#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);
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
@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`