Skip to content

Instantly share code, notes, and snippets.

View virajkulkarni14's full-sized avatar
💻
Code on...

Viraj G. Kulkarni (विराज गु. कुलकर्णी) virajkulkarni14

💻
Code on...
View GitHub Profile
@virajkulkarni14
virajkulkarni14 / script-template.sh
Created May 24, 2021 21:10 — forked from m-radzikowski/script-template.sh
Minimal safe Bash script template - see the article with full description: https://betterdev.blog/minimal-safe-bash-script-template/
#!/usr/bin/env bash
set -Eeuo pipefail
trap cleanup SIGINT SIGTERM ERR EXIT
script_dir=$(cd "$(dirname "${BASH_SOURCE[0]}")" &>/dev/null && pwd -P)
usage() {
cat <<EOF
Usage: $(basename "${BASH_SOURCE[0]}") [-h] [-v] [-f] -p param_value arg1 [arg2...]
@virajkulkarni14
virajkulkarni14 / git-auto-status.plugin.zsh
Created August 24, 2020 21:45 — forked from oshybystyi/git-auto-status.plugin.zsh
OhMyZsh plugin to display git status after a bunch of predefined git commands
#
# Run git status after specified set of command
#
# @author Oleksandr Shybystyi oleksandr.shybystyi@gmail.com
#
# default list of git commands `git status` is running after
gitPreAutoStatusCommands=(
'add'
'rm'
@virajkulkarni14
virajkulkarni14 / Makefile
Created May 27, 2020 07:18 — forked from MarkTiedemann/Makefile
the-lost-art-of-the-makefile/01-your-tests-dont-need-to-be-phony/05
.PHONY: test
test:
node ndjson_validator.js < good.ndjson
! node ndjson_validator.js < bad.ndjson
@virajkulkarni14
virajkulkarni14 / Makefile
Created May 27, 2020 07:18 — forked from MarkTiedemann/Makefile
the-lost-art-of-the-makefile/01-your-tests-dont-need-to-be-phony/06
.PHONY: test
test: good.tested bad.tested
good.tested: ndjson_validator.js good.ndjson
node ndjson_validator.js < good.ndjson
touch good.tested
bad.tested: ndjson_validator.js bad.ndjson
! node ndjson_validator.js < bad.ndjson
touch bad.tested
@virajkulkarni14
virajkulkarni14 / Makefile
Created May 27, 2020 07:17 — forked from MarkTiedemann/Makefile
the-lost-art-of-the-makefile/01-your-tests-dont-need-to-be-phony/07
.PHONY: clean
clean:
-rm *.tested
let isLittleEndian = new Uint8Array(new Uint16Array([0x1234]).buffer)[0] === 0x34;
@virajkulkarni14
virajkulkarni14 / api.js
Created May 27, 2020 07:17 — forked from MarkTiedemann/api.js
Latest Deno version API, built using CloudFlare Workers
let last_known_version = "1.0.0";
const api_root = "https://XXX.workers.dev/version/";
const x86_64_apple_darwin = api_root + "x86_64-apple-darwin";
const x86_64_unknown_linux_gnu = api_root + "x86_64-unknown-linux-gnu";
const x86_64_pc_windows_msvc = api_root + "x86_64-pc-windows-msvc";
const re_x86_64_apple_darwin = /href="\/denoland\/deno\/releases\/download\/v(.*?)\/deno-x86_64-apple-darwin.zip"/;
const re_x86_64_unknown_linux_gnu = /href="\/denoland\/deno\/releases\/download\/v(.*?)\/deno-x86_64-unknown-linux-gnu.zip"/;
const re_x86_64_pc_windows_msvc = /href="\/denoland\/deno\/releases\/download\/v(.*?)\/deno-x86_64-pc-windows-msvc.zip"/;
@virajkulkarni14
virajkulkarni14 / RabbitContainerRule.java
Created May 27, 2020 00:06 — forked from mosheeshel/RabbitContainerRule.java
JUnit @rule for starting a RabbitMQ container (based on other rule - see comments)
package rules;
import com.google.common.collect.ImmutableMap;
import org.eclipse.jdt.launching.SocketUtil;
import java.util.HashMap;
import java.util.Map;
/**
* Created with IntelliJ IDEA.
@virajkulkarni14
virajkulkarni14 / RabbitIntegrationTest.java
Created May 27, 2020 00:06 — forked from mosheeshel/RabbitIntegrationTest.java
Demo Integration test using RabbitDockerContainer @rule
package integration;
import com.kenshoo.trackingfront.configuration.RabbitConfiguration;
import com.kenshoo.trackingfront.rabbitmq.RabbitConnectionFactory;
import com.rabbitmq.client.Connection;
import com.rabbitmq.client.ConnectionFactory;
import org.junit.*;
import org.junit.rules.ExpectedException;
import static org.mockito.Matchers.anyString;