Skip to content

Instantly share code, notes, and snippets.

View houming818's full-sized avatar

houming818 houming818

View GitHub Profile
@csabatini
csabatini / db_read.py
Created March 9, 2015 19:39
MySQL-python
import MySQLdb
db = MySQLdb.connect("localhost", "user", "pw", "census")
cursor = db.cursor()
sql = 'SELECT * FROM name'
cursor.execute(sql)
results = cursor.fetchall()
print len(results)
@staticor
staticor / mysql_pandas.py
Created June 20, 2016 11:43
mysql_pandas.py
#!/usr/bin/python
import MySQLdb
import pandas as pd
db = MySQLdb.connect(host= ENJOY_CONFIG['host'],
user=ENJOY_CONFIG['user'],
passwd=ENJOY_CONFIG['password'],
db=ENJOY_CONFIG['database']
)
@uorat
uorat / nginx-websocket-proxy.conf
Last active February 11, 2023 16:04
Nginx Reverse Proxy for WebSocket
upstream websocket {
server localhost:3000;
}
server {
listen 80;
server_name localhost;
access_log /var/log/nginx/websocket.access.log main;