Skip to content

Instantly share code, notes, and snippets.

View madhur's full-sized avatar
🎯
Focusing

Madhur Ahuja madhur

🎯
Focusing
View GitHub Profile
{
"public_identifier": "madhurahuja",
"profile_pic_url": "https: //s3.us-west-000.backblazeb2.com/proxycurl/person/madhurahuja/profile?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=0004d7f56a0400b0000000001%2F20240604%2Fus-west-000%2Fs3%2Faws4_request&X-Amz-Date=20240604T161547Z&X-Amz-Expires=3600&X-Amz-SignedHeaders=host&X-Amz-Signature=dcaa561ca5a134800dd1f7f4dd544931e4048423666df805236d95357064ee18",
"background_cover_image_url": null,
"first_name": "Madhur",
"last_name": "Ahuja",
"full_name": "Madhur Ahuja",
"follower_count": 2590,
"occupation": "Engineering Manager at Games24x7",
"headline": "Building My11Circle along with rockstar team",
@madhur
madhur / starship.toml
Created July 17, 2023 05:02 — forked from nukopy/starship.toml
Nerd Font Symbols created by Starship. This is a Starship default config.
# Starship default config, extracted from the source
# Configure the format of the prompt
format = """\
$username\
$hostname\
$shlvl\
$singularity\
$kubernetes\
$directory\
@madhur
madhur / codemirror.js
Created December 22, 2020 13:00
codemirror.js
window.addEventListener("load", startLoading, false);
let codeMirror = null;
function startLoading() {
codemirror = document.querySelector(".CodeMirror").CodeMirror;
// console.log(codemirror);
//codeMirror = CodeMirror(document.body);
console.log(codeMirror);
codeMirror.execCommand("selectAll");
}
@madhur
madhur / trafficsplitter.java
Created November 29, 2020 05:02
Taffic splitting algorithm
package trafficsplitter;
import java.util.ArrayList;
import java.util.List;
import java.util.Random;
public class Distributor implements IDistributor {
private int nextBucketIndex;
private char[] senderBuckets;
private Random r = new Random();
@madhur
madhur / my2.sql
Last active June 14, 2020 12:05
MySQL Stats collector
-- Create Database, Tables, Stored Routines and Jobs for My2 dashboard
create database IF NOT EXISTS my2;
use my2;
CREATE TABLE IF NOT EXISTS status (
VARIABLE_NAME varchar(64) CHARACTER SET utf8 NOT NULL DEFAULT '',
VARIABLE_VALUE varchar(1024) CHARACTER SET utf8 DEFAULT NULL,
HOST varchar(128) CHARACTER SET utf8 DEFAULT 'MyHost', -- concat(@@hostname, ':', @@port),
TIMEST timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP
) ENGINE=InnoDB;
@madhur
madhur / javacert.sh
Created March 7, 2020 15:13
Import certificate into java keystore
#!/usr/bin/env bash
# Exit on error
set -e
# Ensure script is running as root
if [ "$EUID" -ne 0 ]
then echo "WARN: Please run as root (sudo)"
exit 1
fi
@madhur
madhur / pmd-rules.xml
Created January 26, 2020 10:17
My PMD Rules
<?xml version="1.0" ?>
<ruleset name="Custom Rules" xmlns="http://pmd.sourceforge.net/ruleset/2.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://pmd.sourceforge.net/ruleset/2.0.0 https://pmd.sourceforge.io/ruleset_2_0_0.xsd">
<description>
Tesseract custom rules
</description>
<rule ref="category/java/bestpractices.xml/AbstractClassWithoutAbstractMethod" />
<rule ref="category/java/bestpractices.xml/AccessorClassGeneration" />
@madhur
madhur / checks.xml
Created January 26, 2020 05:35
Checkstyle configuration
<?xml version="1.0"?>
<!DOCTYPE module PUBLIC
"-//Checkstyle//DTD Checkstyle Configuration 1.3//EN"
"https://checkstyle.org/dtds/configuration_1_3.dtd">
<!--
Checkstyle configuration that checks the Google coding conventions from Google Java Style
that can be found at https://google.github.io/styleguide/javaguide.html.
Checkstyle is very configurable. Be sure to read the documentation at
@madhur
madhur / docker-compose.yml
Last active September 11, 2019 05:54
graphite-statsd docker
version: '3'
services:
graphite-statsd:
image: graphiteapp/docker-graphite-statsd
ports:
- 2003-2004:2003-2004
- 2023-2024:2023-2024
- 8125:8125/udp
@madhur
madhur / longestplaindromic.java
Created August 12, 2019 01:54
longestpalindromic
class Solution {
public String longestPalindrome(String str) {
int index1=0;
int index2=0;
boolean isPalin = true;
if(str.length()==0) {
return str;
}
if(str.length()==1) {