Skip to content

Instantly share code, notes, and snippets.

View peterhellberg's full-sized avatar
💙
Coding Go

Peter Hellberg peterhellberg

💙
Coding Go
View GitHub Profile
@peterhellberg
peterhellberg / android.go
Created March 9, 2014 10:40
SVGo experiments using goplay
// 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 March 17, 2014 22:55
Keybase.io verification

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 August 29, 2015 13:57
Script that adds my lamps to the TelldusService
# -*- 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 March 30, 2014 18:24
Gobot: Controlling LEDs connected to an Arduino over Firmata using a PS3 DualShock 3 controller.
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 March 31, 2014 11:45
Capistrano 3 and Foreman: Fix upstart exports to stop jobs correctly under upstart 0.6.5
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 April 2, 2014 21:10
Gobot: Controlling LEDs connected to an Arduino over Firmata using your face (OpenCV)
package main
import (
"fmt"
"log"
"path"
"path/filepath"
"runtime"
cv "github.com/hybridgroup/go-opencv/opencv"
@peterhellberg
peterhellberg / contributions.coffee
Last active August 29, 2015 13:58
Rendering public GitHub contributions using Lineman.js and Obelisk.js
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 August 29, 2015 13:58
Experimenting with GLSL
uniform sampler2D tex;
void main(){
gl_FragColor = texture2D(tex, gl_TexCoord[0].xy);
}
@peterhellberg
peterhellberg / api-blink.ino
Created May 19, 2014 20:08
Controlling the D7+RGB leds on the Spark Core over HTTP
@peterhellberg
peterhellberg / percent-difference.go
Last active August 29, 2015 14:04
Percentage Calculators in Go
package main
import (
"fmt"
"os"
"strconv"
)
func main() {
if len(os.Args) == 3 {