Skip to content

Instantly share code, notes, and snippets.

View muradddd's full-sized avatar
😇
Hakuna Matata

Murad Rustamzade muradddd

😇
Hakuna Matata
  • Baku, Azerbaijan
View GitHub Profile
### Keybase proof
I hereby claim:
* I am muradddd on github.
* I am muradrustamzade (https://keybase.io/muradrustamzade) on keybase.
* I have a public key ASA_e4Xqu1Ji3y0RrR5o3gXGASA5a_pB8o08iFti6uKbvgo
To claim this, I am signing this object:
@muradddd
muradddd / mysql backup
Last active July 14, 2022 12:51
Backup and restore a mysql database from a running Docker mysql container
docker exec -t {CONTAINER} mysqldump -u {USER} --password={PASSWORD} {DATABASE} > {BACKUP_FILE_PATH}
docker exec -t db mysqldump -u root --password=yelobank YeloBankProjectDB > _backups/data.sql
@muradddd
muradddd / DJANGO ALIASES
Created December 6, 2021 06:46
alias commands
alias runserver="python manage.py runserver"
alias makemigrations="python manage.py makemigrations"
alias showmigrations="python manage.py showmigrations"
alias migrate="python manage.py migrate"
alias createsuperuser="python manage.py createsuperuser"
alias dump="python manage.py dumpdata --natural-foreign -e contenttypes -e auth.Permission -e admin.Logentry"
alias load="python manage.py loaddata"
alias shell="python manage.py shell"
name: build
on:
push:
branches:
- bugfix
jobs:
build:
runs-on: ubuntu-latest
from unidecode import unidecode
def slugify(title):
symbol_mapping = (
('ə', 'e'),
('ı', 'i'),
('ö', 'o'),
('ğ', 'g'),
('ü', 'u'),
if(getParams().category){
// əgər şərt ödənirsə burda d-block etmək lazımdır `filterİcon`u
document.querySelector('.clear-filter-description a').href = window.location.origin + window.location.pathname
}
@core.route('/create', methods=['GET', 'POST'])
@login_required
def create():
form = BlogForm()
if request.method == 'POST' and form.validate_on_submit():
f = form.image.data
file_path = save_file(f)
blog = Blog(title=form.title.data, description=form.description.data, image=file_path, user_id=current_user.id)
db.session.add(blog)
db.session.commit()
@muradddd
muradddd / html
Created October 20, 2020 18:46
pagination
<div class="row justify-content-center pagination">
<div id="pagination" class="col-12 col-lg-9 justify-content-center pagination mr-auto">
{% if is_paginated %}
{% if page_obj.has_previous %}
<a class="prev-page"
href="?page={{ page_obj.previous_page_number }}{% if request.GET.topic_search %}&topic_search={{ request.GET.topic_search }}{% elif request.GET.conversation_search %}&conversation_search={{ request.GET.conversation_search }}{% endif %}"></a>
{% endif %}
{% for page_number in page_range %}
{% if page_number == page_obj.number %}
<a class="active">{{ page_number }}</a>
import {COMMENTS_API_URL} from './config.js';
import {complaintDetailStaticPath, complaintsStaticPath} from './staticPaths.js';
let commentsArr;
let commentsWrapper = document.querySelector('.comments-wrapper')
// REPORT COMMENT MODAL
const reportCommentModal = document.querySelector('section.report-comment-modal');
const reportCommentModalCloseModalIcon = document.querySelector('section.report-comment-modal img.close-icon');
const reportCommentModalCancelButton = document.querySelector('section.report-comment-modal > article > div > button');
@muradddd
muradddd / config.js
Last active October 1, 2020 20:31
API urls
const SITE_URL = 'http://35.205.142.86';
// COMPANIES/BRANDS
const COMPANY_CATEGORIES_API_URL = `${SITE_URL}/api/v1/companies/categories`;
const SEARCH_COMPANIES_BY_CATEGORIES_URL = `${COMPANY_CATEGORIES_API_URL}?title=`;
// REVIEWS/COMPLAINTS
const REVIEW_CATEGORIES_API_URL = `${SITE_URL}/api/v1/reviews/categories`;
const REVIEW_COMPANIES_API_URL = `${SITE_URL}/api/v1/reviews/companies`;
const REVIEW_KEYWORDS_API_URL = `${SITE_URL}/api/v1/reviews/keywords`;