Skip to content

Instantly share code, notes, and snippets.

@pirogoeth
pirogoeth / global.sh
Created January 12, 2011 17:04
generates a global.tcl file to load eggtcl scripts simply.
#!/usr/bin/env bash
#global.tcl generator
# variables
select_list="Yes No"
if test -e ./global.tcl ; then
echo "Remove global.tcl?"
select choice in $select_list
do
GNU nano 2.2.4 File: ../index.php
<?
include ('include/header.php');
include ('php/simplepie.inc');
function github_feed () {
$feed = new SimplePie;
$feed->set_feed_url('http://github.com/miyoko.atom');
$feed->enable_cache(true);
@pirogoeth
pirogoeth / Teleport.py
Created May 31, 2011 22:25
Teleport plugin for bravo minecraft server
class Teleport(object):
implements(IChatCommand)
def chat_command(self, username, parameters):
p = parse_player(factory, username)
if len(parameters) == 0:
msg = "not enough parameters..."
return (msg,)
else:
def drop(msg, args = None):
""" drop a nickname and all registered channels from the database. """
if args is None or len(args.split()) < 1:
msg.notice(msg.params, "Syntax: /msg %s \x02DROP\x02 <account> <password>" % (var.bots[msg.params].data['nick']))
return False
if not msg.origin.logged_in or var.users[str(msg.origin)]['account'] == '*':
msg.origin.notice(msg.params, "You are not currently logged in.")
return False
try:
@pirogoeth
pirogoeth / memoize.py
Created June 18, 2011 02:40
labere's memoizer
#!/usr/bin/env python
import var
""" this is labere's internal memoization. im only writing this myself because i didn't want to user someone elses, and im quite bored. """
def memoize(name):
""" silly little decorator to get this done.
accepts a name to use for the dictionary to push/pull results from. """
if not var.memoize.__contains__(name):
@pirogoeth
pirogoeth / split.py
Created September 28, 2011 01:07
can split big files into smaller chunks easily with markers.
#!/usr/bin/env python
import sys
class Splitter(object):
def __init__(self, resource):
self.resource = resource
self.file = open(resource, 'r')
self.contents = self.file.read()
@pirogoeth
pirogoeth / LockboxSupport.java
Created March 20, 2012 01:36
Attempt to write an algorithm that builds a small bedrock building.
package me.maiome.openauth.util;
// bukkit imports
import org.bukkit.Location;
import org.bukkit.World;
import org.bukkit.block.Block;
import org.bukkit.block.BlockState;
// internal imports
import me.maiome.openauth.util.ConfigInventory;
@pirogoeth
pirogoeth / upstream-processing.sh
Created June 2, 2012 14:17
string processor and array tool for the upstream building feature im about to add to my compile.sh
#!/usr/bin/env bash
function checkIfElementIsBlank () {
test ! -z ${1}
}
# quick awk lesson
# ============================================================================================
# when using awk as a splitter, you will do awk '{print $#};', where # is the index number
# 0: entire string AFTER any proceeding formatting
@pirogoeth
pirogoeth / compile.sh
Created June 2, 2012 15:17
compiler script for bukkit projects with upstream support, as well as soon to be downstream support.
#!/usr/bin/env bash
declare -a upstream
# ==============================================================================================================
# configurable options
name="OpenEconomy"
basedir="/home/pirogoeth/OpenEconomy"
incdir="${basedir}/inc"
@pirogoeth
pirogoeth / SalesWeek.java
Created June 26, 2012 16:58
Second Lesson assignment for an intermediate Java course.
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Scanner;
public class SalesWeek {
public static Map<Day, ArrayList<Sale>> total_sales_day = new HashMap<Day, ArrayList<Sale>>(7);