Skip to content

Instantly share code, notes, and snippets.

@MultiMote
MultiMote / main.c
Created March 25, 2023 14:54
user idle exporter
#include <winsock2.h>
#include <windows.h>
#include <stdio.h>
#include "mongoose.h"
LASTINPUTINFO lii;
#define USER_EXPORTER_VERSION "0.0.1"
#define USER_EXPORTER_IDLE_TIME_SECONDS (8 * 60)
#define USER_EXPORTER_LISTEN_ADDR "http://0.0.0.0:9183"
@MultiMote
MultiMote / season.js
Last active June 15, 2022 07:16
Get season name from month
const month = new Date().getMonth(); // 0-11
const seasons = ['winter', 'spring', 'summer', 'autumn'];
const seasonIndex = Math.floor(((month + 1) % 12) / 3);
const seasonName = seasons[seasonIndex];
console.log(seasonName);
@MultiMote
MultiMote / ponytown-chat-filter.user.js
Created February 23, 2022 18:53
Pony.town nickname chat filter
// ==UserScript==
// @name Pony.town chat filter
// @namespace mmote
// @match https://pony.town/*
// @grant none
// @version 1.0
// @author MultiMote
// @description Filter chat messages by nicknames
// @run-at document-end
// @icon https://pony.town/favicon-194x194.png
@MultiMote
MultiMote / copyselection.cpp
Created May 29, 2019 08:32
Copy QTableView selection to clipboard (ignore custom column order)
void copyTableSelectionToClipboard(QTableView *view) {
if (!view->model()) {
return;
}
int min_col = view->model()->columnCount() - 1;
int max_col = 0;
int min_row = view->model()->rowCount() - 1;
int max_row = 0;
@MultiMote
MultiMote / pysqlitedoc.py
Last active May 22, 2019 18:17
Simple python script for SQLite tables documenting
# table_comments.json
#
# {
# "customers": {
# "comment": "Customers table",
# "fields": {
# "City": "City field",
# "Country": "Country field"
# }
# }
from subprocess import call
MAX_DISPLAY_IDLE_SECONDS = 60 * 5
class DisplayPower(object):
def __init__(self):
self.display_idle_time = 0
self.display_on = False
self.on()
@MultiMote
MultiMote / battleye-rcon-gcc-test.c
Last active August 15, 2017 12:19
Battleye RCON c test
// MultiMote. 2017
// just kidding, really
// this is for UDP sockets testing, not a real connector
// I will rewrite it for QT
#include <stdio.h>
#include <stdint.h>
#include <conio.h>
#include <string.h>
#include <pthread.h>
package com.multimote.microz.handlers.packet;
import com.multimote.microz.Core;
import cpw.mods.fml.common.network.simpleimpl.IMessage;
import cpw.mods.fml.common.network.simpleimpl.IMessageHandler;
import cpw.mods.fml.common.network.simpleimpl.MessageContext;
import io.netty.buffer.ByteBuf;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.world.World;
//////////////////////////////
//// MOD FILE
//////////////////////////////
public static SimpleNetworkWrapper packets;
@EventHandler
public void postInit(FMLPostInitializationEvent event) {
packets = NetworkRegistry.INSTANCE.newSimpleChannel("SomeName");
packets.registerMessage(GuiRequestPacket.class, GuiRequestPacket.class, 0, Side.SERVER); //Packed id, 0-31
package com.multimote.microz.utils;
import com.multimote.microz.Core;
import com.multimote.microz.data.GlobalData;
import com.multimote.microz.entity.CorpseEntity;
import com.multimote.microz.entity.living.FastZombie;
import com.multimote.microz.entity.living.npc.NpcBase;
import com.multimote.microz.handlers.packet.DescrWorldDataPacket;
import net.minecraft.command.CommandBase;
import net.minecraft.command.CommandException;