Skip to content

Instantly share code, notes, and snippets.

View jsam's full-sized avatar
🦁

sam jsam

🦁
View GitHub Profile
@jsam
jsam / README.md
Last active August 29, 2015 14:20 — forked from rantav/README.md

A few show tricks to find slow queries in mongodb

Enable profiling

First, you have to enable profiling

> db.setProfilingLevel(1)

Now let it run for a while. It collects the slow queries ( > 100ms) into a capped collections, so queries go in and if it's full, old queries go out, so don't be surprised that it's a moving target...

@jsam
jsam / 0_reuse_code.js
Created July 2, 2014 23:33
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
@jsam
jsam / django_tornado_handler.py
Created August 21, 2012 13:30 — forked from bdarnell/django_tornado_handler.py
django_tornado_handler.py
# NOTE: This code was extracted from a larger class and has not been
# tested in this form. Caveat emptor.
import django.conf
import django.contrib.auth
import django.core.handlers.wsgi
import django.db
import django.utils.importlib
import httplib
import json
import logging