Skip to content

Instantly share code, notes, and snippets.

View Vishal1297's full-sized avatar
🏠
Working from home

Vishal Yadav Vishal1297

🏠
Working from home
  • India
  • 14:59 (UTC +05:30)
View GitHub Profile
@Vishal1297
Vishal1297 / .zshrc
Created October 2, 2022 16:29
My zsh file with powerlevel10k configs
# Enable Powerlevel10k instant prompt. Should stay close to the top of ~/.zshrc.
# Initialization code that may require console input (password prompts, [y/n]
# confirmations, etc.) must go above this block; everything else may go below.
if [[ -r "${XDG_CACHE_HOME:-$HOME/.cache}/p10k-instant-prompt-${(%):-%n}.zsh" ]]; then
source "${XDG_CACHE_HOME:-$HOME/.cache}/p10k-instant-prompt-${(%):-%n}.zsh"
fi
# If you come from bash you might have to change your $PATH.
# export PATH=$HOME/bin:/usr/local/bin:$PATH
@Vishal1297
Vishal1297 / node_install.sh
Created September 28, 2022 10:41
Remove node from apt & install latest stable from node source.
#!/bin/bash
node_v=$1
if [ -z "$1" ]
then
echo "Using default stable version 16.x"
node_v="16"
fi
@Vishal1297
Vishal1297 / MoveZeroesWithOutOrder.java
Created August 27, 2022 12:05
Solution : Move zeroes to last without maintaining relative order.
public class MoveZeroesWithOutOrder {
public static void main(String[] args) {
int[] arr = {0, 1, 0, 3, 12};
moveZeroes(arr);
for (int num : arr) {
System.out.print(num + " ");
}
System.out.println();
}
@Vishal1297
Vishal1297 / Dockerfile
Created August 16, 2022 01:31
Python flask dockerfile
# syntax=docker/dockerfile:1
FROM python:3.7-alpine
WORKDIR /code
RUN apk add --no-cache gcc musl-dev linux-headers
COPY ./requirements.txt requirements.txt
@Vishal1297
Vishal1297 / set_kube_config.sh
Created July 27, 2022 00:47
Create kube configs in user home directory.
#!/bin/bash
## Run after kubeadm init
mkdir -p $HOME/.kube
sudo cp -i /etc/kubernetes/admin.conf $HOME/.kube/config
sudo cp -i /etc/kubernetes/admin.conf $HOME/admin.conf
@Vishal1297
Vishal1297 / setup_kube.sh
Created July 27, 2022 00:44
Reset and init kube
#!/bin/bash
## Reset kube
sudo kubeadm reset
## Remove kube configs
sudo rm -rf /etc/kubernetes/kubelet.conf
import java.util.Objects;
public class Solution {
public static void main(String[] args) {
int[] arr1 = {1, 20, 3, 4, 2};
int[] arr2 = {1, 70, 900, 445, 5};
int[] result = mergeWithOutDuplicates(arr1, arr2);
for (int i : result) {
@Vishal1297
Vishal1297 / postman.desktop
Created September 4, 2021 09:52
Postman Desktop File
[Desktop Entry]
Encoding=UTF-8
Version=1.0
Type=Application
Name=Postman
Icon=/opt/Postman/app/resources/app/assets/icon.png
Path=/opt/Postman
Exec=/opt/Postman/Postman
StartupNotify=false
StartupWMClass=Postman
@Vishal1297
Vishal1297 / Main.java
Created January 27, 2021 18:20
Queue Implementation Using Arrays.
public class Main {
public static void main(String[] args) {
QueueUsingArray queue = new QueueUsingArray();
System.out.println(queue.isFull()?"Full":"Not Full");
System.out.println(queue.isEmpty()?"Empty":"Not Empty");
queue.enQueue(11);
queue.enQueue(101);
queue.enQueue(1111);
@Vishal1297
Vishal1297 / Main.java
Last active January 26, 2021 05:11
Stack Implementaion Using Kotlin Array Class
class Main {
public static void main(String[] args) {
Stack stack = new Stack();
System.out.println(stack.isEmpty() ? "Empty" : "Not Empty");
stack.push(12);
stack.push(13);
System.out.println("Find 14 : Found At Index " + stack.search(14));
stack.push(14);
stack.push(15);