Skip to content

Instantly share code, notes, and snippets.

View Zemnmez's full-sized avatar
💭
oof

Thomas Neil James Shadwell Zemnmez

💭
oof
View GitHub Profile
int iBlocks=-1;
void Main (string argument) {
string Prefix;
bool Attention=false;
Prefix = "[Security]"; /*This is prefix for timer, which will be triggered*/
List<IMyTerminalBlock> Blocks = new List<IMyTerminalBlock>();
GridTerminalSystem.GetBlocksOfType <IMyTerminalBlock> (Blocks);
iBlocks=(iBlocks==-1?Blocks.Count:iBlocks);
if (Blocks.Count<iBlocks) Attention = true;
for (int i = 0; i < Blocks.Count; i++) {
@Zemnmez
Zemnmez / gist:dbc7dfeddb9bfe09955f70e0e31f5b2c
Created November 24, 2020 02:05
marked compiled regexes
inline:
autolink: /^<([a-zA-Z][a-zA-Z0-9+.-]{1,31}:[^\s\x00-\x1f<>]*|[a-zA-Z0-9.!#$%&'*+/=?_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_]))>/
blockSkip: /\[[^\]]*?\]\([^\)]*?\)|`[^`]*?`|<[^>]*?>/g
br: /^( {2,}|\\)\n(?!\s*$)/
breaks: {escape: /^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~~|])/, autolink: /^<([a-zA-Z][a-zA-Z0-9+.-]{1,31}:[^\s\x00-\x1f<>]*…9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_]))>/, url: /^((?:ftp|https?):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)…0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/i, tag: /^<!--(?!-?>)[\s\S]*?-->|^</[a-zA-Z][\w:-]*\s*>|^<…<![a-zA-Z]+\s[\s\S]*?>|^<!\[CDATA\[[\s\S]*?\]\]>/, link: /^!?\[((?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\…'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)))?\s*\)/, …}
code: /^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/
del: {exec: ƒ}
em: {start: /^(?:(\*(?=[!"#$%&'()+\-.,/:;<=>?@\[\]`{|}~]))|\*)(?![*\s])|_/, middle: /^\*(?:(?:(?!__[^_]*?__|\*\*\[^\*\]*?\*\*)(?:[^*]|…:[^_]|\\_)|__[^_]*?__|\*\*\[^\*
@Zemnmez
Zemnmez / i18n.txt
Created November 9, 2020 12:28
words in i18n style
This file has been truncated, but you can view the full file.
e21s: electroencephalograph's
A20s: Andrianampoinimerina's
c20s: counterrevolutionary's
c20s: counterrevolutionaries
e20s: electroencephalographs
e20s: electroencephalogram's
c19s: counterintelligence's
e19h: electroencephalograph
e19s: electroencephalograms
t18s: transubstantiation's
@Zemnmez
Zemnmez / ascii.ts
Created October 19, 2020 10:35
i honestly have not a fuckin clue why I wrote this
interface _Ascii {}
export type Ascii = _Ascii[keyof _Ascii];
interface _CtrlChar { }
export type Control = _CtrlChar[keyof _CtrlChar]
export const NUL = "\x00" as const;
export type NUL = typeof NUL;
interface _CtrlChar { [NUL]: NUL }
struct TokenizationStep(fn(
runes: dyn Iterator<Item=io::Result<String>>,
stack: dyn Iterator<Item=TokenizationStep>) -> io::Result<Box<dyn Iterator<Item=Box<dyn Token>>>>);
fn parseFile(runes: impl Iterator<Item=io::Result<String>>, stack: Box<dyn Iterator<Item=TokenizationStep>>) -> io::Result<Box<impl Iterator<Item=Box<impl Token>>>> {
return parseText(runes, stack)
}
struct Text(String);
import React from 'react';
import * as d3Scale from 'd3-scale';
import * as d3Array from 'd3-array';
const d3 = {
...d3Scale,
...d3Array
} as const;
const zero = Symbol(0);
import * as matrix from './matrix';
import * as vec from './vec';
test.each([
[
matrix.as<3, 2>([
[1,2,3],
[4,5,6]
] as const),
@Zemnmez
Zemnmez / cultistparser.ts
Created June 21, 2020 20:16
wip parser for cultist simulator's 'json' format
type runes = string[];
const unexpected = (char: string, ...expected: string[]) =>
new Error(`unexpected "${char}"` + (expected.length?`; expected ${expected.map(v => `"${v}"`).join(" or ")}`: ""))
export const AdaptCultistJson:
(i: string) => string
=
([char, ...chars]) => {
@Zemnmez
Zemnmez / ritecalculator.ts
Created June 18, 2020 21:51
calculates what rites are available in the game cultist simulator
/* Rite Calculator */
/* Scroll down to add followers to the follower list!! */
type Principle = Aspect.Forge | Aspect.Heart | Aspect.Winter | Aspect.Edge
| Aspect.Lantern | Aspect.Moth | Aspect.Grail | Aspect.Knock | Aspect.SecretHistories;
enum Kind {
Card, Slot, Recipe
}