Skip to content

Instantly share code, notes, and snippets.

View monasorjja's full-sized avatar

Monasor J.J Atairu monasorjja

View GitHub Profile
apt-get install python3-pip
alias pip=pip3
apt-get install python3-virtualenv
#virtualenv can also be installed using
pip install --user virtualenv
import pandas as pd
import requests as re
import sqlite3 as sql
from wordsegment import unigram_counts as uc
#globals
con = sql.connect("C:\\Users\\win10\\YandexDisk\\apps\\flask\\new_file.sqlite")
df0 = pd.read_sql("SELECT * from do_1", con, index_col='host')
df = df0.copy()
wordniklist = []
import datetime
from datetime import timedelta
pdt = datetime.datetime.utcnow() - datetime.timedelta(seconds=25200)
""" seconds are equivalent of time difference, utc - 7 = pdt """
<script>
// Popup Window
var scrollTop = '';
var newHeight = '100';
$(window).bind('scroll', function() {
scrollTop = $( window ).scrollTop();
newHeight = scrollTop + 100;
});
$(document).ready(function () {
//open popup
$(".pop").click(function () {
$(this).parent().find("form .overlay_form").fadeIn(1000);
positionPopup();
});
//close popup
$(".close").click(function () {
$(".overlay_form").fadeOut(500);
import request as re
from bs4 import BeautifulSoup as bs
url = ''
headers={"User-Agent": "Mozilla/5.0 (Windows NT 6.3; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/37.0.2049.0 Safari/537.36"}
#headers ={"User-Agent": ""}
s = re.Sessions()
#then
#~ Rough code to get you going with Stanford POS Tagger on NLTK.
#~ http://netmatrx.com
#~
import os
#~from nltk.parse import stanford
os.environ['JAVAHOME'] = 'C:\Program Files\Java\jdk1.8.0_91'
#os.environ['STANFORD_POSTAGGER'] = 'C:\stanford\stanford-postagger-3.6.0.jar'