Skip to content

Instantly share code, notes, and snippets.

@jimr
jimr / pagination.py
Created December 9, 2014 14:56
flickr.py search pagination usage example
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import flickr
flickr.API_KEY = '<your API key>'
flickr.API_SECRET = '<your API secret>'
page = 1
per_page = 10
@jimr
jimr / db_size_check.sql
Created September 16, 2015 13:52
Show the top 25 MySQL database tables by size on disk
SELECT
CONCAT(table_schema, '.', table_name) as 'table',
CONCAT(ROUND(table_rows / 1000000, 2), 'M') rows,
CONCAT(ROUND(data_length / (1024 * 1024 * 1024), 2), 'G') data,
CONCAT(ROUND(index_length / (1024 * 1024 * 1024), 2), 'G') idx,
CONCAT(ROUND((data_length + index_length) / (1024 * 1024 * 1024), 2), 'G') total_size,
ROUND(index_length / data_length, 2) idxfrac
FROM information_schema.TABLES
-- WHERE table_schema = 'some_db'
ORDER BY data_length + index_length DESC

Keybase proof

I hereby claim:

  • I am jimr on github.
  • I am jimr (https://keybase.io/jimr) on keybase.
  • I have a public key whose fingerprint is 788D 1F2D A813 72EA 42A5 350A C19F 559A 4045 40D7

To claim this, I am signing this object: