Skip to content

Instantly share code, notes, and snippets.

View daved's full-sized avatar

Daved daved

View GitHub Profile
@daved
daved / gist:0a8e4f7b9173dc049e37f964c40f0ee2
Last active January 5, 2025 23:02
ghostty/mpstat: NixOS, Wayland, Sway, Nividia 3080TI
alacritty | `mpstat 5 1`
02:38:24 PM CPU %usr %nice %sys %iowait %irq %soft %steal %guest %gnice %idle
02:38:29 PM all 0.16 0.00 0.09 0.01 0.06 0.03 0.00 0.00 0.00 99.65
firefox/youtub.com 4k video (alacritty) | `mpstat 5 1`
02:41:48 PM CPU %usr %nice %sys %iowait %irq %soft %steal %guest %gnice %idle
02:41:53 PM all 6.68 0.00 1.08 0.05 0.31 0.15 0.00 0.00 0.00 91.73
ghostty | `mpstat 5 1`
02:39:45 PM CPU %usr %nice %sys %iowait %irq %soft %steal %guest %gnice %idle
@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"