Skip to content

Instantly share code, notes, and snippets.

💙
Coding Go

Peter Hellberg peterhellberg

💙
Coding Go
Block or report user

Report or block peterhellberg

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@peterhellberg
peterhellberg / cube.go
Last active May 17, 2020
Cube software 3d renderer
View cube.go
package main
import (
"image/color"
"github.com/faiface/pixel"
"github.com/faiface/pixel/imdraw"
"github.com/faiface/pixel/pixelgl"
"github.com/go-gl/mathgl/mgl64"
)
@peterhellberg
peterhellberg / build.zig
Last active May 15, 2020
sdl-zig-demo (https://github.com/andrewrk/sdl-zig-demo) made to work with zig 0.6.0
View build.zig
const Builder = @import("std").build.Builder;
pub fn build(b: *Builder) void {
const mode = b.standardReleaseOptions();
const exe = b.addExecutable("sdl-zig-demo", "src/main.zig");
exe.setBuildMode(mode);
exe.linkSystemLibrary("SDL2");
exe.linkSystemLibrary("c");
exe.install();
@peterhellberg
peterhellberg / ebiten-gfx-raycaster.go
Last active May 12, 2020
Raycaster rendered by Ebiten using gfx.
View ebiten-gfx-raycaster.go
package main
import (
"bytes"
"flag"
"image"
"image/color"
"math"
"time"
@peterhellberg
peterhellberg / Makefile
Created May 12, 2020
Example of c-shared libhello.so
View Makefile
.PHONY: all build compile clean
all: build compile
build:
go build -buildmode=c-shared -o libhello.so libhello.go
compile:
cc -o hello hello.c libhello.so
clean:
@peterhellberg
peterhellberg / deadpool.go
Created Jan 24, 2017
Using chromedp to take screenshots
View deadpool.go
package main
import (
"context"
"io/ioutil"
"log"
"time"
cdp "github.com/knq/chromedp"
)
@peterhellberg
peterhellberg / nimgobus-example.go
Last active Apr 30, 2020
Nimgobus example without package global variables
View nimgobus-example.go
package main
import (
_ "image/png"
"time"
"github.com/adamstimb/nimgobus"
"github.com/hajimehoshi/ebiten"
)
View gfx-sprator.go
package main
import (
"flag"
"image"
"image/color"
"time"
"github.com/peterhellberg/gfx"
)
@peterhellberg
peterhellberg / minimal-server.go
Created May 16, 2018
A pretty minimal HTTP server example in Go
View minimal-server.go
package main
import (
"io/ioutil"
"log"
"net/http"
"os"
"time"
)
@peterhellberg
peterhellberg / bouncing-pixels.go
Created Mar 29, 2020
Drawing to the RPi (SenseHat) framebuffer over the network
View bouncing-pixels.go
package main
import (
"bufio"
"bytes"
"image/color"
"image/draw"
"net/http"
"time"
@peterhellberg
peterhellberg / acnl.go
Last active Apr 17, 2020
Initial version of a parser for ACNL pattern files
View acnl.go
package acnl
import (
"bytes"
"encoding/binary"
"image"
"image/color"
"io"
"io/ioutil"
)
You can’t perform that action at this time.