Skip to content

Instantly share code, notes, and snippets.

View LemoNode's full-sized avatar

Robert Pettersson LemoNode

  • Sweden Gothenburg
View GitHub Profile
@LemoNode
LemoNode / array.h
Created February 16, 2022 23:17
A simple array/buffer datastructure
#include <stdlib.h>
#include <stdint.h>
#include <assert.h>
// Dynamic Array:
// A stretchy buffer datastructure and a macro interface for both the buffers and static arrays.
// Structure idea by Sean Barrett:
// https://github.com/nothings/stb/blob/master/deprecated/stretchy_buffer.h
typedef struct BufHdr BufHdr;
@LemoNode
LemoNode / audio.ion
Created February 7, 2021 23:18
Ion raylib
// Audio device management functions
@foreign func InitAudioDevice();
@foreign func CloseAudioDevice();
@foreign func IsAudioDeviceReady(): bool;
@foreign func SetMasterVolume(volume: float);
// Wave/loading: Sound/unloading functions
@foreign func LoadWave(fileName: char* const): Wave;
@foreign func LoadWaveFromMemory(fileType: char* const, fileData: uchar* const, dataSize: int): Wave;
@foreign func LoadSound(fileName: char* const): Sound;
@LemoNode
LemoNode / index.html
Last active June 11, 2020 12:21
Simple collision detection / reaction for intersecting rectangles
<head>
<title>Collision</title>
<style>
canvas {
border: 1px solid #333;
}
</style>
</head>
@LemoNode
LemoNode / index.html
Last active May 17, 2020 22:08
simple sqlite/web server in go
<head>
<meta charset="utf-8">
<title>Pågåendelistan</title>
<link rel="stylesheet" type="text/css" href="style.css">
</head>
<body onload="main()">
<nav>
<div id="nav-title">
<h2>Affektiva: Index</h2>
@LemoNode
LemoNode / test.html
Last active March 10, 2020 20:08
calendar with canvas test
<head>
<title>Calendar</title>
<meta charset="utf-8">
<style>
:root {
--nav-height: 120px;
}
body {
margin: auto;
@LemoNode
LemoNode / index.html
Last active March 6, 2020 16:02
fart knockers 3
<head>
<title>Sommar 2020</title>
<meta charset="utf-8">
<style>
:root {
--width: 825px;
}
body {
margin: auto;
@LemoNode
LemoNode / index.html
Last active March 4, 2020 21:50
fart knockers 2
<head>
<title>Lista</title>
<meta charset="utf-8">
<script src="https://d3js.org/d3.v5.min.js"></script>
<style>
:root {
--width: 1005px;
--top: 35px;
}
@LemoNode
LemoNode / main.go
Last active March 6, 2020 17:23
fart knockers
package main
import (
"flag"
"html/template"
"log"
"os/exec"
"net/http"
"strings"
"database/sql"
@LemoNode
LemoNode / main.go
Last active March 3, 2020 21:27
Standard localserver websocket
package main
import (
"flag"
"html/template"
"log"
"net/http"
"github.com/gorilla/websocket"
)
@LemoNode
LemoNode / index.html
Created February 4, 2020 15:37
2d game platformer
<head>
<meta charset="utf-8">
<title>Hello</title>
<style>
canvas {
background: #ddd;
outline: none;
}
</style>
</head>