Skip to content

Instantly share code, notes, and snippets.

View daved's full-sized avatar

Daved daved

View GitHub Profile
@daved
daved / main.hs
Created April 26, 2018 06:27 — forked from mdrohmann/main.hs
shorter version of asynchronous delayed function
import Control.Concurrent
import Control.Concurrent.Async
main:: IO()
main = do
a <- async (do threadDelay 5000; return 42)
r <- wait a
putStrLn ("The answer is: " ++ show r)
package main
import (
"fmt"
"time"
)
func main() {
c := make(chan int)
// ==UserScript==
// @name Present tool styling.
// @namespace https://www.codemodus.com
// @version 0.1
// @description Configure present tool style using a "theme" param. (options: dark|light)
// @author daved
// @match http*://*/*.slide*
// @grant none
// ==/UserScript==
@daved
daved / index_test.go
Last active August 29, 2015 14:23
Index func benchmark
package main_test
import (
"strings"
"testing"
)
const (
primeRK = 16777619
)
@daved
daved / wrapper_test.go
Last active August 29, 2015 14:22
framework detangling (handler wrappers)
package chain_test
import (
"net/http"
"net/http/httptest"
"testing"
"github.com/codemodus/chain"
"golang.org/x/net/context"
"github.com/kressin/middleware"