Skip to content

Instantly share code, notes, and snippets.

Avatar

Brian McKelvey theturtle32

View GitHub Profile
@theturtle32
theturtle32 / keybase.md
Created Jan 5, 2021
Keybase Proof of Identity
View keybase.md

Keybase proof

I hereby claim:

  • I am theturtle32 on github.
  • I am theturtle32 (https://keybase.io/theturtle32) on keybase.
  • I have a public key ASCCAAyUGtSa9VsBW5JyyTzAI0GL6Jh1UD6Ii2c-c_SgHQo

To claim this, I am signing this object:

@theturtle32
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
@theturtle32
theturtle32 / repairshop_example.md
Last active Aug 29, 2015
Rails Repair Shop Example for Eric
View repairshop_example.md

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 / NoSoup.as
Last active Dec 11, 2015
The code for "Harry" in Harry's Bar on Worlize.
View NoSoup.as
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 / node-amazon-linux-install.md
Created Oct 8, 2012
Installing Node on Amazon Linux
View node-amazon-linux-install.md

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 / compilingNode0.8.4onCentOS5.md
Created Jul 25, 2012
Compiling and Installing Node v0.8.4 on CentOS 5.x
View compilingNode0.8.4onCentOS5.md

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:

View gist:1962680
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 / ws_streaming_api.md
Created Sep 6, 2011
WebSocket streaming api
View ws_streaming_api.md

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

WebSocketConnection

Methods

@theturtle32
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);
response.writeHead(404);
response.end();
});
server.listen(8080, function() {
@theturtle32
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 "http://www.macromedia.com/xml/dtds/cross-domain-policy.dtd">\n';
policy += '<cross-domain-policy>\n';
policy += '<allow-access-from domain="*" to-ports="*"/>\n';