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
  • 02:12 (UTC -04:00)
View GitHub Profile
@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 / 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)
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)
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]
@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
#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 / 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()}
@Grissess
Grissess / en_US@grissess
Created February 14, 2022 01:21
A locale for Sunday-first calendars with ISO8601 time
# en_US, but with ISO8601 timestamps and 24-hour time,
# by Grissess.
# I, mentioned, claim no copyright in this work.
# Put this in your archive with:
# localdef -f UTF-8 -i en_US@grissess en_US.utf8@grissess
# (assuming you've installed everything according to the paths listed by
# localedef --help)
LC_IDENTIFICATION
@Grissess
Grissess / check_disk.sh
Last active June 23, 2022 16:52
A little dialog wrapper for smartctl
#!/bin/bash
smartctl="${SMARTCTL:-smartctl}"
dialog="${DIALOG:-dialog}"
jq="${JQ:-jq}"
# Debian workaround
blockdev="${BLOCKDEV:-$(PATH="$PATH:/sbin:/usr/sbin" which blockdev)}"
sce_parse_bit=1
sce_open_bit=2
@Grissess
Grissess / cpu.py
Last active July 3, 2022 21:47
WIP of an inane processor
import random
import os
import traceback
import sys
import ast
from random import randrange
from myhdl import block, always_comb, always_seq, always, \
Signal, ResetSignal, intbv, modbv, delay, instance, \
now, enum, bin