Skip to content

Instantly share code, notes, and snippets.

#!/usr/bin/python3
#
# List all files that have ever been committed in this repository, in any
# commit in any branch.
import pygit2
import stat
def list_all_files(repo_path):
repo = pygit2.Repository(repo_path)
postgres=# EXPLAIN analyze SELECT * FROM SalesOrderDetail
postgres-# WHERE Qty=12 AND Rebate =6;
QUERY PLAN
---------------------------------------------------------------------------------------------------------------
Seq Scan on salesorderdetail (cost=0.00..494.15 rows=30 width=26) (actual time=0.278..5.196 rows=28 loops=1)
Filter: ((qty = 12) AND (rebate = 6))
Rows Removed by Filter: 22049
Planning Time: 0.140 ms
Execution Time: 5.224 ms
(5 rows)
@mbork
mbork / smart-yank.el
Last active July 4, 2018 18:02
Smart yanking for Emacs. See http://mbork.pl/2018-07-02_Smart_yanking for details.
(defun has-space-at-boundary-p (string)
"Check whether STRING has any whitespace on the boundary.
Return 'left, 'right, 'both or nil."
(let ((result nil))
(when (string-match-p "^[[:space:]]+" string)
(setq result 'left))
(when (string-match-p "[[:space:]]+$" string)
(if (eq result 'left)
(setq result 'both)
(setq result 'right)))