This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import argparse | |
import re | |
from multiprocessing.pool import ThreadPool as Pool | |
import requests | |
import bs4 | |
root_url = 'http://pyvideo.org' | |
index_url = root_url + '/category/50/pycon-us-2014' | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from threading import Thread | |
import requests ## pip install requests | |
import time | |
import smtplib | |
## email sending function | |
def email_sender(input_message, email_to, client): | |
''' function to send email ''' | |
to = email_to | |
gmail_user = '' ## email of sender account |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from selenium import webdriver | |
import time | |
import os | |
import datetime as dt | |
from BeautifulSoup import BeautifulSoup | |
from pyvirtualdisplay import Display | |
import json | |
import sys,getopt | |
import datetime | |
chromedriver = "/usr/bin/chromedriver" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
models.py | |
from django.db import models | |
from uuid import uuid4 | |
from uuid import UUID | |
import uuid | |
from django_extensions.db.fields import UUIDField | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sample Integration payU in django based projects | |
Settings.py | |
PAYU_INFO = { | |
'merchant_key': "test merchant key", |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from threading import Thread | |
import requests ## pip install requests | |
import time | |
import smtplib | |
## email sending function | |
def email_sender(input_message, email_to): | |
''' function to send email ''' | |
to = email_to | |
gmail_user = 'your email' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from django.contrib.auth.models import User | |
class Artist(User): | |
name = models.CharField(max_length=120, verbose_name='name') | |
class Followers(models.Model): | |
artist = models.ForeignKey(Artist, related_name='following') | |
follower = models.ForeignKey(Artist, related_name='followers') | |
date_created = models.DateTimeField(auto_now_add=True, verbose_name='Date Created') | |
date_updated = models.DateTimeField(null=True, blank=True) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from __future__ import unicode_literals | |
from django.contrib.auth.models import User | |
from django.contrib.auth.models import AbstractUser | |
from django.db import models | |
GENDER = (('F','Female'),('M','Male')) | |
# Create your models here. | |
class Proffession(models.Model): |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Create Virtualenv with Python3 | |
============================== | |
1. mkvirtualenv --python=/usr/local/bin/python3 multichat | |
2. workon multichat | |
3. pip3 install ipython | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$(document).ready(function(){ | |
$("#your-dropdown-id").change(function(){ | |
var drid = $(this).val(); | |
$.ajax({ | |
url: 'getUsers.php', | |
type: 'post', | |
data: {value:drid}, | |
dataType: 'json', | |
success:function(response){ | |
// add the json response into html values |
OlderNewer