Skip to content

Instantly share code, notes, and snippets.

@corolla96
corolla96 / example.py
Created Dec 2, 2019
find common emails from two lists (intersection from two sets)
View example.py
import csv
def intersection(list1, list2):
"""
Find the unique intersection of two lists and return the intersection as a list.
"""
return [value for value in list1 if value in list2]
View config.json
{
"server":"0.0.0.0",
"server_ipv6":"::",
"port_password": {
"443": "",
"9801": "",
"9802": "",
"9803": "",
"9804": "",
"9805": "",
View config.json
{
"server_port":9800,
"password":"",
"protocol":"origin",
"obfs":"tls1.2_ticket_auth_compatible",
"method":"aes-128-cfb",
"server":"0.0.0.0",
"server_ipv6":"::",
"local_address":"127.0.0.1",
"local_port":1080,
@corolla96
corolla96 / settings.json
Created Jun 14, 2019
vscode pep8 settings. ignore line too long
View settings.json
"python.linting.pep8Args": ["--ignore=E501"]
View housing2.py
import csv
import gps
from uber_rides.session import Session
from uber_rides.client import UberRidesClient
token = '<redacted>'
session = Session(server_token=token)
client = UberRidesClient(session)
@corolla96
corolla96 / house1.py
Created May 17, 2019
House data analysis
View house1.py
import csv
import numpy
def _read_csv(file_name):
house_list = []
with open(file_name, 'r') as f:
reader = csv.DictReader(f)
for house in reader:
house_list.append((house['price'], house['bd'], house['sqft'], house['date'].split('/')[-1]))