Skip to content

Instantly share code, notes, and snippets.

@mrvdot
mrvdot / jsonphandler.go
Last active December 21, 2015 10:58
If you've ever wanted to handle JSONP callbacks within a Go powered API, here's a simple wrapper that you can use to intercept the callback query variable and properly wrap the response. It's designed to take an entire http.Handler, so works particularly well when using a router such as mux from gorilla, however can work with any handler.
import (
"io"
"net/http"
)
//With HandlerFunc
func main () {
http.Handle("/", JsonpHandler(http.HandlerFunc(func (w http.ResponseWriter, r *http.Request) {
w.Write("Hello World")
})))
@dypsilon
dypsilon / frontendDevlopmentBookmarks.md
Last active October 26, 2025 08:45
A badass list of frontend development resources I collected over time.
@BCdmlap
BCdmlap / android-4.2-video.html
Created April 8, 2013 18:33
Android 4.2 video playback restrictions
<!doctype html>
<html>
<head>
<title></title>
<style>
button {
display: block;
width: 100px;
height: 100px;
}