Skip to content

Instantly share code, notes, and snippets.

Avatar

Timothy Hahn timothyhahn

View GitHub Profile
View gist:9340079
  • 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
View Keybase.md

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:

View gist:9255423
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
View nginx
$ 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
View gist:7622422
case class JPlayer(id: Int, x: Int, y: Int)
val players: ImmutableBag[Entity] = world.getManager(classOf[GroupManager]).getEntities("PLAYERS");
val numEntities = players.size
var entityJString : String = "["
var aPlayers: ArrayBuffer[JPlayer] = ArrayBuffer()
for( i <- 0 until numEntities) {
View gist:6553490
type_list = list()
for type in location_type._asdict().values():
type_list.append(type.capitalize())
render_template('bla.html', location_types=type_list)
View gist:6259012
Screen 0: minimum 320 x 200, current 1680 x 1050, maximum 16384 x 16384
HDMI-0 connected 1680x1050+0+0 (normal left inverted right x axis y axis) 480mm x 270mm
1680x1050 60.0*+
1920x1080i 50.0 60.1
1280x1024 75.0 60.0
1440x900 75.0 59.9
1280x960 60.0
1152x864 75.0
1280x720 50.0 60.0
1024x768 75.1 70.1 60.0
View scratch
faces == the "fs"
for(unsigned int i = 0; i < faces.size(); i += 3){
int index = faces[i];
vec4 vertex = vertices[index - 1];
vec4 a = vertex;
out_vertices.push_back(vertex);
index = faces[i + 1];
vertex = vertices[index - 1];
vec4 b = vertex;
View bla.c
// Circle
vec3 circle_vert[CIRCLE_SIZE];
for(int i = 0; i < CIRCLE_SIZE; i++) {
circle_vert[i] = vec3( radius * cos(i * twoPi / 360) + .5, radius * sin(i * twoPi / 360) + .7, 0);
}
vec4 circle_col[CIRCLE_SIZE];
for(int i = 0; i < CIRCLE_SIZE; i++) {
circle_col[i] = vec4(i / 360.0, 0.0, 0.0, 1.0);
}
View gist:5404304
#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
You can’t perform that action at this time.