Skip to content

Instantly share code, notes, and snippets.

sum(idx_blks_read) as idx_read,
sum(idx_blks_hit) as idx_hit,
(sum(idx_blks_hit) - sum(idx_blks_read)) / sum(idx_blks_hit) as ratio
fjsj /
Last active May 21, 2017 04:51 — forked from nealtodd/gist:a8f87b0d95e73eb482c5
Django management command to detect missing migration files.
import sys
from django.apps import apps
from django.conf import settings
from import BaseCommand
from django.db import connections
from django.db.migrations.autodetector import MigrationAutodetector
from django.db.migrations.executor import MigrationExecutor
from django.db.migrations.state import ProjectState
from django.db.utils import OperationalError
fjsj / hn_seach.js
Last active September 21, 2015 14:35 — forked from kristopolous/hn_seach.js
hn job query search
function query() {
total = 0, shown = 0,
// HN is done with very unsemantic classes.
job_list ='.c5a,.cae,.c00,.c9c,.cdd,.c73,.c88')),
query_list =;
// This traverses up the dom stack trying to find a match of a specific class
function up_to(node, klass) {
if (node.className === klass) {