Skip to content

Instantly share code, notes, and snippets.

var reqs = [];
window.jsonp_handler = function(id, res) {
reqs[id].handle(res);
};
function Req(url, data, handler) {
this.url = url;
this.data = typeof data == "object" ? data : {};
this.handler = handler;
@Emiel45
Emiel45 / RustPing.java
Created December 29, 2013 16:03
Rust server ping
package me.mast3rplan.rust.ping;
import java.net.DatagramPacket;
import java.net.DatagramSocket;
import java.net.InetAddress;
import java.nio.ByteBuffer;
import java.nio.ByteOrder;
public class RustPing {
static class ServerData {
@Emiel45
Emiel45 / ping_mc_1_7.php
Last active March 3, 2018 18:16
Minecraft 1.7 server list pinged (hacked together in 20 minutes)
<?php
// Info used: http://wiki.vg/Server_List_Ping
// (Original varint parsing: https://gist.github.com/thinkofname/e975ddee04e9c87faf22)
// Reads a varint from the socket
function read_varint($socket) {
$i = 0; $j = 0;
while(true) {
socket_recv($socket, $buf, 1, null);
$k = ord($buf[0]);
@Emiel45
Emiel45 / gist:2025845
Created March 13, 2012 01:00
CCGPU multimonitor script
if not initialized then
-- make sure all monitors are the same resolution
-- set initial resolution
local width, height
local tempWidth, tempHeight
width, height = gpuGetResolution(1)
tempWidth, tempHeight = gpuGetResolution(2)
if not (tempWidth == width and tempHeight == height) then
error("Monitor 2 does not match monitor 1 it's resolution.")