Skip to content

Instantly share code, notes, and snippets.

View GopinathMR's full-sized avatar

Gopinath Rangappa GopinathMR

View GitHub Profile
GopinathMR /
Last active June 29, 2017 04:20
json-schema to AWS Athena bulk column format
# $1 is json-schema file path
cat $1 | jq ".properties | to_entries[] | (.key + \" \" + .value.type)" | sed -e "s/integer/int/g" | sed -e "s/ \"$/ string\"/g" | sed -e "s/\"//g" | sed -e "s/$/,/g"
GopinathMR /
Last active April 20, 2021 08:45
how to mock methods in Singleton
// sample code written to showcase how to use Mockito to mock certain methods to test logic in Singleton classes
public class MySingletonClass {
// not lazy initiated object.
private static final MySingeltonClass INSTANCE = new MySingletonClass();
// can be used by unit test by Mocking it. Mockito invokes this default constructor.
MySingletonClass {
# This hook will run the eclipse code formatter before any commit
# to make the source look as it's supposed to look like in the repo.
echo "Running pre-commit hook: run-eclipse-formatter---------------------"
echo "Will run eclipse formatter, using: $STYLE_FILE"
echo "Listing folders to run formatter on… "
GopinathMR / emacs-hotkey-setup.txt
Last active December 19, 2015 13:18
emacs hotkey setup
Install auto-hotkey on windows from
Load script file with extension .ahk , containing belowl lines. This will swap caps lock and left ctrl key.
Load script, you are done :)
GopinathMR / _gvimrc
Last active January 16, 2024 12:29
GVim config file (for both Windows and Unix)
" Gopi's _gvimrc file
" This file has been modified to make it work on both Windows and Linux
" Github gist location :
" If you find any issues or add any enhancements, please submit revised version as gist
" 1. OS specific
if ($OS == 'Windows_NT')
" Windows specific settings