Skip to content

Instantly share code, notes, and snippets.

@Lerc
Lerc / index.html
Last active Nov 25, 2020 — forked from kahole/index.html
*scratch*.js
View index.html
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<title>*scratch*</title>
<style>
body {
font-family: Hack, Menlo, Monaco, 'Droid Sans Mono', 'Courier New', monospace;
white-space: pre;
@Lerc
Lerc / Main.kasm
Last active Nov 19, 2020
Input Example
View Main.kasm
.include "defs"
.include "kwak8"
.include "utility"
.org 0
jmp init
.org $10
@Lerc
Lerc / Main.kasm
Last active Dec 3, 2019
Kwak-8 base program
View Main.kasm
.include "defs"
.include "kwak8"
.include "utility"
.include "scratch"
.use Mode0Code
.org 0
jmp init
View gist:4bc28d1ea227682350e3f44cd0b9b0ba
Operands are variant unless specified.
OPERATOR op,a,b,dst
EXTENDS_TEST a,b,dst
IS_BUILTIN value,_,dst
SET dst,index,value
GET src,index,value
SET_NAMED dst, indexName:int, value
GET_NAMED src, indexName:int, dst
View gist:60272b13ab1bbaccf690b493381c1b55
OPERATOR op,a,b,dst
EXTENDS_TEST a,b,dst
IS_BUILTIN value,_,dst
SET dst,index,value
GET src,index,value
SET_NAMED dst, indexName:int, value
GET_NAMED src, indexName:int, dst
SET_MEMBER indexName:int, src
GET_MEMBER indexName:int, dst
ASSIGN dst,src
@Lerc
Lerc / clutter_style_properties.md
Last active Nov 11, 2015
Clutter Style Properties
View clutter_style_properties.md

on st-theme-node

  • box-shadow
  • -st-background-image-shadow (does not support inset)
  • text-shadow (does not support inset)
  • color
  • warning-color
  • error-color
  • success-color
@Lerc
Lerc / RegTest.hx
Last active Aug 29, 2015
A Haxe Macro example. Allows class properties to be added that map to an array entry. I made this for a project using JavaScript typed arrays for speed.
View RegTest.hx
import js.html.Uint8Array;
@:build( RegisterMacro.memoryMappedRegister("r0",123) )
class RegTest
{
var ram : Uint8Array;
public function new() {
ram = new Uint8Array(65536);
}
View gist:06b7c0cc29df69f7f400
switch (instruction & 0xf000) {
case 0x0000: { //nop movw muls mulsu fmul fmuls fmulsu cpc sbc add
switch (instruction & 0x0c00) {
case 0x0000: {
switch (instruction & 0xff00) {
case 0x0000: { //nop
}
case 0x0100: { //movw
View flipper.c
#include <unistd.h>
#include <stdlib.h>
#include <signal.h>
#include <stdio.h>
void sig_handler(int sig) {exit(0);};
int main () {
signal(SIGTERM,sig_handler);
pid_t pid_v;
@Lerc
Lerc / jmpabuse.c
Created Mar 24, 2012
A simple string unscrabler using a turing machine inside a single expression.
View jmpabuse.c
#include <stdio.h>
#include <setjmp.h>
int J(jmp_buf x, int y) {
longjmp(x,y);
return 0;
}
int main(int argc, char **argv)
{