Skip to content

Instantly share code, notes, and snippets.

View vaibhav-jain's full-sized avatar
🏠
Working remotely @newpage solutions inc

vaibhav jain vaibhav-jain

🏠
Working remotely @newpage solutions inc
View GitHub Profile
@vaibhav-jain
vaibhav-jain / UniqueTogetherValidator.py
Created July 2, 2016 12:45
Django Rest Framework (DRF) Custom Unique Together Message
from django.utils.translation import ugettext_lazy as _
from rest_framework import serializers
class SomeSerializer(serializers.ModelSerializer):
"""
Demostrating How to Override DRF UniqueTogetherValidator Message
"""
class Meta:
@vaibhav-jain
vaibhav-jain / markdown-details-collapsible.md
Created January 26, 2023 18:55 — forked from joshbuchea/markdown-details-collapsible.md
How to add a collapsible section in markdown.

A collapsible section containing markdown

Click to expand!

Heading

  1. A numbered
  2. list
    • With some
    • Sub bullets

Semantic Commit Messages

See how a minor change to your commit message style can make you a better programmer.

Format: <type>(<scope>): <subject>

<scope> is optional

Example

@vaibhav-jain
vaibhav-jain / Keybase.md
Last active September 19, 2020 14:13
Keybase.md

Keybase proof

I hereby claim:

  • I am vaibhav-jain on github.
  • I am iamvaibhavjain (https://keybase.io/iamvaibhavjain) on keybase.
  • I have a public key ASBgbSzYTnrZ-mIEoiD42y8fF4CMHUHMIQNfM4_qM68wyQo

To claim this, I am signing this object:

@vaibhav-jain
vaibhav-jain / timezone_field.py
Created June 9, 2016 17:59
TimeZone Field for DRF
import pytz
import six
class TimezoneField(serializers.Field):
def to_representation(self, obj):
return six.text_type(obj)
def to_internal_value(self, time_zone):
@vaibhav-jain
vaibhav-jain / gist:0b703c498d02f7807eb694700867035b
Created July 30, 2019 13:39 — forked from rxaviers/gist:7360908
Complete list of github markdown emoji markup

People

:bowtie: :bowtie: 😄 :smile: 😆 :laughing:
😊 :blush: 😃 :smiley: ☺️ :relaxed:
😏 :smirk: 😍 :heart_eyes: 😘 :kissing_heart:
😚 :kissing_closed_eyes: 😳 :flushed: 😌 :relieved:
😆 :satisfied: 😁 :grin: 😉 :wink:
😜 :stuck_out_tongue_winking_eye: 😝 :stuck_out_tongue_closed_eyes: 😀 :grinning:
😗 :kissing: 😙 :kissing_smiling_eyes: 😛 :stuck_out_tongue:
@vaibhav-jain
vaibhav-jain / git
Last active June 7, 2019 07:53 — forked from lttlrck/gist:9628955
Rename git branch
==============
git commands
==============
To rename branch
=================
git branch -m old_branch new_branch # Rename branch locally
git push origin :old_branch # Delete the old branch
git push --set-upstream origin new_branch # Push the new branch, set local branch to track the new remote
@vaibhav-jain
vaibhav-jain / README-Template.md
Created August 17, 2018 08:17 — forked from PurpleBooth/README-Template.md
A template to make good README.md

Project Title

One Paragraph of project description goes here

Getting Started

These instructions will get you a copy of the project up and running on your local machine for development and testing purposes. See deployment for notes on how to deploy the project on a live system.

Prerequisites

@vaibhav-jain
vaibhav-jain / dokku-error
Created September 11, 2017 14:30
dokku error
$ git push -f aws master:master
Total 0 (delta 0), reused 0 (delta 0)
remote: master
To dokku@ec2-xx-xx-xxx-xxx.compute-1.amazonaws.com:omapi
! [remote rejected] master -> master (pre-receive hook declined)
error: failed to push some refs to 'dokku@ec2-xx-xx-xxx-xxx.compute-1.amazonaws.com:omapi'
@vaibhav-jain
vaibhav-jain / class_names.py
Created July 31, 2017 10:12
Python to print names of all classes present inside a package. Just add this code to your __init__.py
import sys
import inspect
from pprint import pprint
clsmembers = inspect.getmembers(sys.modules[__name__], inspect.isclass)
l = list()
for k, v in clsmembers:
l.append(k)
pprint(set(l))