Skip to content

Instantly share code, notes, and snippets.

View chancez's full-sized avatar

Chance Zibolski chancez

View GitHub Profile
myLayoutHook = avoidStruts $
onWorkspace "7:gfx" (gimp ||| noBorders Full) $
onWorkspace "4:chat" (im) $
Full ||| Grid -- The layouts here are the defaults from left->right
where myNamed n l = named n $ layoutHints . gaps [(U, 1), (D, 1), (R, 1), (L, 1)] . spacing 1 $ l
im = withIM (1%7) (Role "buddy_list") Grid
gimp = withIM (0.11) (Role "gimp-toolbox") $
reflectHoriz $
withIM (0.15) (Role "gimp-dock") Full
myLayoutHook = avoidStruts $
modWorkspace "7:gfx" noBorders . fullscreenFull $
modWorkspace "4:chat" noBorders . im $
Full ||| Grid -- The layouts here are the defaults from left->right
                where im = withIM (1%7) (Role "buddy_list")
/*
* =====================================================================================
*
* Filename: Queue.h
*
* Author: Chance Zibolski (CZ), [email protected]
* Organization:
*
* =====================================================================================
*/
set nocompatible " be iMproved
" Move around windows
map <C-j> <C-W>j
map <C-k> <C-W>k
map <C-h> <C-W>h
map <C-l> <C-W>l
" General Settings
filetype on
#! /urs/bin/env python
import sys
def reverse_word(aWord):
return aWord[::-1]
print reverse_word(sys.argv[1])
def parsemsg2(info, msg, send, COMMAND_LIST):
ret = ''
if msg[0] == '!':
cmd = msg.split(' ',1)
if (cmd in COMMAND_LIST):
command = COMMAND_LIST.get(cmd)
ret = command(cmd[2])
# Treat messages starting with '!' as commands (e.g., "!say hi")
if msg[0] == '!':
# Splits up the orginal message into 2 parts:
# command = the command to be called, Ex: !rps
# cmd_args = the arguments for the command, ex: !rps args
cmd = msg.split(' ',1)
command = cmd[0]
command = command[1:] # Removes the ! from the command
cmd_args = cmd[1]
bool Queue::enqueue(const Potion& aPotion)
{
if (size == MAX_CAPACITY)
return false; //Returns false if the queue is full
//Add the item to the end of the queue
items[rear] = aPotion;
rear = (rear + 1) % MAX_CAPACITY; //Circular, so no shifting needed.
size++;
return true;
Queue::Queue(int a_size): size(0), front(0), rear(0), MAX_CAPACITY(a_size), items(NULL)
{
//Create an array of potions with the size passed to the constructor
items = new Potion[a_size];
}
void Potion::SetType(PotionType& type)
{
if(this->type)
delete &this->type;
this->type = type;
}