Skip to content

Instantly share code, notes, and snippets.

View siumhossain's full-sized avatar
🥱
?

sium_hossain siumhossain

🥱
?
View GitHub Profile
@siumhossain
siumhossain / 1.css
Created May 9, 2022 06:38
make side bar scroll able vue/nuxt/html/css
<style scoped>
.section{
max-height: 98vh;
overflow:auto;
width:100%;
}
</style>
@siumhossain
siumhossain / ans.md
Created May 8, 2022 09:29
window scroll event in nuxt js
created () {
         if (process.client) { 
            window.addEventListener('scroll', this.handleScroll);
         }
      },
  methods: {
      
    
 handleScroll () {
@siumhossain
siumhossain / edit.css
Created May 6, 2022 09:54
vue slick carousel css file config
.slick-dots li.slick-active button:before {
opacity: 0.75;
color: #00aced;
}
.slick-dots li button:before {
font-family: 'slick';
font-size: 6px;
line-height: 20px;
@siumhossain
siumhossain / file_name.vue
Created April 18, 2022 09:48
create vue/nuxt slick carousel for dynamic content
<template >
<div>
<div class="w-full">
<VueSlickCarousel ref="carousel" v-if="bannerObj.length"> <div v-for="(i, id) in bannerObj" :key="id" >
<img :src="'http://127.0.0.1:8000' + i.image" alt="">
</div>
@siumhossain
siumhossain / models.py
Created March 27, 2022 08:53
Update something in django model and check by signal
from django.db.models.signals import post_save,pre_save
from django.dispatch import receiver
@receiver(pre_save, sender=Product)
def pre_save_user(sender, instance, **kwargs):
if not instance._state.adding:
print ('this is an update')
else:
print ('this is an insert')
@siumhossain
siumhossain / psql_encoding.markdown
Created March 16, 2022 16:12 — forked from joshteng/psql_encoding.markdown
This solves Postgresql's encoding issue (happened to me when running postgres on my vagrant box) The error happens when trying to create db "rake db:create": Error message: "encoding UTF8 does not match locale en_US; the chosen LC_CTYPE setting requires encoding LATIN1"
sudo su postgres
psql
update pg_database set datistemplate=false where datname='template1';
drop database Template1;
create database template1 with owner=postgres encoding='UTF-8' lc_collate='en_US.utf8' lc_ctype='en_US.utf8' template template0;
update pg_database set datistemplate=true where datname='template1';
@siumhossain
siumhossain / repo-reset.md
Created March 10, 2022 19:02 — forked from heiswayi/repo-reset.md
GitHub - Delete commits history with git commands

First Method

Deleting the .git folder may cause problems in our git repository. If we want to delete all of our commits history, but keep the code in its current state, try this:

# Check out to a temporary branch:
git checkout --orphan TEMP_BRANCH

# Add all the files:
git add -A
@siumhossain
siumhossain / CORS_ALLOWED_ORIGIN_REGEXES.md
Created January 20, 2022 06:23
regex value for allow all cross site request from https in django CORS_ALLOWED_ORIGIN_REGEXES
r"^(https:\/\/www\.|https:\/\/)?[a-z0-9]+([\-\.]{1}[a-z0-9]+)*\.[a-z]{2,5}(:[0-9]{1,5})?(\/.*)?$",
@siumhossain
siumhossain / how_to_set_mdb_in_vue3.md
Created December 30, 2021 09:42
mdb bootstrap use in Vue3

First have to install mbd in root project

npm i mdb-ui-kit

Then, have to import mdb js and cs file in main.js file.

import "mdb-ui-kit/js/mdb.min.js";
import "mdb-ui-kit/css/mdb.min.css"

Ok now ready to go........

@siumhossain
siumhossain / Dockerfile
Created December 5, 2021 14:35
Django dockerize hand note
FROM python:3
ENV PYTHONUNBUFFERED 1
WORKDIR /app
ADD . /app
COPY ./requirements.txt /app/requirements.txt