This file contains 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
func PrettyString(str string) (string, error) { | |
var prettyJSON bytes.Buffer | |
if err := json.Indent(&prettyJSON, []byte(str), "", " "); err != nil { | |
return "", err | |
} | |
return prettyJSON.String(), nil | |
} |
This file contains 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
folder_count=$(($(ls | wc -l) / 1000 + 1)) | |
for (( i=1; i<=$folder_count; i++ )) | |
do | |
d=dir_$(printf %03d $i); | |
mkdir -p $d; | |
done | |
j=0; | |
for f in $(find . -maxdepth 1 -type f); | |
do |
This file contains 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
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] | |
This file contains 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
{ | |
"server":"0.0.0.0", | |
"server_ipv6":"::", | |
"port_password": { | |
"443": "", | |
"9801": "", | |
"9802": "", | |
"9803": "", | |
"9804": "", | |
"9805": "", |
This file contains 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
{ | |
"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, |
This file contains 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
"python.linting.pep8Args": ["--ignore=E501"] |
This file contains 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
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) |
This file contains 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
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])) |
This file contains 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
print 'Hello World!' |