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
*/
@gigaherz
gigaherz / ALU.vhdl
Created October 14, 2013 19:28
An implementation of a simple 4-instruction CPU, in VHDL
library IEEE;
use IEEE.std_logic_1164.all;
use IEEE.std_logic_arith.all;
use IEEE.std_logic_unsigned.all;
use work.constants.all;
use work.ctypes.all;
entity ALU is port (
clk : in std_logic;
function SetupForm{
[reflection.assembly]::loadwithpartialname("System.Windows.Forms") | Out-Null;
[reflection.assembly]::loadwithpartialname("System.Drawing") | Out-Null;
$form = New-Object System.Windows.Forms.Form;
$dgv = New-Object System.Windows.Forms.DataGridView;
$form.Text = "TCP Connection Status";
$form.Name = "form";
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!" }
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;
This document describes an hypotetical type hierarchy for a non-existing environment.
It has been inspired by the CLR, JVM, and some IRC conversations.
Type tree:
----------
Any
Void
Value
Primitive
@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;