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 / android.go
Created Mar 9, 2014
SVGo experiments using goplay
View android.go
// Based on https://github.com/ajstarks/svgo/blob/master/android/android.go
package main
import (
"fmt"
"os"
"github.com/ajstarks/svgo"
)
@peterhellberg
peterhellberg / keybase.md
Created Mar 17, 2014
Keybase.io verification
View keybase.md

Keybase proof

I hereby claim:

  • I am peterhellberg on github.
  • I am peterhellberg (https://keybase.io/peterhellberg) on keybase.
  • I have a public key whose fingerprint is 666F 1D43 6DF2 EF1A 6813 8593 A350 956F D60B C6C4

To claim this, I am signing this object:

@peterhellberg
peterhellberg / add_lamps.py
Last active Aug 29, 2015
Script that adds my lamps to the TelldusService
View add_lamps.py
# -*- coding: utf-8 -*-
# This script requires tellcore-py, Python and the Telldus Core library
from tellcore.telldus import TelldusCore
core = TelldusCore()
# Remove all devices
for device in core.devices():
@peterhellberg
peterhellberg / dualshock3-firmata-leds.go
Created Mar 30, 2014
Gobot: Controlling LEDs connected to an Arduino over Firmata using a PS3 DualShock 3 controller.
View dualshock3-firmata-leds.go
package main
import (
"fmt"
"github.com/hybridgroup/gobot"
"github.com/hybridgroup/gobot-firmata"
"github.com/hybridgroup/gobot-gpio"
"github.com/hybridgroup/gobot-joystick"
)
@peterhellberg
peterhellberg / fix_upstart_export.rb
Created Mar 31, 2014
Capistrano 3 and Foreman: Fix upstart exports to stop jobs correctly under upstart 0.6.5
View fix_upstart_export.rb
namespace :foreman do
# See https://github.com/ddollar/foreman/issues/97
desc "Fix upstart exports to stop jobs correctly"
task :fix_upstart_export do
on roles(:app) do
execute :sed, "-i.bak 's/ -c / --session-command /' #{shared_path}/etc/init/application-web-1.conf"
execute :sed, "-i.bak 's/ -c / --session-command /' #{shared_path}/etc/init/application-worker-1.conf"
end
end
end
@peterhellberg
peterhellberg / face-leds.go
Created Apr 2, 2014
Gobot: Controlling LEDs connected to an Arduino over Firmata using your face (OpenCV)
View face-leds.go
package main
import (
"fmt"
"log"
"path"
"path/filepath"
"runtime"
cv "github.com/hybridgroup/go-opencv/opencv"
@peterhellberg
peterhellberg / contributions.coffee
Last active Aug 29, 2015
Rendering public GitHub contributions using Lineman.js and Obelisk.js
View contributions.coffee
window.drawContributions = (data) ->
s = 12
canvas = document.getElementById('contributions')
point = new obelisk.Point(200, 100)
pixelView = new obelisk.PixelView(canvas, point)
color = new obelisk.SideColor().getByInnerColor(0xFEFEFE)
color.border = 0x14000000
@peterhellberg
peterhellberg / wave.fs
Last active Aug 29, 2015
Experimenting with GLSL
View wave.fs
uniform sampler2D tex;
void main(){
gl_FragColor = texture2D(tex, gl_TexCoord[0].xy);
}
@peterhellberg
peterhellberg / redis_connection_string.go
Created Apr 29, 2014
Parsing a Redis connection string for use with go-workers
View redis_connection_string.go
package main
import (
"fmt"
"net/url"
"strings"
)
func main() {
s := "redis://username:password@my.host:6389/4?pool=25&process=2"
@peterhellberg
peterhellberg / api-blink.ino
Created May 19, 2014
Controlling the D7+RGB leds on the Spark Core over HTTP
View api-blink.ino
You can’t perform that action at this time.