Skip to content

Instantly share code, notes, and snippets.

View mtairu's full-sized avatar

Mo. Atairu mtairu

View GitHub Profile
#~ 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'
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
$(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);
<script>
// Popup Window
var scrollTop = '';
var newHeight = '100';
$(window).bind('scroll', function() {
scrollTop = $( window ).scrollTop();
newHeight = scrollTop + 100;
});
import datetime
from datetime import timedelta
pdt = datetime.datetime.utcnow() - datetime.timedelta(seconds=25200)
""" seconds are equivalent of time difference, utc - 7 = pdt """
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 = []
apt-get install python3-pip
alias pip=pip3
apt-get install python3-virtualenv
#virtualenv can also be installed using
pip install --user virtualenv
apt-get install npm
apt-get install nodejs-legacy
npm install phantomjs-prebuilt
apt-get install libfontconfig
phantomjs -v
@mtairu
mtairu / check domain ext
Created August 25, 2017 09:28
use sockets to determine domain availabity
bar = pyprind.ProgBar(len(df.host.tolist()))
def check_extensions(domain):
ext_taken = {'de':'','uk':'','org':'','net':'','ca':'','info':'','eu':'',
'fr':'','es':'','nl':'','biz':'','com':'','host':'','be':'','it':'',
'se':'','no':'','jp':'','fi':'','ie':''}
de_ = domain + '.de'
uk_ = domain + '.co.uk'
org_ = domain + '.org'
net_ = domain + '.net'
#
## aria2 config
#
# man page = http://aria2.sourceforge.net/manual/en/html/aria2c.html
# file path = $HOME/.aria2/aria2.conf
# Download Directory: specify the directory all files will be downloaded to.
# When this directive is commented out, aria2 will download the files to the
# current directory where you execute the aria2 binary.
#dir=/some/download/