Skip to content

Instantly share code, notes, and snippets.

View taotetek's full-sized avatar
💭
Left for Gitlab. Microsoft still contracts with ICE.

taotetek taotetek

💭
Left for Gitlab. Microsoft still contracts with ICE.
View GitHub Profile
@taotetek
taotetek / vimrc
Created July 11, 2014 17:39
vimrc
set nocompatible
filetype off
set rtp+=~/.vim/bundle/Vundle.vim
call vundle#begin()
Plugin 'gmarik/Vundle.vim'
Plugin 'tpope/vim-fugitive'
Plugin 'git://github.com/scrooloose/nerdtree'
Plugin 'git://github.com/Valloric/YouCompleteMe'
@taotetek
taotetek / gopher_example.go
Created June 28, 2014 20:45
gopher_example.go
func TestGopherDirToJSON(t *testing.T) {
gd, err := NewGopherDir("gopher://gopher.quux.org:70")
if err != nil {
t.Fatal(err)
}
jsonBytes, err := gd.ToJSON()
if err != nil {
t.Fatal(err)
}
fmt.Print(string(jsonBytes))
@taotetek
taotetek / vimrc
Created June 25, 2014 13:45
vimrc
set nocompatible
filetype off
set rtp+=~/.vim/bundle/Vundle.vim
call vundle#begin()
Plugin 'gmarik/Vundle.vim'
Plugin 'tpope/vim-fugitive'
Plugin 'git://github.com/scrooloose/nerdtree'
Plugin 'git://github.com/Valloric/YouCompleteMe'
type Config struct {
Directories []string
Files []string
}
func NewConfig(path string) (*Config, error) {
c := new(Config)
cFile, err := ioutil.ReadFile(path)
if err != nil {
return nil, err
func main() {
evChan := make(chan *fsnotify.FileEvent)
lnChan := make(chan *tail.Line)
done := make(chan string)
conf := new(Config)
err := conf.LoadConf("./goforward.json")
if err != nil {
log.Fatal(err)
}
package main
import (
"log"
"github.com/howeyc/fsnotify"
)
func SetWatch(dir string, ce chan *fsnotify.FileEvent) {
watcher, err := fsnotify.NewWatcher()
if err != nil {
package main
import (
"log"
"github.com/howeyc/fsnotify"
)
func SetWatch(dir string, ce chan *fsnotify.FileEvent) {
watcher, err := fsnotify.NewWatcher()
if err != nil {
@taotetek
taotetek / stats.sql
Created March 22, 2014 21:53
meatspace stats query
select
date_trunc ('day', interval) as meatdate,
topic,
sum(total) as total,
hll_cardinality(hll_union_agg(users)) as uniques
from
daily_stats
where
topic in ('meatspace.incoming', 'meatspace.outgoing')
group by
client.On("connect", func(ns *socketio.NameSpace) {
log.Println("connected")
ns.Emit("ping", nil)
})
#include <zmq.h>
#include <czmq.h>
#include "include/dbg.h"
#define DEBUG 1
int
main (void)
{
void *ctx = zmq_ctx_new ();