Skip to content

Instantly share code, notes, and snippets.

import sublime
import sublime_plugin
import itertools
class LogFilterCommand(sublime_plugin.WindowCommand):
def run(self, search_type = 'string', invert_search=False):
self.search_type = search_type
self.invert_search = invert_search
@AndrewHoos
AndrewHoos / shell.py
Last active November 26, 2019 15:09
A shell function that can read and echo both stdout and stderr (works with bash)
'''A simple utility for running UNIX shell commands'''
KEEP_STDOUT = 0x1
KEEP_STDERR = 0x1 << 1
ECHO_STDOUT = 0x1 << 2
ECHO_STDERR = 0x1 << 3
def shell(command, input_=None, output_=(KEEP_STDOUT | KEEP_STDERR | ECHO_STDOUT | ECHO_STDERR), wait=True):
'''
@AndrewHoos
AndrewHoos / 100.py
Created June 2, 2015 21:24
100 Reasons why I love python
# ..:77I777777777777777777777I. .
# ..?77777777777777777777777777777$+..
# . ~7777777I7777777777777777777777777$~..
# .7I7777...7777777777777777777777777$7+.
# .?7777.. ..77777777777777777777777$$7.
# .77777 777777777777777777777$$$$$I
# .77777.. ...7777777777777777777$$$$$$$$
# .7777777 .77$777777777777777777$$$$$$$$
# .77777777777777777777777777777$$$$$$$$$$
# .77777777777777777777777777$$$$$$$$$$$$$