Skip to content

Instantly share code, notes, and snippets.

View caspark's full-sized avatar

Caspar Krieger caspark

View GitHub Profile
@caspark
caspark / vscode.py
Created March 2, 2019 06:17
Caspar vscode grammars
vscode_repeatable_action_map = {
"join line": Key("csa-j"),
# requires bracket jumper extension
"klane": Key("ca-left"),
"krane": Key("ca-right"),
"krupper": Key("ca-up"),
"krowner": Key("ca-down"),
"shift klane": Key("csa-left"),
"shift krane": Key("csa-right"),
@caspark
caspark / morris-traversal-kth-smallest-in-bst.py
Created February 3, 2018 21:08
Explaining how to use Morris Traversal to find the k'th smallest element in a binary search tree
# Problem:
# Given a binary search tree t with each node having properties left, right
# (the left and right subtrees respectively) and value (the value of that
# node) and an integer k, find the k-th smallest element in the BST using
# constant space.
#
# Example:
# t =
# 3
# / \
diff --git a/source_control/git.py b/source_control/git.py
index dc8fe20..943fa39 100644
--- a/source_control/git.py
+++ b/source_control/git.py
@@ -688,6 +688,10 @@ def main():
# call run_command()
module.run_command_environ_update = dict(LANG='C', LC_ALL='C', LC_MESSAGES='C', LC_CTYPE='C')
+ import time