Skip to content

Instantly share code, notes, and snippets.

Avatar

Gopinath Rangappa GopinathMR

View GitHub Profile
@GopinathMR
GopinathMR / json-schema2athena.sh
Last active Jun 29, 2017
json-schema to AWS Athena bulk column format
View json-schema2athena.sh
#!/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 Apr 20, 2021
how to mock methods in Singleton
View NonLazySingleton.java
// 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 {
View eclipse theme -smootheyes
http://eclipsecolorthemes.org/?view=theme&id=22933
View gist:6012432
#!/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… "
View emacs-hotkey-setup.txt
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 Nov 10, 2022
GVim config file (for both Windows and Unix)
View _gvimrc
" 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