This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function stop() | |
for f, _ in boundless.eventListeners(boundless.events.onEnterFrame) do | |
print(boundless.removeEventListener(boundless.events.onEnterFrame, f)) | |
end | |
for id, _ in os.intervals() do | |
print(os.clearInterval(id)) | |
end | |
for id, _ in os.timeouts() do | |
print(os.clearTimeout(id)) | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function stop() | |
for f, _ in boundless.eventListeners(boundless.events.onEnterFrame) do | |
print(boundless.removeEventListener(boundless.events.onEnterFrame, f)) | |
end | |
for id, _ in os.intervals() do | |
print(os.clearInterval(id)) | |
end | |
for id, _ in os.timeouts() do | |
print(os.clearTimeout(id)) | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- requires a maze.txt file | |
function readAll(file) | |
local f = assert(io.open(file, "rb")) | |
local content = f:read("*all") | |
f:close() | |
return content | |
end | |
function setBlock(x, y, z, blockType, color) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function getBlockType(p) | |
local c = boundless.ChunkCoord(p) | |
local blockType | |
boundless.loadChunkAnd8Neighbours(c, function (chunks) | |
local v = boundless.getBlockValues(boundless.BlockCoord(p)) | |
blockType = v.blockType | |
end) | |
return blockType | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
print("Loaded python script!") | |
import gdb | |
class HelloWorldCommand (gdb.Command): | |
"MyCommand! yay." | |
def __init__ (self): | |
super(HelloWorldCommand, self).__init__("helloworld", gdb.COMMAND_USER, gdb.COMPLETE_NONE, True) | |
def invoke(self, arg, from_tty): |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var mongodb = require('mongodb'); | |
var ReplSetServers = mongodb.ReplSetServers; | |
var Server = mongodb.Server; | |
var Db = mongodb.Db; | |
var replSet = new ReplSetServers([ | |
new Server('127.0.0.1', 27019, { auto_reconnect: true }), | |
new Server('127.0.0.1', 27020, { auto_reconnect: true }) , | |
new Server('127.0.0.1', 27021, { auto_reconnect: true }) | |
], | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<script src="socket.io/socket.io.js"></script> | |
<script> | |
var heartbeatInterval; | |
var heartbeatCount = 0; | |
var socket = io.connect('http://192.168.0.110:8088'); | |
socket.on('connect', function connectFn(data) { | |
console.log('connected'); | |
var heartbeat = function heartbeatFn() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var express = require('express'); | |
var io = require('socket.io'); | |
var http = require('http'); | |
var fs = require('fs'); | |
http.createServer(function (request, response) { | |
console.log('request ' + request.url); |