Skip to content

Instantly share code, notes, and snippets.

@saaj
saaj / .bash_aliases
Last active May 10, 2020 09:13
Bash alias for process group RSS percentage via termsql
alias topmem='smemstat -sm | termsql -01 -r 6 -T 3 "SELECT SUM(PSS) as PSS, SUM(RSS) as RSS, Command \
FROM tbl GROUP BY Command ORDER BY SUM(PSS) DESC LIMIT 5" | column -t -s "|"'
alias topmemps='ps -x -o rss,%mem,cmd | termsql -m tabs -01 "SELECT SUM(rss) / 1024 as RSS, SUM([%mem]) AS PCT, cmd \
FROM tbl GROUP BY cmd ORDER BY SUM(rss) DESC LIMIT 5"'
@saaj
saaj / HISTORY.rst
Created April 26, 2020 20:10
SQLite3 multi-value bulk insert PK generation consequence test
@saaj
saaj / HISTORY.rst
Created April 26, 2020 20:05
Local DynamoDB and simplistic administrative UI
@saaj
saaj / HISTORY.rst
Created April 26, 2020 20:04
Development MySQL server and administrative UI
@saaj
saaj / 73498.svg
Created August 1, 2019 18:21
hstr demo
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@saaj
saaj / ranking.py
Created June 9, 2014 11:31
Python SQLite ranking functions for sqlitefts
# -*- coding: utf-8 -*-
'''
Ranking code based on:
https://github.com/coleifer/peewee/blob/master/playhouse/sqlite_ext.py
'''
import struct
import math
@saaj
saaj / marshmallow.ipynb
Last active September 12, 2018 09:50
Marshmallow field validation for an empty text field
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.