Skip to content

Instantly share code, notes, and snippets.

View itechdivyanshu's full-sized avatar
🎯
Focusing

Itech Divyanshu itechdivyanshu

🎯
Focusing
View GitHub Profile
@itechdivyanshu
itechdivyanshu / models.py
Created July 29, 2020 11:22
Django Unique Slug Generator
from django.dispatch import receiver
from django.db import models
from .slugify import unique_slug_generator
class TestModel(models.Model):
name = models.CharField(max_length=150)
slug = models.SlugField(unique=True, null=True, blank=True)
@receiver(models.signals.pre_save, sender=TestModel)
def auto_slug_generator(sender, instance, **kwargs):
@itechdivyanshu
itechdivyanshu / markdown.html
Last active July 29, 2020 08:07
Markdown Parser in Javascript
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
<style>
* {
-moz-box-sizing: border-box;
-webkit-box-sizing: border-box;

for mongodb

mongo

for git

git pull itech master --allow-unrelated-histories
git remote add origin