Skip to content

Instantly share code, notes, and snippets.

Avatar

Josh Bleecher Snyder josharian

View GitHub Profile
View goroutines.txt
goroutine profile: total 48
10 @ 0x1038570 0x10484d3 0x142a762 0x14fa5ed 0x1490f96 0x1067b91
# 0x142a761 github.com/pion/transport/packetio.(*Buffer).Read+0x141 /Users/josh/pkg/mod/github.com/pion/transport@v0.10.0/packetio/buffer.go:146
# 0x14fa5ec github.com/pion/webrtc/v2/internal/mux.(*Endpoint).Read+0x4c /Users/josh/pkg/mod/github.com/pion/webrtc/v2@v2.2.15-0.20200606101323-d41427855005/internal/mux/endpoint.go:36
# 0x1490f95 github.com/pion/srtp.(*session).start.func1+0xb5 /Users/josh/pkg/mod/github.com/pion/srtp@v1.3.4/session.go:130
5 @ 0x1038570 0x1007b37 0x100783b 0x148b815 0x1528dd2 0x1067b91
# 0x148b814 github.com/pion/srtp.(*SessionSRTCP).AcceptStream+0x44 /Users/josh/pkg/mod/github.com/pion/srtp@v1.3.4/session_srtcp.go:92
# 0x1528dd1 github.com/pion/webrtc/v2.(*PeerConnection).drainSRTP.func3+0xa1 /Users/josh/pkg/mod/github.com/pion/webrtc/v2@v2.2.15-0.20200606101323-d41427855005/peerconnection.go:1102
@josharian
josharian / main.go
Created May 23, 2020
play opus audio to any browser that connects
View main.go
// Demo of playing opus audio into a webrtc session on macOS.
// To install required packages/commands:
// brew install ffmpeg pkg-config opus opusfile
// Then run this server, and visit http://localhost:2021/ in a browser.
package main
import (
"encoding/binary"
"encoding/json"
@josharian
josharian / causalprof_compiler.diff
Created Jun 13, 2019
attempt to instrument the compiler for causal profiling
View causalprof_compiler.diff
diff --git a/src/cmd/compile/internal/gc/main.go b/src/cmd/compile/internal/gc/main.go
index dc3fb64e27..21e211e339 100644
--- a/src/cmd/compile/internal/gc/main.go
+++ b/src/cmd/compile/internal/gc/main.go
@@ -27,6 +27,7 @@ import (
"path"
"regexp"
"runtime"
+ "runtime/causalprof"
"strconv"
View gist:cba98a51403692ce00dcda156bd13af2
digraph {
rankdir=LR;
"github.com/josharian/depcut";
"bytes";
"errors";
"internal/bytealg";
"internal/cpu";
"unsafe";
"io";
"sync";
View x_test.go
package p
import (
_ "net/http"
"testing"
_ "unsafe"
)
//go:linkname _initdone net/http.initdone·
var _initdone uint8
View git2go_runtime_crash.go
package main
import (
"os"
git "gopkg.in/libgit2/git2go.v26"
)
func main() {
pwd, err := os.Getwd()
View git-whose-tree.go
package main
import (
"flag"
"fmt"
"log"
"os"
git "gopkg.in/libgit2/git2go.v26"
)
View gen_git2go_enum.go
package main
import (
"bytes"
"flag"
"fmt"
"os"
"strings"
"github.com/go-clang/v3.9/clang"
View gist:2e8e8ba23a99317820291b30b47a64fb
package main
import (
"bytes"
"flag"
"fmt"
"os"
"strings"
"github.com/go-clang/v3.9/clang"
@josharian
josharian / issue16122_test.go
Created May 16, 2017
extract for go issue 16122
View issue16122_test.go
/*
Copyright 2011-2013 Frederic Langlet
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
you may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
You can’t perform that action at this time.