Skip to content

Instantly share code, notes, and snippets.

View stefanmonkey's full-sized avatar

stefan bo stefanmonkey

View GitHub Profile
stefan_bo@MacMini_Drei$ kitchen diagnose --no-instances --loader
---
timestamp: 2019-01-09 08:47:18 UTC
kitchen_version: 1.24.0
loader:
process_erb: true
process_local: true
process_global: true
global_config:
project_config:
@stefanmonkey
stefanmonkey / read_image.py
Created January 8, 2014 08:18
read image
#!/usr/bin/python
# -*- coding: utf-8 -*-
import MySQLdb as mdb
def writeImage(data):
fout = open('woman2.jpg', 'wb')
with fout:
@stefanmonkey
stefanmonkey / insert_image.py
Created January 8, 2014 08:13
insert image
#!/usr/bin/python
# -*- coding: utf-8 -*-
import MySQLdb as mdb
def read_image():
fin = open("woman.jpg")
img = fin.read()
@stefanmonkey
stefanmonkey / prepared.py
Created January 8, 2014 07:56
prepared statements
#!/usr/bin/python
# -*- coding: utf-8 -*-
import MySQLdb as mdb
con = mdb.connect('localhost', 'testuser', 'test623', 'testdb')
with con:
cur = con.cursor()
@stefanmonkey
stefanmonkey / columnheaders.py
Created January 8, 2014 07:48
column headers
#!/usr/bin/python
# -*- coding: utf-8 -*-
import MySQLdb as mdb
con = mdb.connect('localhost', 'testuser', '123456', 'testdb')
with con:
cur = con.cursor()
@stefanmonkey
stefanmonkey / dictcur.py
Created January 8, 2014 07:42
dict cursor
#!/usr/bin/python
# -*- coding: utf-8 -*-
import MySQLdb as mdb
con = mdb.connect('localhost', 'testuser', '123456', 'testdb')
with con:
cur = con.cursor(mdb.cursors.DictCursor)
@stefanmonkey
stefanmonkey / fetch_onebyone.py
Created January 8, 2014 07:21
fetch one by one
#!/usr/bin/python
# -*- coding: utf-8 -*-
import MySQLdb as mdb
con = mdb.connect('localhost', 'testuser', 'test623', 'testdb');
with con:
cur = con.cursor()
#!/usr/bin/python
# -*- coding: utf-8 -*-
import MySQLdb as mdb
con = mdb.connect('localhost', 'testuser', '123456', 'testdb');
with con:
cur = con.cursor()
#!/usr/bin/python
# -*- coding: utf-8 -*-
import MySQLdb as mdb
con = mdb.connect('localhost', 'testuser', '123456', 'testdb');
with con:
cur = con.cursor()
@stefanmonkey
stefanmonkey / MySQLdb.py
Created January 8, 2014 07:04
MySQLdb module
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import MySQLdb as mdb
import sys
try:
con = mdb.connect('localhost', 'testuser', '123456', 'testdb')
cur = con.cursor()