Skip to content

Instantly share code, notes, and snippets.

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

Taohidul Islam Taohid0

🏠
Working from home
View GitHub Profile
def print_spiral_matrix(starting_row, starting_col, ending_row, ending_col, matrix):
up, down, right, left = [], [], [], []
for c in range(starting_col, ending_col + 1):
up.append(matrix[starting_row][c])
right.append(matrix[c][ending_row])
down.append(matrix[ending_row][-(1 + c)])
left.append(matrix[c][starting_row])
result = up + right[1:] + down[1:] + left[1:-1]
if starting_row == ending_row and starting_row and ending_col:
const iterable = [1, 1];
const [x, y] = iterable;
// x = 1; y = 2
const obj = { name: 'Taohid', age: '25' };
const {name:myName,age:myAge} = obj;
console.log(myName,myAge);
//Taohid 25
const obj = { name: 'Taohid', age: '25' };
const {name,age} = obj;
console.log(name,age);
//Taohid 25
const obj = { name: 'Taohid', age: '25' };
const {name,age} = obj;
console.log(name,age);
//Taohid 25
from django.urls import path
from api.views import book
from core.views import index
urlpatterns = [
path("book/", book, name="book"),
path("", index, name="index")
]
from django.shortcuts import render
def index(request):
return render(request, "build/index.html")
STATIC_URL = '/static/'
STATICFILES_DIRS = (
os.path.join(BASE_DIR, 'book-frontend', "build", "static"), # update the STATICFILES_DIRS
)
TEMPLATES = [
{
'BACKEND': 'django.template.backends.django.DjangoTemplates',
'DIRS': [os.path.join(BASE_DIR, 'book-frontend')] #Look, we have added the root folder of frontend here
,
'APP_DIRS': True,
'OPTIONS': {
'context_processors': [
'django.template.context_processors.debug',
'django.template.context_processors.request',
"""
Django settings for book project.
Generated by 'django-admin startproject' using Django 2.2.
For more information on this file, see
https://docs.djangoproject.com/en/2.2/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/2.2/ref/settings/