This file contains hidden or 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
var productTabs = document.getElementById('products'); | |
var tabs = productTabs.querySelectorAll('li'); | |
var l = tabs.length | |
var delay = 5000 | |
var i = 0 | |
function cycle() { | |
setTimeout(function() { | |
tabs[i].firstElementChild.click(); | |
i++; |
This file contains hidden or 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
$ docker-compose -f docker-compose.yml -f docker-compose.development.yml build | |
$ docker-compose -f docker-compose.yml -f docker-compose.development.yml up |
This file contains hidden or 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
#*-*encoding: utf-8*-* | |
from peewee import * | |
import os, sys, io | |
import re | |
import pickle, json | |
import csv | |
import time | |
import urllib | |
from datetime import datetime | |
from urllib.parse import urlparse |
This file contains hidden or 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
function util__is_valid(value) { | |
var re; | |
re = /^[a-zA-Z][a-zA-Z0-9\-_]+$/; | |
return value && re.test(value); | |
}; | |
function util__element(element, is_name_only) { | |
var c, classes, data, name, _i, _len, _ref; | |
name = element.tagName.toLowerCase(); | |
if (is_name_only) { |
This file contains hidden or 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
elems = document.querySelectorAll('div') | |
l = []; | |
for (var i = 0, len = elems.length; i < len; i++) { | |
if (elems[i].offsetTop != 0) { | |
l.push(elems[i]); | |
}; | |
}; | |
// l.sort((a, b) => ((a.scrollHeight * a.scrollWidth) < (b.scrollHeight * b.scrollWidth)) ? 1 : -1); | |
// for (var i=0, len=l.length; i < len; i++) { | |
// console.log(l[i].offsetTop, l[i].offsetLeft, l[i].offsetHeight, l[i].offsetWidth, l[i]) |
This file contains hidden or 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
#*-*encoding: utf-8*-* | |
from peewee import * | |
from sklearn.preprocessing import LabelEncoder | |
import pandas as pd | |
import numpy as np | |
import json | |
import re | |
from urllib.parse import urlparse, parse_qs | |
re_toke = re.compile('\W+') |
This file contains hidden or 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 peewee import * | |
if __name__ == '__main__': | |
# DATABASE SETUP | |
database = SqliteDatabase('test_db.db') | |
class BaseModel(Model): | |
class Meta: | |
database = database |
This file contains hidden or 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
https://www.boots.com/ | |
['Beauty | Health | Pharmacy and Prescriptions - Boots'] | |
['body: 3', 'images: 48', 'links: 1543', 'meta_tags: 15', 'texts: 138', 'titles: 1', 'url: 22'] | |
Traceback (most recent call last): | |
File "C:\h\envs\mlpricecomp\lib\site-packages\peewee.py", line 2936, in execute_sql | |
cursor.execute(sql, params or ()) | |
sqlite3.IntegrityError: UNIQUE constraint failed: selecclass_selector_through.selecclass_id, selecclass_selector_through.selector_id | |
During handling of the above exception, another exception occurred: |
This file contains hidden or 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
Good morning! Here's your coding interview problem for today. | |
This problem was recently asked by Google. | |
Given a list of numbers and a number k, return whether any two numbers from the list add up to k. | |
For example, given [10, 15, 3, 7] and k of 17, return true since 10 + 7 is 17. | |
Bonus: Can you do this in one pass? | |
any([(a+b)==k for a in l for b in l]) | |
--- |
This file contains hidden or 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
def get_filename(): | |
dt = datetime.datetime.now() | |
filename = '_stored_values-{}_{}_{}'.format(dt.year, dt.month, dt.day) | |
return filename | |
def get_and_store_data(current_file_name): | |
questions = [ | |
'Question 1', | |
'Question 2', | |
'Question 3', |