Skip to content

Instantly share code, notes, and snippets.

View theturtle32's full-sized avatar

Brian McKelvey theturtle32

View GitHub Profile
theturtle32 /
Created January 5, 2021 19:29
Keybase Proof of Identity

Keybase proof

I hereby claim:

  • I am theturtle32 on github.
  • I am theturtle32 ( on keybase.
  • I have a public key ASCCAAyUGtSa9VsBW5JyyTzAI0GL6Jh1UD6Ii2c-c_SgHQo

To claim this, I am signing this object:

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
theturtle32 /
Last active August 29, 2015 14:21
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 /
Last active December 11, 2015 18:19
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 /
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 /
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:

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 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



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);
server.listen(8080, function() {
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 "">\n';
policy += '<cross-domain-policy>\n';
policy += '<allow-access-from domain="*" to-ports="*"/>\n';