Skip to content

Instantly share code, notes, and snippets.

View u9g's full-sized avatar
💯
on my grind!

u9g

💯
on my grind!
View GitHub Profile
# Find data points where temp (2m temp) is >= 90 deg F (32.2 deg C)
Root {
location_id @filter(op: "=", value: "CNTR03")
Datapoints(interval_value: 2, interval_unit: "minute") {
# filters
temperature_fahrenheit @filter(op: ">=", value: 90)
# outputs
time @output
}
@u9g
u9g / a.ts
Created February 28, 2023 00:18
// type ptr = number
// enum FFIType {
// pointer = 1,
// i8,
// i16,
// i32,
// i64,
// u8,
// u16,
// u32,
This file has been truncated, but you can view the full file.
[{"name":"Sheet 1","rows":1,"cells":{"A0":{"kind":"LiteralString","value":"44609","type":"Numeric","type_metadata":{"length":-1,"format":null,"alignment":"CenterRight"},"conditional_formats":[],"evaluated_formats":{}},"A1":{"kind":"LiteralString","value":"45281","type":"Numeric","type_metadata":{"length":-1,"format":null,"alignment":"CenterRight"},"conditional_formats":[],"evaluated_formats":{}},"A2":{"kind":"LiteralString","value":"29856","type":"Numeric","type_metadata":{"length":-1,"format":null,"alignment":"CenterRight"},"conditional_formats":[],"evaluated_formats":{}},"A3":{"kind":"LiteralString","value":"25210","type":"Numeric","type_metadata":{"length":-1,"format":null,"alignment":"CenterRight"},"conditional_formats":[],"evaluated_formats":{}},"A4":{"kind":"LiteralString","value":"41231","type":"Numeric","type_metadata":{"length":-1,"format":null,"alignment":"CenterRight"},"conditional_formats":[],"evaluated_formats":{}},"A5":{"kind":"LiteralString","value":"38873","type":"Numeric","type_metadata":{"le
@u9g
u9g / text.md
Last active August 15, 2021 05:03
Info about window updates in 1.17+

What's new in 1.17+

No more transaction packets, and no Action Ids. Also, the window click packet has a changed slots parameter and a clicked item parameter. The changed slots parameter is what the slots look like after they have changed. The clicked item is what's on your cursor after the click is done.

What is StateId

StateId is a variable in the client that should be replaced with the stateid from a set slot packet or window items packet every time one is received, then should be sent as part of the window click packet. StateId is only used in 1.17.1+.

Windows with a function (enchanting tables, furnaces, etc)

@u9g
u9g / example_simple_item.json
Created July 2, 2021 22:02
example simple-item
{
"slot": 10,
"count": 1,
"nbt": {
"ench": [
{
"lvl": 5,
"id": 16
},
{
@u9g
u9g / dump.yml
Last active April 15, 2021 12:53
GH Workflow to decompile MC (put both files in .github/workflows/)
name: Dump
on:
workflow_dispatch:
jobs:
build:
runs-on: ubuntu-latest
steps:
{
"collected": [
"login",
"custom_payload",
"difficulty",
"abilities",
"held_item_slot",
"declare_recipes",
"tags",
"entity_status",
@u9g
u9g / chat.js
Last active March 6, 2021 05:12
logs chat but good
const { escapeMarkdown, sendDiscordMessage } = require('./util')
const fs = require('fs')
const path = require('path')
const fileName = path.join('logs', `${new Date(Date.now()).toLocaleDateString().replace(/\//g, '_')}.json`)
let data = {}
function start (bot, client) {
bot.once('spawn', async () => {
data = await getData()
setInterval(write, 10000)
@u9g
u9g / patch.js
Created March 5, 2021 22:02
Add altening support to mineflayer
const mineflayer = require('mineflayer')
const bot = mineflayer.createBot({
authServer: 'http://authserver.thealtening.com',
sessionServer: 'http://sessionserver.thealtening.com',
host: 'localhost',
port: 25565,
username: 'TOKEN',
password: '12345678',
version: false