Skip to content

Instantly share code, notes, and snippets.

View roblabla's full-sized avatar
🌅
Kernel Dev'ing.

Robin Lambertz roblabla

🌅
Kernel Dev'ing.
View GitHub Profile
function readUInt4 (buffer, cursor) {
if (cursor % 2 === 0)
return buffer.readUInt8(Math.floor(cursor / 2)) >> 4;
else
return buffer.readUInt8(Math.floor(cursor / 2)) & 0x0f;
}
function writeUInt4(buffer, value, cursor) {
if (!(0 <= value && value < 16))
throw new Error('value is out of bounds');
var proto=require("./../../enums/protocol");
var fs=require("fs");
function getFieldInfo(field) {
if (Array.isArray(field))
return { type: field[0], typeArgs: field[1] };
else if (field.type && field.typeArgs)
return field;
else if (typeof field === "string")
return { type: field }
[
[
"changed",
{
"state": "Play",
"bound": "toClient"
},
"0x0E",
"0x00"
],
{"typeId":"CPU","uid":1,"title":"1","head":{"functionName":"(root)","url":"","lineNumber":0,"callUID":2584701498,"bailoutReason":"","id":1,"scriptId":0,"hitCount":0,"children":[{"functionName":"listOnTimeout","url":"timers.js","lineNumber":75,"callUID":3200520433,"bailoutReason":"TryFinallyStatement","id":2,"scriptId":45,"hitCount":0,"children":[{"functionName":"Module.runMain","url":"module.js","lineNumber":499,"callUID":3304910521,"bailoutReason":"no reason","id":3,"scriptId":34,"hitCount":0,"children":[{"functionName":"Module._load","url":"module.js","lineNumber":273,"callUID":1489921527,"bailoutReason":"TryFinallyStatement","id":4,"scriptId":34,"hitCount":0,"children":[{"functionName":"Module.load","url":"module.js","lineNumber":345,"callUID":1425125897,"bailoutReason":"no reason","id":5,"scriptId":34,"hitCount":0,"children":[{"functionName":"Module._extensions..js","url":"module.js","lineNumber":476,"callUID":985763658,"bailoutReason":"no reason","id":6,"scriptId":34,"hitCount":0,"children":[{"functionNa
{"typeId":"CPU","uid":1,"title":"1","head":{"functionName":"(root)","url":"","lineNumber":0,"callUID":2584701498,"bailoutReason":"","id":1,"scriptId":0,"hitCount":0,"children":[{"functionName":"listOnTimeout","url":"timers.js","lineNumber":75,"callUID":3786248223,"bailoutReason":"TryFinallyStatement","id":2,"scriptId":45,"hitCount":0,"children":[{"functionName":"Module.runMain","url":"module.js","lineNumber":499,"callUID":1673154358,"bailoutReason":"no reason","id":3,"scriptId":34,"hitCount":0,"children":[{"functionName":"Module._load","url":"module.js","lineNumber":273,"callUID":1852573627,"bailoutReason":"TryFinallyStatement","id":4,"scriptId":34,"hitCount":0,"children":[{"functionName":"Module.load","url":"module.js","lineNumber":345,"callUID":142552180,"bailoutReason":"no reason","id":5,"scriptId":34,"hitCount":0,"children":[{"functionName":"Module._extensions..js","url":"module.js","lineNumber":476,"callUID":3486571580,"bailoutReason":"no reason","id":6,"scriptId":34,"hitCount":0,"children":[{"functionNa
@roblabla
roblabla / JS
Created September 24, 2012 23:05
Scalatron bot javax.script
// Tutorial Bot #9: The hacker's RPG !
import javax.script._
class ControlFunctionFactory {
val manager = new ScriptEngineManager
val engine = manager.getEngineByExtension("js")
engine.eval("""
importPackage(java.util); // This is UGLYYYYYYY
// Rhino imports ALL CLASSES IN A PACKAGE !
// this is equivalent to import java.util.*/java.util._
@roblabla
roblabla / 42.conf
Created December 1, 2014 18:36
42 nginx redirect
server {
listen 80;
listen [::]:80;
server_name 42.cmc.im;
rewrite ^/(.*) https://42.cmc.im/$1 permanent;
}
server {
listen 443 ssl;
{
# Used by the container to access the outside world.
networking.nat.enable = true;
networking.nat.internalInterfaces = ["ve-+"];
networking.nat.externalInterface = "enp1s0";
containers.vpn = {
privateNetwork = true;
hostAddress = "192.168.100.10";
localAddress = "192.168.100.11";
@roblabla
roblabla / proxy_raw.js
Created October 18, 2015 11:17
A raw proxy for NMP
var mc = require('minecraft-protocol') // import nmp
, states = mc.states // import states as var from nmp
, server = new mc.Server();
server.listen(25565);
server.on('connection', function(client) {
var addr = client.socket.remoteAddress; // get the ip
console.log('Incoming connection', '(' + addr + ')'); // print ip on connection
var endedClient = false;
@roblabla
roblabla / norme.txt
Created November 5, 2015 19:50
Norminette check
Norme: /tmp/roblabla/norminette_ci_01c7cb66-464f-48d9-929d-06a1e24e76d3/src/framework_collision/fk_collision.c
Error: global scope bad aligned
Error (line 46): line has 105 characters
Error (line 47): line has 105 characters
Error (line 53): function ft_trace_ray has 32 lines
Error (line 61): line has 95 characters
Error (line 69, col 3): missing space after break
Error (line 82): line has 95 characters
Error (line 89): function ft_render has 34 lines
Error (line 89, col 0): ft_render has 10 variables