Skip to content

Instantly share code, notes, and snippets.


Brian McKelvey theturtle32

View GitHub Profile
theturtle32 / package.json
Created Jul 20, 2011
Proof of Concept Integration of Socket.IO and WebSocket-Node
View package.json
"name": ""
, "version": "0.7.7"
, "description": "Real-time apps made cross-browser & easy with a WebSocket-like API"
, "homepage": ""
, "keywords": ["websocket", "socket", "realtime", "", "comet", "ajax"]
, "author": "Guillermo Rauch <>"
, "contributors": [
{ "name": "Guillermo Rauch", "email": "" }
, { "name": "Arnout Kazemier", "email": "" }
theturtle32 / flashpolicy.js
Created Jul 21, 2011
Super-simple flash policy file server
View flashpolicy.js
#!/usr/bin/env node
var net = require('net'),
sys = require('sys');
policy = '<?xml version="1.0"?>\n';
policy += '<!DOCTYPE cross-domain-policy SYSTEM "">\n';
policy += '<cross-domain-policy>\n';
policy += '<allow-access-from domain="*" to-ports="*"/>\n';
theturtle32 / websocket-fallback.js
Created Aug 16, 2011
Example of how to fallback to alternative websocket library for old protocol clients.
View websocket-fallback.js
#!/usr/bin/env node
var WebSocketRequest = require('websocket').request;
var http = require('http');
var server = http.createServer(function(request, response) {
console.log((new Date()) + " Received request for " + request.url);
server.listen(8080, function() {
theturtle32 /
Created Sep 6, 2011
WebSocket streaming api

The methods and events here are in addition to the ones already defined in the documentation for WebSocket-Node



View gist:1962680
import com.worlize.api.WorlizeAPI;
import com.worlize.api.event.ChatEvent;
import flash.display.Sprite;
public class EmbedClientTest extends Sprite
private var api:WorlizeAPI;
theturtle32 /
Created Jul 25, 2012
Compiling and Installing Node v0.8.4 on CentOS 5.x

Compiling/Installing Node 0.8.4 (and Python 2.6, required by Node) on CentOS 5

Update system packages -- will migrate system forward to CentOS 5.8. (Optional?)

$ sudo yum update

Install the EPEL Repo:

theturtle32 /
Created Oct 8, 2012
Installing Node on Amazon Linux

Compiling/Installing Node 0.8.11 on Amazon Linux

Verify Python 2.6 is ready to go. (Should print "Python 2.6.8")

$ python -V

Install Development Toolchain

theturtle32 /
Last active Dec 11, 2015
The code for "Harry" in Harry's Bar on Worlize.
import com.worlize.api.WorlizeAPI;
import com.worlize.api.event.ChatEvent;
import com.worlize.api.event.UserEvent;
import flash.display.Sprite;
import flash.geom.Point;
import flash.utils.Timer;
theturtle32 /
Last active Aug 29, 2015
Rails Repair Shop Example for Eric



class Customer < ActiveRecord::Base
  has_many :tickets
  has_many :item_ownerships
  has_many :items, through: :item_ownerships
  has_many :comments, as: :commentable
theturtle32 / color-change.gcode
Created Jan 14, 2016
Color Change GCode Script
View color-change.gcode
G1 Z70 F360 ; move up above object
G1 X150 Y200 F3600 ; move to center of build area
G1 E-40 F1800 ; eject filament from extruder
M84 ; disable motors
M0 Change Color...
M17 ; enable motors
G92 E0 ; reset extruder coordinates
G1 E50 F60 ; prime new filament
G92 E0