Skip to content

Instantly share code, notes, and snippets.

@amard33p
amard33p / AvroJsonDeSerUtil.java
Created October 18, 2024 06:40
Avro to Json Serialization and Deserialization Utility which shows field name in exception message
package com.example.jsontoavro;
import org.apache.avro.AvroTypeException;
import org.apache.avro.Schema;
import org.apache.avro.generic.GenericRecord;
import org.apache.avro.io.DatumReader;
import org.apache.avro.io.DatumWriter;
import org.apache.avro.io.DecoderFactory;
import org.apache.avro.io.EncoderFactory;
import org.apache.avro.io.JsonDecoder;
@amard33p
amard33p / mianjing.txt
Created October 8, 2020 18:35 — forked from devanshdalal/mianjing.txt
A good set of programming questions, to make your hands dirty! Please provide more questions in comments. I will add them
Additional Questions from Career-cup
Company selected Google,
Sorted by most comments
1.Partition integer array respect to zero, i.e. negative ... 0 ... positive, keep relative order
E.g. -1 1 3 -2 2 => -1 -2 1 3 2.
2. Search in 2D matrix,
Given each row and column sorted, or given for each (i,j) A[i][j] < A[i][j+1] & A[i][j] < A[i+1][j]
@amard33p
amard33p / install_sw_remotely.ps1
Last active January 8, 2022 14:09
Install sshfs-win on a remote Windows 10 host using Powershell
# Ensure following script in executed on remote host first
# https://raw.githubusercontent.com/ansible/ansible/devel/examples/scripts/ConfigureRemotingForAnsible.ps1
# Get the URL of the latest binaries from here
# https://github.com/billziss-gh/sshfs-win/releases
# https://github.com/billziss-gh/winfsp/releases
$winfsp_url = "https://github.com/billziss-gh/winfsp/releases/download/v1.7B2/winfsp-1.7.20123.msi"
$winfsp_msi = "winfsp-1.7.20123.msi"
$sshfs_url = "https://github.com/billziss-gh/sshfs-win/releases/download/v3.5.20024/sshfs-win-3.5.20024-x64.msi"
@amard33p
amard33p / leetcodeparser.py
Last active April 20, 2020 17:16
Scrape all "Free" LeetCode Problems
from webdriver_manager.chrome import ChromeDriverManager
from selenium import webdriver
from selenium.webdriver.common.by import By
from selenium.webdriver.support.ui import Select
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.support import expected_conditions as EC
import atexit
BASEURL = "https://leetcode.com"
TOP_PROBLEMSET_URL = "/problemset/top-interview-questions/?difficulty="
@amard33p
amard33p / 01_prep_esxi_for_deployment_hook_script.sh
Created January 9, 2020 20:51
Foreman hooks after build script to extract and setup an ESXi ISO for installation
#!/bin/bash
# Location for ESXi ISOs
ESXI_BUILDS_LOCAL_PATH=/home/esxi_builds
# FTP root dir
FTP_ROOT=/var/ftp
# Functions to parse hook_data
. $(dirname $0)/hook_functions.sh