Skip to content

Instantly share code, notes, and snippets.

@gigaherz
gigaherz / lcd3x.cg
Created November 1, 2012 13:54
Cg recreation of the Lcd3x scaling algorithm.
/* COMPATIBILITY
- HLSL compilers (untested)
- Cg compilers
*/
/*
Author: Gigaherz
License: Public domain
*/
The Minecraft Redstone-inspired Pseudo-language
Registers and ports
--------------------
R0.. R15 Redstone lines, each a 16 bit SIGNED register, but the value is shifted every instruction
If the top bit is 0, it shifts down,
If thetop bit is 1, it shifts up
C0..15 Cauldrons, respectively pre-filled with "(1<<n)-1"
#define WIN32_LEAN_AND_MEAN // Exclude rarely-used stuff from Windows headers
#include <stdio.h>
#include <windows.h>
#include <math.h>
struct NoteInfo_t {
const char * note;
float freq;
@gigaherz
gigaherz / ui.gddl
Last active January 22, 2016 23:22
Screen {
version="1",
ProgressBar { geometry="30x40+10,10" }
Panel {
geometry = "30x80+10,60",
title = "Some Awesome Panel",
showBorder = true,
Label { text="Hello, GUI!" }
@gigaherz
gigaherz / 00. Description.md
Last active April 24, 2016 10:57
Thoughts on a semantic description for user interfaces, where the UI engine and theme decide the actual layout and controls used.

Semantic UI

Semantic UI represents a description of an user interface, in terms of 'what', and not 'how'.

Each element in the description consists of an identifier, a set of attributes, and a set of children.

##Syntax uses in the examples

The example syntax uses an indent-delimited format, with the character '#' indicating a comment until the end of the line. Multi-line comments start with '#[' and end with ']#', and nesting is allowed.

package gigaherz.enderthing.client;
import com.google.common.collect.Maps;
import com.google.gson.stream.JsonReader;
import com.google.gson.stream.JsonToken;
import java.io.IOException;
import java.io.InputStreamReader;
import java.net.MalformedURLException;
import java.net.URL;
package gigaherz.enderRift.common.container;
import net.minecraft.item.ItemStack;
public interface IItemHandlerContainer
{
boolean isItemValidForSlot(int slot, ItemStack stack);
int getInventoryStackLimit(int slot);
}
package gigaherz.survivalist.itemcap;
import net.minecraft.entity.Entity;
import net.minecraft.nbt.NBTBase;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.util.EnumFacing;
import net.minecraftforge.common.capabilities.Capability;
import net.minecraftforge.common.capabilities.CapabilityInject;
import net.minecraftforge.common.capabilities.CapabilityManager;
package gigaherz.packingtape.cap;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemStack;
import net.minecraftforge.items.ItemStackHandler;
/**
* Created by gigaherz on 06/08/2016.
*
* This class is the feature we want to attach to the player.
{
"__comment": "It may be best to have a difference between localization keys, and actual display strings",
"name": "entity.creeper.name",
"__comment": "User-defined 'team', useful for distinguishing enemies",
"faction": "creeper",
"initial_state": "wander",
"states": {