Skip to content

Instantly share code, notes, and snippets.

View Grissess's full-sized avatar
🐲
busy doing derg things

Graham Northup Grissess

🐲
busy doing derg things
  • On your call stack
  • 19:42 (UTC -04:00)
View GitHub Profile
@Grissess
Grissess / bom.py
Created November 6, 2020 17:03
MC Schematic to Bill of Materials
import nbt, sys
if len(sys.argv) > 1:
f = open(sys.argv[1], 'rb')
else:
f = sys.stdin
n = nbt.nbt.NBTFile(fileobj = f)
pal = {v.value: v.name.partition('[')[0] for v in n['Palette'].values()}
#include <stdlib.h>
#include <stdio.h>
#include <stdint.h>
#include <unistd.h>
#include <errno.h>
#include <string.h>
#include <sys/types.h>
#include <sys/time.h>
#include <sys/stat.h>
@Grissess
Grissess / .vimrc
Last active October 28, 2021 14:21
execute pathogen#infect()
filetype indent plugin on
set cul nojs smc=50000 sts=4 ts=4 sw=4 nu hls is ai si ru sc mouse=a fo=cqnj flp=\\v^\\s*(-\|\\*\|\\d+[\\]:.)}\\t\ ])\\s*
set statusline=%f%m%r%h\ [%L]\ [%{&ff}]\ %y%=[%p%%]\ [%05l,%c-%v]
au ColorScheme * hi CursorLine cterm=none
au ColorScheme * hi CursorLineNr cterm=bold ctermfg=37 guifg=#00afaf
if exists("g:tridactyl_editor")
au ColorScheme * hi StatusLine ctermbg=20 ctermfg=7
au ColorScheme * hi StatusLineNC ctermbg=4 ctermfg=0
else
class NamedSingletonMeta(type):
def __new__(mcs, name, bases, dict):
tp = type.__new__(mcs, name, bases, dict)
if name != 'NamedSingletonBase':
tp._instances = {}
return tp
def __getitem__(self, i):
return self._instances[i]
package mods.eln.misc
import java.time.Year
data class Vec3f(var x: Double, var y: Double, var z: Double) {
val ZERO = Vec3f(0.0, 0.0, 0.0)
val ONE = Vec3f(1.0, 1.0, 1.0)
val AXIS_X = Vec3f(1.0, 0.0, 0.0)
val AXIS_Y = Vec3f(0.0, 1.0, 0.0)
val AXIS_Z = Vec3f(0.0, 0.0, 1.0)
@Grissess
Grissess / anise.py
Last active December 11, 2017 23:16
Test scheduler please ignore
import itertools
from minisat_model import *
class Intervalled(object):
def __init__(self, domain, *args):
self.domain = domain
self.full_name = ('_'.join(('{}',) * (len(args) + 1))).format(*args, id(self))
self.interval = Interval(self.full_name, domain.t_start, domain.t_end)
@Grissess
Grissess / zalgo.html
Created November 16, 2017 00:52
From eeemo.net, lightly modified
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html>
<head>
<title>Zalgo Text Generator by Tchouky -
To invoke the hive-mind representing chaos.
Invoking the feeling of chaos.
With out order.
The Nezperdian hive-mind of chaos. Zalgo.
He who Waits Behind The Wall.
ZALGO!
@Grissess
Grissess / Deathfix.lua
Created July 25, 2017 13:51
Garry's Mod fix for real death ragdolls
--[[
Deathfix -- a simple Garry's Mod script for making real death ragdolls
(drop into <game root>/garrysmod/lua/autorun/server)
It's been too long for me to remember the original author, but I can safely
say that I've modified it quite a bit anyway. Notwithstanding the other author's
claim on this file, I hereby grant this file to the public domain.
]]--
if SERVER then
import time
import pygame
import numpy as np
from OpenGL.GL import *
pygame.init()
dispinfo = pygame.display.Info()
disp = pygame.display.set_mode(
def y_combin(f, *args):
return f(f, *args)
def make_line(recur, cur, rest, width):
return (
(cur, rest)
if (not rest) or sum(map(len, cur)) + len(cur) + len(rest[0]) > width else
recur(recur, cur + (rest[0],), rest[1:], width)
)