Skip to content

Instantly share code, notes, and snippets.

Keybase proof

I hereby claim:

  • I am rajatvig on github.
  • I am rajatvig (https://keybase.io/rajatvig) on keybase.
  • I have a public key whose fingerprint is ECE2 B83F 0FAF 45D4 4C40 94C5 5658 F732 DAAC 0B39

To claim this, I am signing this object:

@rajatvig
rajatvig / Makefile
Last active August 25, 2016 18:44
JavaScript code to post Slack Notifications for GoCD Build Status
slack_passed:
BUILD_STATUS=passed node -pe "require('./slack')"
slack_failed:
BUILD_STATUS=failed node -pe "require('./slack')"
@rajatvig
rajatvig / git_rebase_from_master.fish
Created October 14, 2015 18:52
Rebase the Master when working with Gerrit
function git_rebase_from_master
function _git_branch_name
echo (git symbolic-ref HEAD ^/dev/null | sed -e 's|^refs/heads/||')
end
set -l git_branch (_git_branch_name)
git checkout master
git pull --rebase origin master
git fetch --all
@rajatvig
rajatvig / brew_force_update_casks.fish
Last active July 6, 2017 07:35
Fish Functions to Update Brew Casks
function brew_force_update_casks --description 'force update casks that are marked as latest'
set -x _brew_list (brew cask list | grep -Fv '(!)')
for formula in $_brew_list
set -x _info_tmp (brew cask info $formula)
set -x _info (echo $_info_tmp | head -n 3 | grep latest)
if count $_info > /dev/null
brew cask reinstall $formula
end
@rajatvig
rajatvig / .enrvc
Last active January 20, 2016 21:20
OpenStack Horizon envrc
use python 2.7.11
use python 3.4.3
layout node
source .tox/py27/bin/activate
@rajatvig
rajatvig / jvm.fish
Created September 6, 2015 07:41
Fish function to switch JVM in Shell
function jvm --description 'switch jvm'
set -gx JAVA_HOME (/usr/libexec/java_home -v $argv)
end
@rajatvig
rajatvig / InputStreamMatcher
Last active July 18, 2019 13:49
InputStream Matcher for Mockito
package test.support;
import com.google.common.io.CharStreams;
import lombok.AllArgsConstructor;
import lombok.SneakyThrows;
import org.hamcrest.BaseMatcher;
import org.hamcrest.Description;
import java.io.IOException;
import java.io.InputStream;