Skip to content

Instantly share code, notes, and snippets.

// Copyright 2014 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
package draw
import (
"image"
"image/color"
"math"
@klauspost
klauspost / scale.go
Created February 19, 2015 14:41
Integer version of the scaler, with fast path for RGBA.
// Copyright 2014 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
package draw
import (
"image"
"image/color"
"math"
<Camera make="AVT" model="F-080C" mode="chdk">
<CFA2 width="2" height="2">
<ColorRow y="0">RG</ColorRow>
<ColorRow y="1">GB</ColorRow>
</CFA2>
<Crop x="0" y="0" width="0" height="0"/>
<Sensor black="0" white="255"/>
<Hints>
<Hint name="filesize" value="786432"/>
<Hint name="bits" value="8"/>
@klauspost
klauspost / main.go
Last active May 30, 2018 19:20
Download all Communion After Dark mp3 files.
package main
import (
"encoding/xml"
"fmt"
"io"
"net/http"
"os"
"strings"
"sync"
@klauspost
klauspost / main.go
Created April 27, 2015 20:27
Revised benchmark
package main
import (
"encoding/json"
"fmt"
"github.com/pquerna/ffjson/ffjson"
"io"
"log"
"net/http/httptest"
"runtime"
@klauspost
klauspost / bench_test.go
Created April 29, 2015 10:32
narray benchmark
package bench
import (
na "github.com/akualab/narray/na64"
"math"
"testing"
)
func benchmarkMin(bench *testing.B, size int, useGo bool) {
a := na.New(size)
@klauspost
klauspost / dng-names.xml
Last active August 29, 2015 14:20
DNG UniqueCameraModel script split
<ID make="Canon" model="EOS 1000D">Canon EOS 1000D</ID>
<ID make="Canon" model="EOS 100D">Canon EOS 100D</ID>
<ID make="Canon" model="EOS 10D">Canon EOS 10D</ID>
<ID make="Canon" model="EOS 1100D">Canon EOS 1100D</ID>
<ID make="Canon" model="EOS 1200D">Canon EOS 1200D</ID>
<ID make="Canon" model="EOS 20D">Canon EOS 20D</ID>
<ID make="Canon" model="EOS 20Da">Canon EOS 20Da</ID>
<ID make="Canon" model="EOS 300D">Canon EOS 300D</ID>
<ID make="Canon" model="EOS 30D">Canon EOS 30D</ID>
<ID make="Canon" model="EOS 350D">Canon EOS 350D</ID>
package main
import (
"encoding/xml"
"fmt"
"io/ioutil"
"os"
"path/filepath"
"strings"
"time"
@klauspost
klauspost / static.go
Last active August 29, 2015 14:21
revel static file server
package controllers
import (
"os"
fpath "path/filepath"
"strings"
"syscall"
"github.com/revel/revel"
)
package main
import (
"bytes"
"flag"
"fmt"
"io/ioutil"
"os"
"path/filepath"
)