Skip to content

Instantly share code, notes, and snippets.

View javapriyan's full-sized avatar

Karthikeyan Annamalai javapriyan

View GitHub Profile
@samalba
samalba / main_test.go
Created July 23, 2013 02:50
How to assert values in golang unit tests
package main
import (
"fmt"
"testing"
)
func assertEqual(t *testing.T, a interface{}, b interface{}, message string) {
if a == b {
return
# Make sure you grab the latest version
curl -OL https://github.com/google/protobuf/releases/download/v3.2.0/protoc-3.2.0-linux-x86_64.zip
# Unzip
unzip protoc-3.2.0-linux-x86_64.zip -d protoc3
# Move protoc to /usr/local/bin/
sudo mv protoc3/bin/* /usr/local/bin/
# Move protoc3/include to /usr/local/include/
@subfuzion
subfuzion / Makefile.md
Last active June 11, 2024 22:07
Makefile for Go projects

Go has excellent build tools that mitigate the need for using make. For example, go install won't update the target unless it's older than the source files.

However, a Makefile can be convenient for wrapping Go commands with specific build targets that simplify usage on the command line. Since most of the targets are "phony", it's up to you to weigh the pros and cons of having a dependency on make versus using a shell script. For the simplicity of being able to specify targets that can be chained and can take advantage of make's chained targets,

@kevin-lee
kevin-lee / JProfiler-with-Docker.md
Created August 10, 2016 15:55
JVM Profiler with Docker

JProfiler with Docker

Docker

DockerFile

DockerFile should have JProfiler installation.

RUN wget <JProfiler file location> -P /tmp/ && \
  tar -xzf /tmp/<JProfiler file> -C /usr/local && \
  rm /tmp/<JProfiler file>
@davisford
davisford / Setup MongoDB on localhost as Replica Set
Last active May 14, 2024 06:37
Setup MongoDB replica set on local host with only a single primary
Add the `replication` section to the mongod.conf file:
```
$cat /usr/local/etc/mongod.conf
systemLog:
destination: file
path: /usr/local/var/log/mongodb/mongo.log
logAppend: true
storage:
engine: mmapv1
@hi5san
hi5san / 01_setup-ubuntu.sh
Last active November 8, 2021 20:38
Hyperledger Fabric + Hyperledger Explorer - Full setup memo scripts (HLF v1.2 + Explorer release-3.8)
#!/bin/sh
# Tested on Ubuntu 16.04LTS/18.04LTS
echo 'export PS1="\[\e[34;1m\]\w\[\e[m\]$ "' >> ~/.profile
. ~/.profile
sudo timedatectl set-timezone Asia/Tokyo
sudo apt -y update
sudo apt -y upgrade
sudo apt -y install \