Skip to content

Instantly share code, notes, and snippets.

View pavansokkenagaraj's full-sized avatar
👹

Pavan Sokke Nagaraj pavansokkenagaraj

👹
View GitHub Profile
@VinGarcia
VinGarcia / README.md
Last active August 4, 2022 19:03
A script to wrap protoc & several dependencies in a portable way (meant to work with Golang)

This script was written to make it easy to compile protobuf files into Golang. It depends only on docker and bash which should make it very portable.

Usage

To run this script just copy it to your project (you can add it to version control) and then run it passing as argument the relative or absolute path of the directory containing your .proto files, e.g.:

bash protogen.sh my_proto_dir/
@wrunk
wrunk / user_test.go
Last active January 25, 2021 23:34
Golang unit test for panic scenario
func TestUserFail(t *testing.T) {
func() {
defer func() {
if r := recover(); r == nil {
t.Errorf("TestUserFail should have panicked!")
}
}()
// This function should cause a panic
CreateUser(12, "hello")
@GrantSchiller
GrantSchiller / Browser.java
Created January 16, 2014 23:59
Browser history java
import java.io.*;
public class Browser {
private boolean browsing;
private WebVisit currentVisit;
/**
* Main method for the application. Create a new Browser object and set it to run.
*/
@AlexMocioi
AlexMocioi / main.go
Created December 18, 2013 00:34 — forked from tonyhb/main.go
Convert struct to map
package main
import (
"fmt"
"net/url"
"reflect"
"strconv"
)
type Person struct {
@criminy
criminy / AbstractJdbcRepository.java
Created September 9, 2011 16:43
Implementation of PagingAndSortingRepository using JdbcTemplate
import java.io.Serializable;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.data.domain.Sort;