Skip to content

Instantly share code, notes, and snippets.

View dgryski's full-sized avatar
🏠
💻 🍞 ☕

Damian Gryski dgryski

🏠
💻 🍞 ☕
View GitHub Profile
@dgryski
dgryski / godef.vim
Last active December 14, 2015 22:09
vim plugin for godef
" needs https://code.google.com/p/rog-go/source/browse/exp/cmd/godef/godef.go
if !exists("g:godef_command")
let g:godef_command = "godef"
endif
function! GodefUnderCursor()
let offs=line2byte(line('.'))+col('.')-1
call Godef("-o=" . offs)
endfunction
@dgryski
dgryski / stderr.log
Created December 4, 2013 18:36
goconvey panic panic
panic: runtime error: invalid memory address or nil pointer dereference [recovered]
panic: runtime error: invalid memory address or nil pointer dereference
[signal 0xb code=0x1 addr=0x28 pc=0x438298]
goroutine 3 [running]:
runtime.panic(0x550400, 0x70ad88)
/home/dgryski/work/src/cvs/go/src/pkg/runtime/panic.c:266 +0xb6
testing.func·005()
/home/dgryski/work/src/cvs/go/src/pkg/testing/testing.go:385 +0xe8
runtime.panic(0x550400, 0x70ad88)
// Package main is a command-line client search for godoc.org
package main
import (
"encoding/json"
"flag"
"fmt"
"io/ioutil"
"log"
"net/http"
#include <unistd.h>
#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
#include "lz4.h"
int main(int argc, char** argv)
{
(void)argc; (void)argv;
@dgryski
dgryski / Makefile.patch
Last active August 29, 2015 14:06
keyless Makefile sanitize-thread
diff --git a/Makefile b/Makefile
index faf89aa..d64a93e 100644
--- a/Makefile
+++ b/Makefile
@@ -4,6 +4,8 @@
NAME := keyless
+CC=clang
+
@dgryski
dgryski / main.go
Last active August 29, 2015 14:10
package main
import (
"bufio"
"fmt"
"io"
"os"
"sort"
"strconv"
"strings"
package main
import (
"encoding/json"
"fmt"
)
type YoutubeFeed struct {
Version string `json:"version"`
Encoding string `json:"encoding"`
package main
import (
"bufio"
"errors"
"fmt"
"os"
"sort"
"strconv"
"strings"
[org 100h]
; uses fixed point: 1 bit sign, 4 bits int, 11 bits frac
xstart equ -3584 ; -1.75
xend equ 1536 ; 0.75
ystart equ -2048 ; -1.0
yend equ 2048 ; 1.0
xincr equ 16 ; (xend-xstart) div 320
yincr equ 20 ; 20.48 = (yend-ystart) div 200
// +build ignore
package main
import "fmt"
func main() {
// 9 + 9 + 9 + 9 + 9 + 9 + 10
srcmask := uint64(0x007f800000000000)