Skip to content

Instantly share code, notes, and snippets.

@MastodonHQ
MastodonHQ / Tick.cpp
Created April 15, 2013 23:19
Tick - A tic tac toe game (Terminal/Command Line version)
#include <iostream>
#include <fstream>
#include <string>
using namespace std;
const string VERSION = "1.1.2";
/*
[0][1][2]
[3][4][5]
[6][7][8]
@MastodonHQ
MastodonHQ / callback.cpp
Created August 19, 2012 02:59
A class that has a member that takes a function pointer
#include <iostream>
using namespace std;
class test
{
public:
//printer is a regular function that takes a const char and prints it
void printer(const char * printme){
cout << printme << endl;
#include <iostream>
#include <string>
#include <boost/thread.hpp>
using namespace std;
using namespace boost;
class Worker
{
public:
Worker(string name, string ID)
@MastodonHQ
MastodonHQ / Functor.cpp
Created August 8, 2012 05:20
A Functor, Callback, and Thread
#include <boost/thread.hpp>
#include <iostream>
#include <string>
using namespace std;
using namespace boost;
class worker
{
public:
@MastodonHQ
MastodonHQ / functor.cpp
Created August 8, 2012 03:47
A Functor that takes a string and a function pointer
#include <boost/thread.hpp>
#include <iostream>
#include <string>
using namespace std;
using namespace boost;
class worker
{
public:
@MastodonHQ
MastodonHQ / grub.cfg
Created July 20, 2012 07:14
my multiboot grub2 conf
#set timeout="10"
#set default="0"
menuentry "FreeBSD 9.0 Release" {
set isofile="/boot/iso/FreeBSD-9.0.iso"
loopback loop $isofile
kfreebsd (loop)/boot/kernel/kernel
kfreebsd_module (loop)/boot/mfsroot.gz type=mfs_root
set kFreeBSD.vfs.root.mountfrom=ufs:/dev/md0
}
@MastodonHQ
MastodonHQ / i3config
Created June 6, 2012 03:16
i3 config
# i3 config file (v4)
#
# Please see http://i3wm.org/docs/userguide.html for a complete reference!
#
# This config file uses keycodes (bindsym) and was written for the QWERTY
# layout.
#
# To get a config file with the same key positions, but for your current
# layout, use the i3-config-wizard
#
@MastodonHQ
MastodonHQ / dynamic_array_printing.c
Created May 28, 2012 05:35
Some of my early work quite a feat considering I was a novice then
#include <stdio.h>
/*
This Program prints an array dynamically without knowing the number of indices, and makes use of function pointers. Of course any programmer will tell you there is next to no need to ever do this and that you should know the size of the array at the time of declaration.
*/
void list(char * array[], int indices){
int x=0;
for(;x!=indices;x++){
@MastodonHQ
MastodonHQ / oplist
Created May 17, 2012 05:24
Old oplist
oplist = ['0::ffff:74.248.215.158','0::ffff:127.0.0.1','adsl-74-248-215-158.tys.bellsouth.net','74.208.67.72','c-69-249-96-237.hsd1.pa.comcast.net','adsl-108-194-110-194.dsl.rcsntx.sbcglobal.net','98.65.197.33','xp'];
hoplist = ['articbreeze.net','adsl-108-194-110-194.dsl.rcsntx.sbcglobal.net','xp']
@MastodonHQ
MastodonHQ / mpd.conf
Created May 16, 2012 19:58
mpd configuration
music_directory "/aeterion_data/music"
playlist_directory "/aeterion_data/mpd/playlists"
db_file "/aeterion_data/mpd/mpd.db"
log_file "/aeterion_data/mpd/mpd.log"
pid_file "/aeterion_data/mpd//mpd.pid"
state_file "/aeterion_data/mpdmpdstate"
user "root"
# bind_to_address "127.0.0.1"
# port "6600"
audio_output {