Skip to content

Instantly share code, notes, and snippets.

🎯
Focusing on work

vaibhav jain vaibhav-jain

🎯
Focusing on work
Block or report user

Report or block vaibhav-jain

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@vaibhav-jain
vaibhav-jain / gist:0b703c498d02f7807eb694700867035b
Created Jul 30, 2019 — forked from rxaviers/gist:7360908
Complete list of github markdown emoji markup
View gist:0b703c498d02f7807eb694700867035b

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 / README-Template.md
Created Aug 17, 2018 — forked from PurpleBooth/README-Template.md
A template to make good README.md
View README-Template.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

View 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 Jul 31, 2017
Python to print names of all classes present inside a package. Just add this code to your __init__.py
View class_names.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))
@vaibhav-jain
vaibhav-jain / titanic.py
Created Jul 30, 2017
Using TFLearn and TensorFlow to estimate the surviving chance of Titanic passengers.
View titanic.py
#!/usr/bin/env python
import os
import numpy as np
os.environ['TF_CPP_MIN_LOG_LEVEL'] = '2'
import tflearn
from tflearn.data_utils import load_csv
from tflearn.datasets import titanic
@vaibhav-jain
vaibhav-jain / ml2.py
Created Jul 30, 2017
Solving classical Iris problem using machine learning.
View ml2.py
#!/usr/bin/env python
import numpy as np
from sklearn import tree
from sklearn.datasets import load_iris
iris = load_iris()
test_tdx = [0, 50, 100]
# training data
@vaibhav-jain
vaibhav-jain / ml1.py
Last active Jul 23, 2017
Getting Started with Machine Learning using SciKit-learning
View ml1.py
#!/usr/bin/env python
# My first Machine Learning Program.
from sklearn import tree
"""
Apple & oranges problem [Weight, Texture]
"""
features1 = [
[140, 0],
@vaibhav-jain
vaibhav-jain / gist:7af5bb5ce4341fdb8e3a1af1ccb83ed3
Created Mar 6, 2017 — forked from rtorr/gist:3148833
No duplicate (case-insensitive) entries django model
View gist:7af5bb5ce4341fdb8e3a1af1ccb83ed3
from django.db import models
from django.db.models import Manager
from django.db.models.query import QuerySet
class CaseInsensitiveQuerySet(QuerySet):
def _filter_or_exclude(self, mapper, *args, **kwargs):
# 'name' is a field in your Model whose lookups you want case-insensitive by default
if 'name' in kwargs:
kwargs['name__iexact'] = kwargs['name']
del kwargs['name']
@vaibhav-jain
vaibhav-jain / gist:b8242404f796f490ac4c21259222ace0
Created Nov 19, 2016 — forked from fernandoaleman/gist:5083680
How to update VirtualBox Guest Additions with vagrant
View gist:b8242404f796f490ac4c21259222ace0
# Start the old vagrant
$ vagrant init centos-6.3
$ vagrant up
# You should see a message like:
# [default] The guest additions on this VM do not match the install version of
# VirtualBox! This may cause things such as forwarded ports, shared
# folders, and more to not work properly. If any of those things fail on
# this machine, please update the guest additions and repackage the
# box.
@vaibhav-jain
vaibhav-jain / UniqueTogetherValidator.py
Created Jul 2, 2016
Django Rest Framework (DRF) Custom Unique Together Message
View UniqueTogetherValidator.py
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:
You can’t perform that action at this time.