Skip to content

Instantly share code, notes, and snippets.

@chendesheng
chendesheng / DoubleClickAtCaretCommand.py
Created January 9, 2023 14:25
Sublime Text jump to file from Find Results using keyboard
import sublime
import sublime_plugin
class DoubleClickAtCaretCommand(sublime_plugin.TextCommand):
def run(self, edit, **kwargs):
view = self.view
cursor = view.sel()[0]
(rg, scope) = view.extract_tokens_with_scopes(view.line(cursor))[1]
if 'line-number.match.find-in-files' in scope:
@chendesheng
chendesheng / advent2022-day11.hs
Last active December 11, 2022 08:00
Advent of Code 2022 Day 11
import Text.Megaparsec
import Text.Megaparsec.Char
import Text.Megaparsec.Char.Lexer qualified as L
type Parser a = Parsec Void String a
unsafeParse :: Parser a -> String -> a
unsafeParse p s = fromJust <| parseMaybe p s
sc :: Parser ()