Skip to content

Instantly share code, notes, and snippets.

View ABHISHEK-KEDAR-21's full-sized avatar
⚙️
Still Coding

ABHISHEK KEDAR ABHISHEK-KEDAR-21

⚙️
Still Coding
View GitHub Profile
function sum(...args) {
let total = 0;
let adjust = -1
if (args.length && args[0] === 0) {
adjust = 0
}
function inner(...innerArgs) {
if (innerArgs.length === 0) {
return total
@ABHISHEK-KEDAR-21
ABHISHEK-KEDAR-21 / Max RAM Find.md
Created February 25, 2021 10:38
Get Maximum RAM Laptop

wmic memphysical get MaxCapacity, MemoryDevices

Divide value by 1048576

Divide by value of Memory Devices

@ABHISHEK-KEDAR-21
ABHISHEK-KEDAR-21 / REST API 1.md
Created February 2, 2021 10:01
REST API HackerRank
#!/bin/python3
import math
import os
import random
import re
import sys

BTBV1R0CZR-eyJsaWNlbnNlSWQiOiJCVEJWMVIwQ1pSIiwibGljZW5zZWVOYW1lIjoiTXVzaGZpcXVyIFJhaG1hbiIsImFzc2lnbmVlTmFtZSI6IiIsImFzc2lnbmVlRW1haWwiOiIiLCJsaWNlbnNlUmVzdHJpY3Rpb24iOiJGb3IgZWR1Y2F0aW9uYWwgdXNlIG9ubHkiLCJjaGVja0NvbmN1cnJlbnRVc2UiOmZhbHNlLCJwcm9kdWN0cyI6W3siY29kZSI6IklJIiwicGFpZFVwVG8iOiIyMDE5LTExLTI4In0seyJjb2RlIjoiQUMiLCJwYWlkVXBUbyI6IjIwMTktMTEtMjgifSx7ImNvZGUiOiJEUE4iLCJwYWlkVXBUbyI6IjIwMTktMTEtMjgifSx7ImNvZGUiOiJQUyIsInBhaWRVcFRvIjoiMjAxOS0xMS0yOCJ9LHsiY29kZSI6IkdPIiwicGFpZFVwVG8iOiIyMDE5LTExLTI4In0seyJjb2RlIjoiRE0iLCJwYWlkVXBUbyI6IjIwMTktMTEtMjgifSx7ImNvZGUiOiJDTCIsInBhaWRVcFRvIjoiMjAxOS0xMS0yOCJ9LHsiY29kZSI6IlJTMCIsInBhaWRVcFRvIjoiMjAxOS0xMS0yOCJ9LHsiY29kZSI6IlJDIiwicGFpZFVwVG8iOiIyMDE5LTExLTI4In0seyJjb2RlIjoiUkQiLCJwYWlkVXBUbyI6IjIwMTktMTEtMjgifSx7ImNvZGUiOiJQQyIsInBhaWRVcFRvIjoiMjAxOS0xMS0yOCJ9LHsiY29kZSI6IlJNIiwicGFpZFVwVG8iOiIyMDE5LTExLTI4In0seyJjb2RlIjoiV1MiLCJwYWlkVXBUbyI6IjIwMTktMTEtMjgifSx7ImNvZGUiOiJEQiIsInBhaWRVcFRvIjoiMjAxOS0xMS0yOCJ9LHsiY29kZSI6IkRDIiwicGFpZFVwVG8iOiIyMDE5LTExLTI4In0seyJjb

@ABHISHEK-KEDAR-21
ABHISHEK-KEDAR-21 / git_branch.md
Last active July 24, 2020 16:23
Show your branch name on your terminal

Add these lines in your ~/.bashrc file

# Show git branch name
force_color_prompt=yes
color_prompt=yes
parse_git_branch() {
 git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/(\1)/'
}
if [ "$color_prompt" = yes ]; then
 PS1='${debian_chroot:+($debian_chroot)}\[\033[01;32m\]\u@\h\[\033[00m\]:\[\033[01;34m\]\w\[\033[01;31m\]$(parse_git_branch)\[\033[00m\]\$ '
kubectl exec -it gamma-wra-er-frappe-0 --namespace wrun --container frappe -- bash
kubectl exec -it gamma-wra-er-frappe-0 -n wrun -c frappe -- bash
kubectl exec -it <pod> --namespace <namespace> --container <container> -- bash
@ABHISHEK-KEDAR-21
ABHISHEK-KEDAR-21 / git branches with owner
Last active June 30, 2020 05:03
git all brances with owner
git for-each-ref --format='%(committerdate) %09 %(authorname) %09 %(refname)' --sort=authorname
Customized:
git for-each-ref --format='%(color:cyan)%(authordate:format:%m/%d/%Y %I:%M %p) %(align:25,left)%(color:yellow)%(authorname)%(end) %(color:reset)%(refname:strip=3)' --sort=authorname refs/remotes
By Author Email: (Which makes more sense)
git for-each-ref --format='%(color:cyan)%(authordate:format:%m/%d/%Y %I:%M %p) %(align:25,left)%(color:yellow)%(authoremail)%(end) %(color:reset)%(refname:strip=3)' --sort=authoremail refs/remotes
@ABHISHEK-KEDAR-21
ABHISHEK-KEDAR-21 / .bash_aliases
Last active June 12, 2020 04:46 — forked from vratiu/.bash_aliases
Git shell coloring
# Customize BASH PS1 prompt to show current GIT repository and branch.
# by Mike Stewart - http://MediaDoneRight.com
# SETUP CONSTANTS
# Bunch-o-predefined colors. Makes reading code easier than escape sequences.
# I don't remember where I found this. o_O
# Reset
Color_Off="\[\033[0m\]" # Text Reset
git config --global credential.helper 'cache --timeout=3600'
git config --global --unset credential.helper
git config --global credential.helper store
git config --global user.name "username"
git config --global user.password "password"
@ABHISHEK-KEDAR-21
ABHISHEK-KEDAR-21 / import-tar-gz.sh
Created June 11, 2020 09:29 — forked from infusion/import-tar-gz.sh
Import a tar.gz file to MySQL
tar xzOf dump.sql.tar.gz | mysql -u $user -p $database