Skip to content

Instantly share code, notes, and snippets.

import norswap.autumn.Grammar
import norswap.autumn.Parser
import norswap.autumn.parsers.*
interface Expression
data class Number(val value: Int): Expression
data class Add(val left: Expression, val right: Expression): Expression
data class Sub(val left: Expression, val right: Expression): Expression
/*
@Victorious3
Victorious3 / sai_converter.py
Created June 28, 2018 20:48
SAI File Converter
# sai_converter.py by VicNightfall - https://twitter.com/VicNightfall
#
# ---------------------------------- README: --------------------------------------------
# First you need to install python, if you haven't done that already.
# You can get it from here: https://www.python.org/downloads/ (Just get the newest release)
#
# You also need to install pywinauto:
# pip install pywinauto
#
# (inside a command prompt, see steps below)
{
"rolls": {
"min": 2,
"max": 6
},
"items": {
"minecraft:diamond" : {
"weight": 5,
"count" : [2, 7]
},
@Victorious3
Victorious3 / alpha-0.9.md
Created March 22, 2015 13:27
Integrated Circuits Alpha 0.9 Checklist
  • Step by step debugging for Circuits
    • Pause
    • Step by Step
    • Change the speed
  • Select, Copy, Paste, Fill of selections for the CAD
  • Cleanup for the CAD, multiple tabs instead of everything in one place
  • Tunnels, way of connection two wires in a circuit without a direct connection
  • Ability to add Labels to circuit blueprints, for documentation
  • Huge refactor needed (7-seg, gate rendering)
  • Portable Gates, it will be devided into socket, gate, and a soldering tool
Gui testGUI = new Gui("testgui").setPreferredSize(300, 200)
.add(new Button("testbutton2", "I'm EAST")
.setMaximumSize(Integer.MAX_VALUE, 120)
.onEvent((event, component) -> {
System.out.println("Test button pressed! " + Side.get());
}, ActionEvent.class, Side.BOTH), Anchor.EAST)
.add(new Container("centerContainer").setLayout(new FixedLayout())
.add(new Button("notherbutton", "It's all relative..."), "north: 50% west: 20")
@Victorious3
Victorious3 / gist:440c6cc458dcae533854
Created February 27, 2015 16:22
Inline GUI prompts
Prompt.show("Want to cheat yourself diamonds?", Prompt.YES, Prompt.NO).on(Prompt.YES, Side.SERVER, (player) -> player.getInventory().add(diamonds));
@Victorious3
Victorious3 / gist:bfc85a185e66bcaee51d
Created February 3, 2015 11:23
GUI builder concept
Gui gui = GuiBuilderXML.of(
"<div width = 200, height = 150, align = 'center'>" +
"<p align = 'left:10%'>I'm a paragraph!</p>" +
"<button align = 'center' id = 'button1', text = 'I\'m some text on a button!'/>" +
"</div>"
);
gui.getElement("button1").addEventListener((e) -> {
doStuffOnTheServerSide();
}, ActionEvent.class, Side.SERVER);
@Victorious3
Victorious3 / gist:9d066f9b13f65d99cb3a
Last active August 29, 2015 14:07
Vic's innovative track format
Vic's innovative track format:
1. A track can contain the following characters: A-Z,0-9,[]#?: and blank space. Any other character will be rejected and throws a parse exception. Note that the letters have to be uppercase or else they will be rejected. Why? Because I can.
2. Blank spaces will be ignored, they are just to make the format more readable. (If you really what to do that).
3. The delay is 5 ticks, ~ 4 notes per second maximum.
4. A note looks like this: "A12"
- The character defines the pitch, A is 0.0 and Z is 1.0.
@Victorious3
Victorious3 / gist:85a0fd97e78906886baf
Last active August 29, 2015 14:07
A simple Chat Bot
package vic.bot.test;
import vic.mod.chat.api.bot.IBotHandler;
import vic.mod.chat.api.bot.IChannelBase;
import vic.mod.chat.api.bot.IChatBot;
import vic.mod.chat.api.bot.IChatEntity;
public class TestBot implements IChatBot
{
public IBotHandler botHandler;