This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(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))) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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) |