Skip to content

Instantly share code, notes, and snippets.

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

NJOKU SAMSON EBERE EBEREGIT

🏠
Working from home
View GitHub Profile
@EBEREGIT
EBEREGIT / gist:f0b72aada377a825b6c857000d9ac6c2
Created December 27, 2024 18:38
Django REST Framework Authentication
Setup
- [x] Clone Repo
- [x] Navigate to function based view branch
- [x] Branch to a new branch - Auth
- [x] Create Virtual Environment - python3 -m venv env
- [x] Activate VE - source env/bin/activate
- [x] Update installed App - "rest_framework.authtoken",
- [x] Make Migration - python manage.py makemigrations student_app
- [x] Run Migration - python manage.py migrate
- [x] Start server - python manage.py runserver
Setup
- [x] Clone Repo
- [x] Branch to a new branch - Auth
- [x] Install - python -m pip install Django
- [x] Create Project - django-admin startproject student
- [x] Start server - python manage.py runserver
- [x] Create an app - python manage.py startapp student_app
- [x] Add app to installed
- [x] Create Virtual Environment - python3 -m venv env
- [x] Activate VE - source env/bin/activate
@EBEREGIT
EBEREGIT / gist:339463c556827d4a183084d4b1a1534b
Created December 17, 2024 02:12
Django Rest Framework Curriculum
Setup
- [x] Install - python -m pip install Django
- [x] Create Project - django-admin startproject student
- [x] Start server - python manage.py runserver
- [x] Create an app - python manage.py startapp student_app
- [x] Add app to installed
- [x] Create Virtual Environment - python3 -m venv env
- [x] Activate VE - source env/bin/activate
Django
Intro and set up
- [x] Install - python -m pip install Django
- [x] Create Project - django-admin startproject blog
- [x] Start server - python manage.py runserver
- [x] View on the browser
- [x] Create an app - python manage.py startapp blog_app
- [x] Add App Route
- [x] Add View
@EBEREGIT
EBEREGIT / gist:752a6e67ce1a3e09a99ccbcd50221794
Created October 20, 2024 23:51
JavaScript .map() vs .forEach() methods - Differences
const arr = [1, 2, 3, 4, 5];
const result = [];
const resultMAP = arr.map((item) => Number(item) * 2);
arr.forEach((item) => result.push(Number(item) * 5));
console.log("Map", resultMAP);
console.log("For Each", result);
@EBEREGIT
EBEREGIT / gist:e8771466499df858a9c68731bff627ff
Created October 20, 2024 23:49
JavaScript .map() vs .filter() method (Difference)
const arr = [1, 2, 3, 4, 5];
const result = arr.map(item => {
if (item * 5 > 15) {
return item
}
})
console.log('============ Map ===========');
console.log(result);
@EBEREGIT
EBEREGIT / gist:2f6bb15c885f3b9ccf88f7396eb342b7
Created October 20, 2024 23:47
JavaScript Search With Regular Expression (Regex)
const words = ["Njoku", "Samson", "Ebere", "Plenty"];
const data = [
{ label: "The Shawshank Redemption", year: 1994 },
{ label: "The Godfather", year: 1972 },
{ label: "The Godfather: Part II", year: 1974 },
{ label: "The Dark Knight", year: 2008 },
{ label: "12 Angry Men", year: 1957 },
{ label: "Schindler's List", year: 1993 },
{ label: "Pulp Fiction", year: 1994 },