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
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 |
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
# 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 | |
# / \ |
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
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"), |
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
# git and related commands (assumes you have the extra `text` bound to dragonfly `Dictation()` | |
"git add": Text("git add "), | |
"git add patch": Text("git add -p "), | |
"git branch": Text("git branch "), | |
"git checkout": Text("git checkout "), | |
"git clone": Text("git clone "), | |
"git commit": Text("git commit -v "), | |
"git commit message [<text>]": Text("git commit -m ''") + Key("left") + Text("%(text)s"), | |
"git commit all message [<text>]": Text("git commit -a -m ''") + Key("left") + Text("%(text)s"), | |
"git commit all": Text("git commit -va "), |
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
# Snippets to sign an executable of your choice with a new certificate trusted only by you. | |
# Run these commands in an Administrative Powershell session. | |
# | |
# WARNING: This creates a new certificate authority and installs it on your computer! | |
# This means that if someone gets a hold of the certificate you generate here, they can | |
# impersonate (almost) any HTTPS website you visit (exception being sites which pin their | |
# certificates - but that is not the norm yet). | |
# | |
# Source: https://stackoverflow.com/a/51443366/775982 |
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
"""A grammar to swap windows by saying words in their title. | |
Uses a natlink timer to periodically load the list of open windows into a DictList, | |
so they can be referenced by the "switch window" command. | |
Commands: | |
"switch window <keyword>" -> switch to the window with the given word in its | |
title. If multiple windows have that word in | |
their title, then you can say more words in the |
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
# to get started, try `print get_grammar_complexity_tree(some_grammar, threshold=5)`. | |
# If you don't get any interesting output, turn up the threshold (max depth visualized) to something like 7 or 10 :) | |
class ComplexityNode(object): | |
def __init__(self, item): | |
self.item = item | |
self.children = [] | |
self.total_descendents = 1 | |
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
// ==UserScript== | |
// @name Google Slash Search | |
// @namespace http://tampermonkey.net/ | |
// @version 0.1 | |
// @description try to take over the world! | |
// @author You | |
// @match https://www.google.com/search* | |
// @grant none | |
// ==/UserScript== |
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
import logging, os | |
import dragonfly | |
if False: | |
logging.basicConfig(level=10) | |
logging.getLogger('grammar.decode').setLevel(20) | |
logging.getLogger('compound').setLevel(20) | |
# logging.getLogger('kaldi').setLevel(30) | |
logging.getLogger('engine').setLevel(10) |
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
from __future__ import print_function | |
import datetime | |
import os | |
import sys | |
import traceback | |
import dragonfly | |
try: |
OlderNewer