Skip to content

Instantly share code, notes, and snippets.

👽
ugh I hate homewo-MOMGETOUTOFMYROOM

Brian Picciano mediocregopher

👽
ugh I hate homewo-MOMGETOUTOFMYROOM
Block or report user

Report or block mediocregopher

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@mediocregopher
mediocregopher / panic_test.go
Last active Feb 4, 2019
this benchmark panics on arm64
View panic_test.go
package panicker
import (
"runtime"
. "testing"
"github.com/mediocregopher/radix/v3"
)
func BenchmarkPanic(b *B) {
View radixv3_pool_load_test.go
package main
import (
"log"
"time"
"github.com/mediocregopher/mediocre-go-lib/mrand"
radix "github.com/mediocregopher/radix.v3"
)
@mediocregopher
mediocregopher / brainfuck.rs
Created Jun 16, 2016
Simple implementation of a brainfuck interpreter in rust
View brainfuck.rs
/*
[dependencies]
clap = "2"
*/
extern crate clap;
use clap::{Arg, App};
use std::num::Wrapping;
use std::io::Read;
@mediocregopher
mediocregopher / brpc.go
Created Jun 15, 2016
An RPC system from Go inspired by the http.Handler system
View brpc.go
// Package brpc, stands for better-rpc. It's better than normal RPC, because it
// allows for saner chaining of rpc handlers
package brpc
import (
"encoding/json"
"net/http"
"golang.org/x/net/context"
)
@mediocregopher
mediocregopher / client.go
Last active Jun 8, 2016
Example of a TLS echo server and client which also use the PROXY protocol
View client.go
package main
import (
"crypto/tls"
"fmt"
"io"
"log"
"net"
"os"
)
@mediocregopher
mediocregopher / go-deps-refs.sh
Created Feb 1, 2016
Prints out the revisions of all checked out dependencies of a go project that can be found in GOPATH
View go-deps-refs.sh
#!/bin/sh
function printDep {
dep="$1"
if [ "$dep" == "." ]; then return 0; fi
cd "$GOPATH/src/$dep"
if [ -d ".git" ]; then
echo "$dep (git) - $(git log --abbrev-commit --oneline -n 1)"
return 0
@mediocregopher
mediocregopher / main.go
Last active Sep 10, 2015
Demonstrating a simple wrapper around gorilla's json2 rpc abstraction
View main.go
package main
import (
"bytes"
"log"
"math/rand"
"net/http"
"time"
"github.com/gorilla/rpc/v2"
View gist:e2094a1900b7a30e75ae
~ ▻ gem install --debug chef
NOTE: Debugging mode prints all exceptions even when rescued
Exception `ArgumentError' at /home/mediocregopher/.rvm/rubies/ruby-1.9.3-p551/lib/ruby/1.9.1/resolv.rb:2318 - IPv6 address must be 16 bytes
ERROR: While executing gem ... (ArgumentError)
IPv6 address must be 16 bytes
/home/mediocregopher/.rvm/rubies/ruby-1.9.3-p551/lib/ruby/1.9.1/resolv.rb:2318:in `initialize'
/home/mediocregopher/.rvm/rubies/ruby-1.9.3-p551/lib/ruby/1.9.1/resolv.rb:2058:in `new'
/home/mediocregopher/.rvm/rubies/ruby-1.9.3-p551/lib/ruby/1.9.1/resolv.rb:2058:in `decode_rdata'
/home/mediocregopher/.rvm/rubies/ruby-1.9.3-p551/lib/ruby/1.9.1/resolv.rb:1556:in `block in get_rr'
/home/mediocregopher/.rvm/rubies/ruby-1.9.3-p551/lib/ruby/1.9.1/resolv.rb:1457:in `get_length16'
View keybase.md

Keybase proof

I hereby claim:

  • I am mediocregopher on github.
  • I am mediocregopher (https://keybase.io/mediocregopher) on keybase.
  • I have a public key whose fingerprint is 27AB 502A 9EA8 96F6 4A27 4970 95C4 6FA6 A411 48AC

To claim this, I am signing this object:

You can’t perform that action at this time.