Skip to content

Instantly share code, notes, and snippets.

View GopinathMR's full-sized avatar

Gopinath Rangappa GopinathMR

View GitHub Profile
@GopinathMR
GopinathMR / json-schema2athena.sh
Last active June 29, 2017 04:20
json-schema to AWS Athena bulk column format
#!/bin/bash
# $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
GopinathMR / NonLazySingleton.java
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.
@VisibleForTesting
MySingletonClass {
http://eclipsecolorthemes.org/?view=theme&id=22933
#!/bin/sh
#
# 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.
ECLIPSE_HOME=$HOME/eclipse
STYLE_FILE=$HOME/org.eclipse.jdt.core.prefs
echo "Running pre-commit hook: run-eclipse-formatter---------------------"
echo "Will run eclipse formatter, using: $STYLE_FILE"
echo "Listing folders to run formatter on… "
@GopinathMR
GopinathMR / emacs-hotkey-setup.txt
Last active December 19, 2015 13:18
emacs hotkey setup
Install auto-hotkey on windows from http://www.autohotkey.com/
Load script file with extension .ahk , containing belowl lines. This will swap caps lock and left ctrl key.
CapsLock::Ctrl
LCtrl::CapsLock
Load script, you are done :)
@GopinathMR
GopinathMR / _gvimrc
Last active January 16, 2024 12:29
GVim config file (for both Windows and Unix)
" Gopi's _gvimrc file https://github.com/GopinathMR
" This file has been modified to make it work on both Windows and Linux
" Github gist location : https://gist.github.com/1100054
" 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