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 / ffserver.conf
Last active Jul 14, 2019
MJPEG stream from Webcam using FFServer and FFMpeg
View ffserver.conf
HTTPPort 8090
HTTPBindAddress 0.0.0.0
MaxHTTPConnections 200
MaxClients 100
MaxBandWidth 500000
CustomLog -
<Feed camera.ffm>
File /tmp/camera.ffm
FileMaxSize 200M
@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 / 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 / minimal-queue.go
Created Jan 16, 2018
A pretty minimal work queue
View minimal-queue.go
package main
import (
"log"
"net/http"
"os"
"time"
)
func main() {
@peterhellberg
peterhellberg / gui-d2.go
Created May 13, 2019
D2 menu using gui/gfx
View gui-d2.go
This file has been truncated, but you can view the full file.
package main
import (
"bytes"
"image"
"image/draw"
"github.com/peterhellberg/gfx"
"github.com/peterhellberg/gui"
@peterhellberg
peterhellberg / gui-experiment.go
Last active May 12, 2019
GUI experiment with two routines drawing parts of the window (foo draws the upper half, bar the bottom half)
View gui-experiment.go
package main
import (
"image"
"image/draw"
"github.com/peterhellberg/gfx"
"github.com/peterhellberg/gui"
)
@peterhellberg
peterhellberg / gui-xor.go
Last active May 12, 2019
XOR image drawn by gfx, and displayed using gui
View gui-xor.go
package main
import (
"image"
"image/draw"
"github.com/peterhellberg/gfx"
"github.com/peterhellberg/gui"
)
View gfx-ASCII-color-ramp.go
package main
import "github.com/peterhellberg/gfx"
const w, h = 16, 16
const ramp = " .:-=+*#%@"
func main() {
m := gfx.NewGray(gfx.IR(0, 0, w, h))
@peterhellberg
peterhellberg / cube.go
Last active Apr 28, 2019
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 / Gemfile
Created Apr 10, 2012
Sinatra acceptance testing, using minitest/spec and capybara-webkit
View Gemfile
source :rubygems
gem "sinatra", "~> 1.3.2"
group :test do
gem "minitest", "~> 2.10"
gem "rack-test", "~> 0.6.1"
gem "capybara", "~> 1.1"
gem "capybara-webkit", "~> 0.11"
gem "capybara_minitest_spec", "~> 0.2"
You can’t perform that action at this time.