Skip to content

Instantly share code, notes, and snippets.

View presmihaylov's full-sized avatar

Pres Mihaylov presmihaylov

View GitHub Profile
func main() {
logger, _ := zap.NewProduction()
defer logger.Sync()
slogger := logger.Sugar()
mux := http.NewServeMux()
httphandler.New(mux, slogger)
http.ListenAndServe(":8080", mux)
}
@presmihaylov
presmihaylov / main.go
Last active April 12, 2020 07:25
Main function at the start
package main
import (
"net/http"
"github.com/preslavmihaylov/fxappexample/httphandler"
)
func main() {
mux := http.NewServeMux()
@presmihaylov
presmihaylov / httphandler.go
Last active April 12, 2020 07:24
First try at Go http handler
package httphandler
import "net/http"
// Handler for http requests
type Handler struct {
mux *http.ServeMux
}
// New http handler
" enable incremental search in vim
set incsearch
" Use tab and shift-tab to move around matches
cmap <Tab> <C-g>
cmap <S-Tab> <C-t>
" map turning off highlighting after search and closing quickfix window
nnoremap <Esc><Esc> :noh<CR>:ccl<CR>
" stop results highlighting after cursor moves
let g:incsearch#auto_nohlsearch = 1
map / <Plug>(incsearch-forward)
map ? <Plug>(incsearch-backward)
map g/ <Plug>(incsearch-stay)
git clone https://github.com/haya14busa/incsearch.vim ~/.vim/bundle/incsearch.vim
@presmihaylov
presmihaylov / pathogen.vim installation
Created June 8, 2018 12:55
Simple install of pathogen vim plugin
mkdir -p ~/.vim/autoload ~/.vim/bundle && \
curl -LSso ~/.vim/autoload/pathogen.vim https://tpo.pe/pathogen.vim
@presmihaylov
presmihaylov / .bashrc
Created May 1, 2018 09:22
start tmux by default when you open a new terminal window
if [[ ! $TERM =~ screen ]]; then
exec tmux
fi