Skip to content

Instantly share code, notes, and snippets.

@zgiber
zgiber / example.go
Last active August 29, 2015 14:18
AES Encryption and Decryption in GO
package main
import (
"crypto/aes"
"crypto/cipher"
"crypto/rand"
"crypto/sha256"
"fmt"
"io"
)
@zgiber
zgiber / iteratechannel.go
Created August 31, 2015 13:39
Iterating channel
package main
import "fmt"
import "time"
func main() {
pr := make(chan interface{})
go runme(pr)
@zgiber
zgiber / closedchannel.go
Created September 2, 2015 08:55
Handling closed channels.
package main
import (
"fmt"
"time"
)
func main() {
c := make(chan string)
@zgiber
zgiber / main.go
Created September 21, 2015 14:29
API access test
package main
import (
"encoding/json"
"fmt"
"io/ioutil"
"log"
"net/http"
"net/url"
)
package main
import (
"encoding/json"
"fmt"
"log"
"net/http"
"strings"
"golang.org/x/net/context"
brew install macvim --with-cscope --with-lua
git clone https://github.com/VundleVim/Vundle.vim.git ~/.vim/bundle/Vundle.vim
set nocompatible " be iMproved, required
filetype off " required
set rtp+=~/.vim/bundle/Vundle.vim
call vundle#begin()
Plugin 'VundleVim/Vundle.vim'
Plugin 'tpope/vim-sensible'
Plugin 'tpope/vim-fugitive'
Plugin 'jiangmiao/auto-pairs'
Plugin 'tomasr/molokai'
@zgiber
zgiber / init.vim
Last active August 2, 2016 13:37
neovim
set runtimepath^=/Users/zoltangiber/.config/nvim/dein/repos/github.com/Shougo/dein.vim
set swapfile
set backupdir=~/tmp
set nowrap
" call dein#begin(expand('~/.cache/dein'))
call dein#begin(expand('/Users/zoltangiber/.config/nvim/dein'))
call dein#add('Shougo/dein.vim')
call dein#add('Shougo/unite.vim')
call dein#add('bling/vim-airline')
# split panes using | and -
bind | split-window -h
bind - split-window -v
unbind '"'
unbind %
# eliminate escape delay
set -s escape-time 0
# reload config file (change file location to your the tmux.conf you want to use)
@zgiber
zgiber / main.go
Created September 2, 2016 14:45
Http Server Logging request bodies.
package main
import (
"fmt"
"io"
"log"
"net/http"
"os"
"os/signal"
"time"