Skip to content

Instantly share code, notes, and snippets.

View Mo-Shakib's full-sized avatar
🟢
Available

Mohamed Shakib Mo-Shakib

🟢
Available
View GitHub Profile
@Mo-Shakib
Mo-Shakib / shakib.omp.json
Last active August 20, 2023 00:33
Oh My Posh theme
{
"$schema": "https://raw.githubusercontent.com/JanDeDobbeleer/oh-my-posh/main/themes/schema.json",
"blocks": [
{
"alignment": "left",
"type": "prompt",
"segments": [
{
"background": "#C5DB29",
"foreground": "#000000",

Enable SSL certificate for github pages with namecheap

Step - 1:

Add the Github IPs as A records on Namecheap.

185.199.108.153
185.199.109.153
185.199.110.153
@Mo-Shakib
Mo-Shakib / delete_at.py
Created July 17, 2021 23:14
Python - Delete a node at the given position in the Linked List
def pop_at(self, position):
#1. check if the position is > 0
if(position < 1):
print("\nposition should be >= 1.")
elif (position == 1 and self.head != None):
#2. if the position is 1 and head is not null, make
# head next as head and delete previous head
nodeToDelete = self.head
@Mo-Shakib
Mo-Shakib / insert_at.py
Created July 17, 2021 22:39
Python - Insert a new node at a given position in the Linked List
def insert_at(self, newElement, position):
#1. allocate node to new element
newNode = Node(newElement)
#2. check if the position is > 0
if(position < 1):
print("\nposition should be >= 1.")
elif (position == 1):
@Mo-Shakib
Mo-Shakib / clear.py
Created July 17, 2021 22:25
Python - Removes all the elements from a linked list
def clear(self):
while (self.head is not None):
temp = self.head
self.head = self.head.next
temp = None
print('All the elements has been cleared!')
@Mo-Shakib
Mo-Shakib / Insert a new node at the end of the Linked List.py
Created July 17, 2021 22:22
Python - Insert a new node at the end of the Linked List
def insert_at_end(self, newElement):
#1 & 2 & 3. allocate node, assign data element
# assign null to the next of new node
newNode = Node(newElement)
#4. Check the Linked List is empty or not,
# if empty make the new node as head
if(self.head == None):
self.head = newNode
@Mo-Shakib
Mo-Shakib / .gitignore
Created February 7, 2021 14:34
.gitignore for visual studio code
.vscode/*
!.vscode/tasks.json
!.vscode/launch.json
*.code-workspace
@Mo-Shakib
Mo-Shakib / shakib-theme.json
Created February 5, 2021 00:29
Oh-My-Posh 3 custom theme
{
"$schema": "https://raw.githubusercontent.com/JanDeDobbeleer/oh-my-posh3/main/themes/schema.json",
"blocks": [
{
"type": "prompt",
"alignment": "left",
"segments": [
{
"type": "text",
@Mo-Shakib
Mo-Shakib / .hyper.js
Last active January 23, 2021 13:25
Hyper terminal configration file for powershell
// file location: C:\Users\[User name]\AppData\Roaming\Hyper\.hyper.js
module.exports = {
config: {
// default font size in pixels for all tabs
fontSize: 13,
// font family with optional fallbacks
fontFamily: "MesloLGM NF",
// terminal cursor background color and opacity (hex, rgb, hsl, hsv, hwb or cmyk)
@Mo-Shakib
Mo-Shakib / Get-execution-time.py
Last active January 22, 2021 21:56
Get execution time in python
import time
startTime = time.time()
# write your code or function calls
endTime = time.time()
totalTime = endTime - startTime
print('Time taken to execute code =', totalTime)