Skip to content

Instantly share code, notes, and snippets.

View lucaspg96's full-sized avatar

Lucas Peres lucaspg96

View GitHub Profile
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@lucaspg96
lucaspg96 / check.py
Last active November 23, 2017 17:21
from pymongo import MongoClient as mc
collection = mc().datavis.menus
found = 0
not_found = 0
with open("locations-2017-11-16 12:42:08.068035.txt") as f:
for line in f:
place,coords= line.split(" -> ")
if not collection.find_one({"place":place}):
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
var mysql = require('mysql')
var connection = mysql.createConnection({
host: "localhost",
user: process.env.USER_MYSQL,
password: process.env.PASS_MYSQL,
database: "test"
})
connection.connect()
def decode(s):
return " ".join([chr(int(n)) for n in s.split(" ") if n!='32'])
def encode(s):
return " ".join([str(ord(c)) for c in s])