Skip to content

Instantly share code, notes, and snippets.

mattst

Block or report user

Report or block mattst

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@mattst
mattst / JumpToCharSeqFixed.py
Created Jun 22, 2018
JumpToCharSeqFixed.py
View JumpToCharSeqFixed.py
#
# Name: JumpToCharSeq (Jump To Character Sequence)
# Author: mattst@i-dig.info
# Requires: Sublime Text v3
#
# ST Command: jump_to_char_seq
# Optional Arg: direction --> "forwards" (default), "backwards"
# Optional Arg: case_sensitive --> boolean (default is false)
#
View JumpToCharSeq.py
#
# Name: JumpToCharSeq (Jump To Character Sequence)
# Requirements: Plugin for Sublime Text v.3
# Written by: mattst@i-dig.info
#
# ST Command: jump_to_char_seq
#
# Optional Arg: direction
# -----------------------------------------------------------
View ST_Set_Syntax.py
# The following methods are part of a project and are not stand-alone code. As
# such anyone wishing to re-use the code will have to modify it, note the use of
# the class variables `self.active_window` and `self.active_view` which would
# need to be changed to valid instances of the active `window` and `view`.
def set_syntax(self, path):
"""
Sets the syntax associated with the file extension of path.
There is no method to get the syntax of a file extension in the ST API.
@mattst
mattst / MouseWriteToDevice.c
Created Mar 6, 2018
Writes a left mouse button press or release event directly to the input device of the mouse.
View MouseWriteToDevice.c
/*
Writes a left mouse button press or release event
directly to the input device of the mouse.
Credit for barebones code: https://goo.gl/upXCqR
Currently takes one arg which must be either of:
BTN_LF_PRESS: write a left mouse button press event
BTN_LF_RELEASE: write a left mouse button release event
Written by: mattst@i-dig.info @ 2018-03-02
View xev output.md

xev events for "xdotool click 3" launched with control + 8

FocusIn event, serial 37, synthetic NO, window 0x2c00001, mode NotifyGrab, detail NotifyPointer

KeymapNotify event, serial 37, synthetic NO, window 0x0, keys: 4294967188 0 2 0 32 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0

View TestGetFileAttributesW.py
# Code to test the reliability of windll.kernel32.GetFileAttributesW()
# by running it on every file (that has read access) on the file system.
import os, os.path, sys
from ctypes import windll
HIDDEN_FILE_ATTRIBUTE = 2
GET_ATTRIBUTES_FAILED = -1
@mattst
mattst / GetFileExtensionSyntax.py
Last active Nov 7, 2018
GetFileExtensionSyntax
View GetFileExtensionSyntax.py
# Proof of concept; retrieve the path of the syntax that a user has
# associated with any file extension in Sublime Text.
#
# 1) Create a temp file with the file extension of the desired syntax.
# 2) Open the temp file in ST with the API `open_file()` method; use a
# sublime.TRANSIENT buffer so that no tab is shown on the tab bar.
# 3) Retrieve the syntax ST has assigned to the view's settings.
# 4) Close the temp file's ST buffer.
# 5) Delete the temp file.
#
@mattst
mattst / TestQuickPanel.py
Last active Nov 12, 2016
ST plugin to try to reproduce r-stein quick panel bug
View TestQuickPanel.py
# { "keys": ["ctrl+whatever"], "command": "example" },
# { "keys": ["ctrl+whatever"], "command": "example_two" }
import sublime, sublime_plugin
# *********************
# WindowCommand Version
# *********************
@mattst
mattst / Git Commit Guidelines.md
Last active Sep 29, 2016
Git Commit Guidelines - From AngularJS
View Git Commit Guidelines.md
@mattst
mattst / Boxy Tomorrow.sublime-theme
Created Sep 20, 2016
Boxy Tomorrow.sublime-theme with theme_accent_numix entries added
View Boxy Tomorrow.sublime-theme
// > BOXY TOMORROW
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
// Definitely, your next theme for Sublime Text 3
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
[
//
// >> Autocomplete
// ===========================================================================
// Autocomplete settings and behavior
You can’t perform that action at this time.