Skip to content

Instantly share code, notes, and snippets.

View timothyhahn's full-sized avatar

Timothy Hahn timothyhahn

View GitHub Profile
$ sudo su
# apt-get update
# apt-get install python-software-properties
# add-apt-repository ppa:nginx/stable
# apt-get update
# apt-cache show nginx
# ## Find the one with nginx version 1.4.4 and copy and paste it below where $VERSION is
# ## (for example 1.4.4-1~precise)
# apt-get install nginx=$VERSION
# cd /etc/nginx/sites-enabled
@timothyhahn
timothyhahn / gist:9255423
Created February 27, 2014 18:03
updated design
NetworkMessageInterpreter
Network Message Comes In
-> Init
-> Create Character Entity
-> Create SockoSender
-> Associate websocket id to User's ID
-> Other
-> Look up user's id based on websocket id
-> Look up user's world's name
-> Toss onto queue the message + id + room name

Keybase proof

I hereby claim:

  • I am timothyhahn on github.
  • I am timothyhahn (https://keybase.io/timothyhahn) on keybase.
  • I have a public key whose fingerprint is 4AB0 313F 0401 AF63 5B29 72DC E529 2AD3 D241 6789

To claim this, I am signing this object:

  • Pick up items
  • Enemy AI Movement and attack
  • NPC Movement
  • Accept Quests from NPC
  • Equip and Unequip messages
  • Use Items
  • Drop Items
  • Loot enemies (optional)
  • Enemies drop items
  • Cancel Quests
/**
* From Bullet.cpp
*/
//Creates the bullet
Bullet::Bullet() {
setPosition(100,100);
setDirection(NORTH);
setHealth(1);
setMovementRate(10);
setWidth(5);
@timothyhahn
timothyhahn / gist:3962687
Created October 27, 2012 02:11
Declare that y is a variable and then assign it the value 4.
var y;
y = 4;
//Custom message struct
struct mymsg
{
//Data for this message
char * msg_data;
//Length of the data
int data_length;
//Sending pid
pid_t origin_pid;
#include <stdio.h>
#include <unistd.h>
int main(int argc, char *argv[]) {
int status;
int parent_pid = getpid();
int child_pid = fork();
if(!child_pid) { // If Child
printf("child\n");
char * send_buffer;
make -C /lib/modules/3.2.0-38-generic/build M=/home/tyh25/cs370/sources/cs370/tar/module modules
make[1]: Entering directory `/usr/src/linux-headers-3.2.0-38-generic'
CC [M] /home/tyh25/cs370/sources/cs370/tar/module/tarfs.o
/home/tyh25/cs370/sources/cs370/tar/module/tarfs.c: In function ‘add_tarfs_instance’:
/home/tyh25/cs370/sources/cs370/tar/module/tarfs.c:83:2: warning: ISO C90 forbids mixed declarations and code [-Wdeclaration-after-statement]
/home/tyh25/cs370/sources/cs370/tar/module/tarfs.c: In function ‘tarfs_read_file’:
/home/tyh25/cs370/sources/cs370/tar/module/tarfs.c:173:2: warning: ISO C90 forbids mixed declarations and code [-Wdeclaration-after-statement]
/home/tyh25/cs370/sources/cs370/tar/module/tarfs.c:189:2: warning: ISO C90 forbids mixed declarations and code [-Wdeclaration-after-statement]
/home/tyh25/cs370/sources/cs370/tar/module/tarfs.c:192:15: warning: initialization from incompatible pointer type [enabled by default]
/home/tyh25/cs370/sources/cs370/tar/module/tarfs.c: In function
#include <X11/Xlib.h>
#include <X11/Xatom.h>
#include <X11/Xutil.h>
#include <X11/extensions/Xrandr.h>
#include <stdbool.h>
#include <string.h>
int main(){
Display *dp = XOpenDisplay(NULL); // Connection to X Server