Skip to content

Instantly share code, notes, and snippets.

View theturtle32's full-sized avatar

Brian McKelvey theturtle32

View GitHub Profile
@theturtle32
theturtle32 / package.json
Created July 20, 2011 05:30
Proof of Concept Integration of Socket.IO and WebSocket-Node
{
"name": "socket.io"
, "version": "0.7.7"
, "description": "Real-time apps made cross-browser & easy with a WebSocket-like API"
, "homepage": "http://socket.io"
, "keywords": ["websocket", "socket", "realtime", "socket.io", "comet", "ajax"]
, "author": "Guillermo Rauch <[email protected]>"
, "contributors": [
{ "name": "Guillermo Rauch", "email": "[email protected]" }
, { "name": "Arnout Kazemier", "email": "[email protected]" }
@theturtle32
theturtle32 / flashpolicy.js
Created July 21, 2011 06:20
Super-simple flash policy file server
#!/usr/bin/env node
var net = require('net'),
sys = require('sys');
policy = '<?xml version="1.0"?>\n';
policy += '<!DOCTYPE cross-domain-policy SYSTEM "http://www.macromedia.com/xml/dtds/cross-domain-policy.dtd">\n';
policy += '<cross-domain-policy>\n';
policy += '<allow-access-from domain="*" to-ports="*"/>\n';
@theturtle32
theturtle32 / websocket-fallback.js
Created August 16, 2011 08:52
Example of how to fallback to alternative websocket library for old protocol clients.
#!/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);
response.writeHead(404);
response.end();
});
server.listen(8080, function() {
@theturtle32
theturtle32 / ws_streaming_api.md
Created September 6, 2011 09:41
WebSocket streaming api

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

WebSocketConnection

Methods

package
{
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
theturtle32 / compilingNode0.8.4onCentOS5.md
Created July 25, 2012 20:57
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
theturtle32 / node-amazon-linux-install.md
Created October 8, 2012 20:05
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
theturtle32 / NoSoup.as
Last active December 11, 2015 18:19
The code for "Harry" in Harry's Bar on Worlize.
package
{
import com.worlize.api.WorlizeAPI;
import com.worlize.api.event.ChatEvent;
import com.worlize.api.event.UserEvent;
import flash.display.Sprite;
import flash.events.TimerEvent;
import flash.geom.Point;
import flash.utils.Timer;
@theturtle32
theturtle32 / repairshop_example.md
Last active August 29, 2015 14:21
Rails Repair Shop Example for Eric

Models

app/models/customer.rb

class Customer < ActiveRecord::Base
  has_many :tickets
  has_many :item_ownerships
  has_many :items, through: :item_ownerships
  has_many :comments, as: :commentable
  
@theturtle32
theturtle32 / color-change.gcode
Created January 14, 2016 07:00
Color Change GCode Script
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