Skip to content

Instantly share code, notes, and snippets.

@donno
donno / Fibonacci.cpp
Created February 11, 2012 14:55
Provides a way to iterate over the Fibonacci sequence.
//===----------------------------------------------------------------------===//
//
// NAME : FibonacciGenerator
// VERSION : 0.2
// NAMESPACE : Global namespace.
// PURPOSE : Provided a way to iterate over the Fibonacci sequence.
// COPYRIGHT : (c) 2012 Sean Donnellan. All Rights Reserved.
// AUTHORS : Sean Donnellan ([email protected])
// DESCRIPTION : Provided a way to iterate over the Fibonacci sequence.
//
@donno
donno / Logger.cpp
Created January 5, 2011 13:41
Little bit of work on what the log in logger should ideally be.
// Log debug infomation to terminal
void Logger::log(std::string msg, std::string file, int line)
{
Mineserver::get()->screen()->log("[" + file + "@" + dtos(line) + "]: " + msg);
}
// Log messages
void Logger::log(LogType type, const std::string& channel, const std::string& message)
{
// This should be expanded eventaully to support saving to file and if config option is enabled saving a channel per a file
@donno
donno / test_config.cpp
Created January 3, 2011 10:33
Mineserver Test case using catch for Config class in Mineserver.
/*
Copyright (c) 2010, The Mineserver Project
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
* Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the