This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from decimal import Decimal # for accurate math | |
ZERO = Decimal('0') | |
# I don't know what to actually call this but it's for different | |
# node types | |
# eg do `P = Unit(); NP = Unit(); VP = Unit(); etc` | |
# The class overrides the > + operators to make it easy to write | |
# relationships, like P > NP or VP > V+NP | |
class Unit: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class _Group: | |
def __init__(self, *patterns, name=None): | |
self._patterns = list(patterns) | |
self._name = name | |
self._force_group = False | |
@property | |
def name(self): | |
if self._name is None: | |
return '?:' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
SCSS RFS mixin - converted unofficially to JS | |
Please note that the author(s) and maintainer(s) of RFS aren't responsible for this port. Direct issues to @supposedly | |
******** | |
Automated responsive values for font sizes, paddings, margins and much more | |
Licensed under MIT (https://github.com/twbs/rfs/blob/master/LICENSE): |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@RULE bf | |
******************************** | |
**** COMPILED FROM NUTSHELL **** | |
**** v0.6.0a **** | |
******************************** | |
Brainfuck! | |
1: + | |
2: - |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import sys | |
from os import path | |
ACTIVE, INACTIVE = 'active', 'inactive' # For convenience/ease of renaming the variables, should need be | |
# TODO: Consider reordering alphabetically to match Golly | |
N_HOODS = 'cekainyqjrtwz' | |
NAPKINS = { | |
k: dict(zip(N_HOODS, ([INACTIVE if state == '0' else ACTIVE for state in npk] for npk in v))) for k, v in { | |
'0': '', | |
'1': ('00000001', '10000000'), |
Bold+italics means the lib is probably worth checking out above the rest. joffrey
is my own.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import inspect | |
from functools import wraps | |
from itertools import islice, starmap | |
def _callable(obj): | |
return callable(obj) and obj is not inspect._empty | |
def convert(hint, val): |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import pkg_resources | |
import platform | |
import os | |
from collections import defaultdict | |
from inspect import cleandoc | |
import asyncpg | |
import discord | |
from discord.ext import commands |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@RULE bct | |
An implementation of bitwise cyclic tag. | |
state 0: Vacuum. | |
state 1: Data-tape 0. | |
state 2: Data-tape 1. | |
state 3: Program-tape 0. |