Skip to content

Instantly share code, notes, and snippets.

View 3dln's full-sized avatar
🌞
blessed

Ashkan Ashtiani 3dln

🌞
blessed
View GitHub Profile
@3dln
3dln / debug_stuff.py
Created May 25, 2019 07:35 — forked from dhrrgn/debug_stuff.py
A handy SQL debug function for Flask-SQLAlchemy
from . import app
from flask.ext.sqlalchemy import get_debug_queries
if app.debug:
app.after_request(sql_debug)
def sql_debug(response):
queries = list(get_debug_queries())
query_str = ''
@sjcotto
sjcotto / qrCode.js
Created May 5, 2016 20:07
Generate QR Code and save to mongodb
var json = {
email : "santiago@konacloud.io",
name : "Santiago Cotto"
};
var qr = require('qr-image');
var mongoose = require('mongoose');
var image = qr.imageSync(JSON.stringify(json), { type: 'png', size : 10 });
var Grid = require('gridfs');