This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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)) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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) | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| package main | |
| import ( | |
| "log" | |
| "github.com/howeyc/fsnotify" | |
| ) | |
| func SetWatch(dir string, ce chan *fsnotify.FileEvent) { | |
| watcher, err := fsnotify.NewWatcher() | |
| if err != nil { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| package main | |
| import ( | |
| "log" | |
| "github.com/howeyc/fsnotify" | |
| ) | |
| func SetWatch(dir string, ce chan *fsnotify.FileEvent) { | |
| watcher, err := fsnotify.NewWatcher() | |
| if err != nil { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| client.On("connect", func(ns *socketio.NameSpace) { | |
| log.Println("connected") | |
| ns.Emit("ping", nil) | |
| }) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #include <zmq.h> | |
| #include <czmq.h> | |
| #include "include/dbg.h" | |
| #define DEBUG 1 | |
| int | |
| main (void) | |
| { | |
| void *ctx = zmq_ctx_new (); |