Skip to content

Instantly share code, notes, and snippets.

View MKRNaqeebi's full-sized avatar
🇵🇰

Muhammad Kamran MKRNaqeebi

🇵🇰
View GitHub Profile
@MKRNaqeebi
MKRNaqeebi / git-cheatsheet.markdown
Last active September 4, 2020 11:43
git cheat sheet for me daily to use daily instead of doing google daily for git command I want to manage this sheet and use for future

git command & cheatsheet

Git configuration:

 git config --global user.name "Muhammad Kamran"
 git config --global user.email "mkrnaqeebi@gmail.com”

New git repository:

git init project.name

@MKRNaqeebi
MKRNaqeebi / smallest_sub_array_contains_all_elements_from_original_array.py
Created January 6, 2020 11:30
Calculate smallest sub-array length from an array which consist of every element at least once from the original array
import collections
def solution(S):
"""
Calculate smallest sub-array length from an array in which all integer exists from the original array
Sample Input ==> Sample Output
[7, 3, 7, 3, 1, 3, 4, 1] ==> 5
[2, 1, 1, 3, 2, 1, 1, 3] ==> 3
[7, 5, 2, 7, 2, 7, 4, 7] ==> 6
@MKRNaqeebi
MKRNaqeebi / mysql.sh
Last active September 20, 2019 17:30
sudo docker run -p 3306:3306 --name mysql -e MYSQL_ROOT_PASSWORD='Kamran!12754' -d mysql/mysql-server:8.0.15 --default-authentication-plugin=mysql_native_password
sudo docker exec -it mysql bash
mysql -u root --password
CREATE USER 'mkrnaqeebi'@'%' IDENTIFIED BY 'password';
GRANT ALL PRIVILEGES ON *.* TO 'mkrnaqeebi'@'%' WITH GRANT OPTION;
@MKRNaqeebi
MKRNaqeebi / index.html
Created June 23, 2019 08:35
Profile Card
<div class="wrapper">
<div class="profile-card js-profile-card">
<div class="profile-card__img">
<img src="https://res.cloudinary.com/muhammederdem/image/upload/v1537638518/Ba%C5%9Fl%C4%B1ks%C4%B1z-1.jpg" alt="profile card">
</div>
<div class="profile-card__cnt js-profile-cnt">
<div class="profile-card__name">Muhammed Erdem</div>
@MKRNaqeebi
MKRNaqeebi / Google drive on ubuntu
Created April 12, 2019 16:57
Google drive on ubuntu
SSH on to your linux box and download the Linux version of gdrive from GitHub.
cd ~
wget https://docs.google.com/uc?id=0B3X9GlR6EmbnWksyTEtCM0VfaFE&export=download
You should see a file in your home directory called something list uc=0B3X9GlR6EmbnWksyTEtCM0VfaFE. Rename this file to gdrive.
mv uc\?id\=0B3X9GlR6EmbnWksyTEtCM0VfaFE gdrive
@MKRNaqeebi
MKRNaqeebi / Docker cheat sheet
Last active April 12, 2019 16:57
this is simple Docker cheat sheet. I face some problem I wrote docker command here after solving problem
# tmux shortcuts & cheatsheet
start new:
tmux
start new with session name:
tmux new -s myname