Skip to content

Instantly share code, notes, and snippets.

View EZLiang's full-sized avatar
🦆
having fun

EZLiang

🦆
having fun
View GitHub Profile
@EZLiang
EZLiang / ns.ipynb
Last active March 23, 2022 19:25
Number Synthesizer Plus
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@EZLiang
EZLiang / regex.md
Last active January 21, 2022 14:30
Regex

Regex

is a very simple esoteric programming language.

The program is of the form

c/filter/flags/halt/flags2 comments

Note that /s in c must be escaped, and special chars in /filter/flags and /halt/flags2 must be escaped, as they are regular expressions and subject to their rules. Flags are case insensitive. Supported flags:

  • n - also consider non-printable characters (if on for any is automatically on for the other)
  • i - case-insensitive
@EZLiang
EZLiang / ezlife.md
Last active September 19, 2021 17:14
ezlife pattern collection

EZLife

A collection of sparkers not found (I think) in other collections

Credits

  • p4.rle: All Scorbie, except for the hw emulator whose stator has a mango, which is by Sokwe
  • p5.rle: Scorbie, except for the three-dot sparker partially by A for Awesome
  • p7.rle: Collected by Sokwe, credits can be found here: https://www.conwaylife.com/forums/viewtopic.php?f=2&t=1437&p=58533#p58533. The added pipsquirter is by Scorbie, and the other added sparker is by Extrementhusiast. Also, the big sparker is wwei

Notes

  • p4.rle: The emulator components can be mixed-and-matched, several samples shown
@EZLiang
EZLiang / synthesis.py
Last active June 9, 2021 14:35
A number synthesizer
suffixes = ["", "thousand", "million", "billion", "trillion", "quadrillion", "quintillion", "sextillion", "septillion", "octillion", "nonillion", "decillion", "undecillion", "duodecillion", "tredecillion", "quatturodecillion", "quindecillion", "sexdecillion", "septendecillion", "octodecillion", "novemdecillion", "vingtillion"]
numbers = ["zero", "one", "two", "three", "four", "five", "six", "seven", "eight", "nine"]
teens = ["ten", "eleven", "twelve", "thirteen", "fourteen", "fifteen", "sixteen", "seventeen", "eighteen", "nineteen"]
tens = ["zero", "ten", "twenty", "thirty", "forty", "fifty", "sixty", "seventy", "eighty", "ninety"]
def synth2(n):
if n == 0:
return ""
elif n < 10:
return numbers[n]
@EZLiang
EZLiang / obfuscate.py
Created March 6, 2021 01:27
Obfuscated Python code
NOTHING = lambda: None
def IF(condition, yes, no=NOTHING):
if condition:
return yes()
else:
return no()
def ITERATE(iterable, fun):
for i in iterable:
@EZLiang
EZLiang / tabulate.py
Last active March 3, 2021 14:23
Vote tabulator for POTY 2020
import re, json
names = ["Beehive push catalyst", "Natural loafers", "34-bit still life enumeration", "c/61 near-spaceship", "p9 heavyweight emulator", "p5 lightweight emulator/catalyst", "New c/5 diagonal spaceships", "New growing spaceships", "New longest 16x16 methuselah", "New c/10 orthgonal technology", "Better universal regulator", "19-bit still life syntheses", "c/5 and c/6 guns", "Cheaper universal construction", "Width-12 c/6 orthogonal spaceship", "New small Corderships", "p10 glider shuttle", "New agar technology", "Speed Demonoid", "LoM hasslers", "New c/6 diagonal pushalong", "New 2c/7 technology", "4×N block agar construction", "Rob's p16", "Loafer bitmap printer", "Cordercolumn", "Stable L122", "Stable barge-crosser", "Small c/5 diagonal puffer", "New grayship technology", "Glider syntheses from Glider_stdin", "New XWSS signal technology", "Silverfish", "Bandersnatch", "Spaceship eaters and spaceship-to-G converters", "Record-setting diehards", "Smaller 3c/7 spaceships", "p28 gun", "Spaceship
"""
Use like: python circuitgen.py /12/3
or whatever generations rule you want to use
"""
import sys
transitions = {
"0": "00000000",
"1c": "01000000", "1e": "10000000",
import discord
client = discord.Client()
@client.event
async def on_message(msg):
if msg.author == client.user:
return
elif client.user in msg.mentions:
@EZLiang
EZLiang / COVID-19.py
Created March 29, 2020 18:24
COVID-19 simulator
import numpy, scipy.integrate, matplotlib.pyplot
pop = 300000000.0
recovery = 0.2
badreco = 0.005
death = 0.001
contact = 0.3
sick = 30000.0
@EZLiang
EZLiang / gistrunner.py
Last active March 19, 2020 15:00
Gist Runner Python 3 -- run gists on your computer
"""
Copyright (c) 19 March 2020 EZLiang
This is distributed under the absolutely free lisence (https://gist.github.com/EZLiang/65b9a273fe2790d9abe31baf4f7b9d42)
To run:
----
$ python gistrunner.py username/gist_hash filename
or whichever python version works for you:
- python
- python3