Skip to content

Instantly share code, notes, and snippets.

View export_har_domains_urls.py
import json
from urllib.parse import urlparse
def parse_har(filename):
with open(filename) as h:
data = json.loads(h.read())
urls = list(set([i['request']['url'] for i in data['log']['entries']]))
domains = list(set([urlparse(i).netloc for i in urls]))
View test.py
from collections import defaultdict
def solution(A):
ordered_values = get_ordered_values(A)
ocurrences = get_ocurrences(A)
max_left = max(A)
max_right = 0
max_diff = 0
left = A
View chora_luisera.py
def prime_factors(val):
x = 2
factors = []
while x*x <= val:
if val%x:
x += 1
else:
val //= x
factors.append(x)
View designer.html
<link rel="import" href="../ace-element/ace-element.html">
<polymer-element name="my-element">
<template>
<style>
:host {
position: absolute;
width: 100%;
height: 100%;