Skip to content

Instantly share code, notes, and snippets.

@mattst
mattst / TestClipTwoMinData.csv
Created November 9, 2018 17:15
FFMPEG libx264 encodes 2 min video, CRFs 18 to 27, all presets except placebo, encode times and file sizes
CRF Preset Time (Secs) Size (MB)
18 ultrafast 13.91 175.13
18 superfast 24.39 149.13
18 veryfast 36.39 87.97
18 faster 55.89 94.50
18 fast 79.71 97.76
18 medium 97.80 94.15
18 slow 145.07 91.47
18 slower 262.72 91.55
18 veryslow 503.44 84.07
@mattst
mattst / MoveTabInGroup.py
Last active October 27, 2018 16:23
An ST plugin to move the active buffer's tab left and right on the tab bar.
#
# Name: MoveTabInGroup
# Requirements: Plugin for Sublime Text v2 and v3
# Written by: mattst - https://github.com/mattst
# ST Command: move_tab_in_group
# Arg Required: direction: "left" or "right"
# Description: An ST plugin to move the active buffer's
# tab left and right on the tab bar.
#
@mattst
mattst / MultipleSelectionClearerTopOrBottom.py
Last active August 11, 2019 04:03
An ST plugin to clear multiple selections to the top or bottom selection.
#
# Name: MultipleSelectionClearerTopOrBottom
# Requirements: Plugin for Sublime Text v2 and v3
# Written by: mattst - https://github.com/mattst
# ST Command: multiple_selection_clearer_top_or_bottom
# Arg: pos: "top" or "bottom"
# Context Key: multiple_selection_clearer_top_or_bottom_key
#
# This plugin has been designed to be used with specific keys, those being the
# same ones as the Move Tab In Group plugin. The context key ensures that this
@mattst
mattst / FocusMostRecentTabCloser.py
Last active May 1, 2024 22:05
Sublime Text 3 Plugin - Closes the focused view and focuses the next most recent view
#
# MIT License
#
# To use, assign keys to the "focus_most_recent_tab_closer" command, e.g.
# {"keys": ["ctrl+k", "ctrl+w"], "command": "focus_most_recent_tab_closer"},
#
import sublime
import sublime_plugin
import time
@mattst
mattst / ExpandSelectionByExpression.py
Created June 22, 2018 15:29
ExpandSelectionByExpression.py
#
# Name: Expand Selection By Expression
# Author: mattst@i-dig.info
# Requires: Sublime Text v3
#
# ST Command: expand_selection_by_expression
# Optional Arg: expression_type --> "regex" (default), "literal"
# Optional Arg: case_sensitive --> boolean (default is false)
#
@mattst
mattst / JumpToCharSeqFixed.py
Created June 22, 2018 15:22
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)
#
@mattst
mattst / JumpToCharSeq.py
Created June 19, 2018 13:07
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
# -----------------------------------------------------------
# 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 March 6, 2018 15:25
Writes a left mouse button press or release event directly to the input device of the mouse.
/*
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

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