Skip to content

Instantly share code, notes, and snippets.

View ejm's full-sized avatar
📺
Making things for people to see!

Evan J. Markowitz ejm

📺
Making things for people to see!
View GitHub Profile
@ejm
ejm / nbtjson.go
Last active March 23, 2022 20:53
// (c) 2022 Evan J. Markowitz (ejm)
// Licensed under The MIT License
package main
import (
"compress/gzip"
"encoding/json"
"fmt"
"log"
"os"
/* colar.css - palette by yeun and fchristant, css made with python by evan */
/* https://github.com/fchristant/colar */
:root {
--gray-0: #f8fafb;
--gray-1: #f2f4f6;
--gray-2: #ebedef;
--gray-3: #e0e4e5;
--gray-4: #d1d6d8;
--gray-5: #b1b6b9;
--gray-6: #979b9d;
@ejm
ejm / mc_version.py
Last active January 6, 2024 20:47
Simple wrapper for Mojang's new Minecraft version manifest file
import requests
import json
MANIFEST_URL = "https://launchermeta.mojang.com/mc/game/version_manifest.json"
MANIFEST = requests.get(MANIFEST_URL).json()
def get_latest_version(type_):
if not type_ in ["snapshot", "release"]:
raise ValueError("Version type must be either snapshot or release")
return MANIFEST["latest"][type_]
{
"server": {
"ip": "",
"port": 25565,
"online-mode": true,
"prevent-proxy-connections": false,
"network-compression-threshold": 256,
"snooper-enabled": true,
"player-idle-timeout": 0,
"max-players": 20,
@ejm
ejm / cache.py
Last active November 7, 2016 18:26
Quick setup to cache results of functions
# cache.py - Quick setup to cache results of functions
# Copyright 2016 Evan Markowitz - Licensed under MIT
from datetime import datetime as dt
from datetime import timedelta as td
class CachedResult(object):
def __init__(self, func_, timeout):
""" Cache the results of `func` for `timeout` seconds """
@ejm
ejm / pushbullet_msg.py
Created November 17, 2015 01:29
Push a message to a Pushbullet account
#!/usr/bin/python
# pushbullet_msg.py - Push a message to a Pushbullet account
import argparse, requests, sys
MESSAGE_URL = "https://api.pushbullet.com/v2/pushes"
def push_msg(title, body, key):
push_data = {"type":"note", "title":title, "body":body}
@ejm
ejm / log4j2.xml
Last active August 29, 2015 14:07 — forked from EvilSeph/log4j2.xml
<?xml version="1.0" encoding="UTF-8"?>
<Configuration status="WARN" packages="net.minecraft,com.mojang">
<Appenders>
<Console name="WINDOWS_COMPAT" target="SYSTEM_OUT"></Console>
<Queue name="TerminalConsole">
<PatternLayout pattern="%d{yyyy-MM-dd HH:mm:ss} [%level] %msg%n" />
</Queue>
<RandomAccessFile name="File" fileName="server.log">
<PatternLayout pattern="%d{yyyy-MM-dd HH:mm:ss} [%level] %msg%n" />
</RandomAccessFile>
@ejm
ejm / keybase.md
Last active August 29, 2015 14:06

Keybase proof

I hereby claim:

  • I am techkid6 on github.
  • I am techkid6 (https://keybase.io/techkid6) on keybase.
  • I have a public key whose fingerprint is 51D6 61A3 0126 7160 1DBD 5BD2 8923 B2EE 88D8 EEE8

To claim this, I am signing this object: