sudo apt-get install autoconf automake libtool curl make g++ unzip -y
git clone https://github.com/google/protobuf.git
cd protobuf
git submodule update --init --recursive
./autogen.sh
make
make check
sudo make install
sudo ldconfig
This file contains 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 sorting | |
// Bubble sorts the given slice of integers in ascending order with bubble sort algorithm. | |
func Bubble(numbers []int) { | |
size := len(numbers) | |
for i:=0; i<size; i++ { | |
for j:=0; j<i; j++ { | |
if numbers[j] > numbers[i] { | |
numbers[j], numbers[i] = numbers[i], numbers[j] |
This file contains 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 sorting | |
// Selection sorts given list | |
func Selection(list []int) []int { | |
// return list if empty or has single element | |
if len(list) <= 1 { | |
return list | |
} | |
// iterate list elements |
This file contains 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 "fmt" | |
var ( | |
Info = Teal | |
Warn = Yellow | |
Fata = Red | |
) |
This file contains 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
# Use Alt-arrow keys to switch panes | |
bind -n M-Left select-pane -L | |
bind -n M-Right select-pane -R | |
bind -n M-Up select-pane -U | |
bind -n M-Down select-pane -D | |
# Shift arrow to switch windows | |
bind -n S-Left previous-window | |
bind -n S-Right next-window |
This file contains 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
call plug#begin() | |
Plug 'jiangmiao/auto-pairs' | |
Plug 'preservim/nerdcommenter' | |
Plug 'preservim/tagbar' | |
Plug 'preservim/nerdtree' | |
Plug 'tpope/vim-fugitive' | |
Plug 'fatih/vim-go' | |
Plug 'scrooloose/syntastic' | |
Plug 'fatih/molokai' | |
Plug 'ctrlpvim/ctrlp.vim' |
This file contains 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
# Nerd Fonts for your IDE | |
# https://www.nerdfonts.com/font-downloads | |
brew tap homebrew/cask-fonts && brew install --cask font-3270-nerd-font | |
brew tap homebrew/cask-fonts && brew install --cask font-fira-mono-nerd-font | |
brew tap homebrew/cask-fonts && brew install --cask font-inconsolata-go-nerd-font | |
brew tap homebrew/cask-fonts && brew install --cask font-inconsolata-lgc-nerd-font | |
brew tap homebrew/cask-fonts && brew install --cask font-inconsolata-nerd-font | |
brew tap homebrew/cask-fonts && brew install --cask font-monofur-nerd-font | |
brew tap homebrew/cask-fonts && brew install --cask font-overpass-nerd-font |
This file contains 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 ternary | |
type operatorIf[T comparable] struct { | |
condition bool | |
value T | |
elseIf *operatorIf[T] | |
elseValue T | |
} | |
func If[T comparable](condition bool) *operatorIf[T] { |
This file contains 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
with import <nixpkgs> {}; rec { | |
helloNixEnv = stdenv.mkDerivation { | |
name = "hello-nix-env"; | |
buildInputs = [ go ]; | |
}; | |
} |
OlderNewer