Skip to content

Instantly share code, notes, and snippets.

@tophf
tophf / violentmonkey.light.compact.css
Last active February 24, 2021 17:27
Violentmonkey compact light theme
.CodeMirror-code {
font-size: 15px;
}
.scripts {
contain: strict;
display: block !important;
}
.tab-installed .script {
display: flex;
align-items: center;
@tophf
tophf / violentmonkey.css
Last active December 13, 2022 12:47
dark theme for violentmonkey
/************************************************* CODEMIRROR */
/* Based on Sublime Text's Monokai theme */
.cm-s-eclipse.CodeMirror {
color: #8a8a8a;
background: #222;
}
.cm-s-eclipse div.CodeMirror-selected {
background: #49483e;
}
// Copyright (c) 2013 Pieroxy <pieroxy@pieroxy.net>
// This work is free. You can redistribute it and/or modify it
// under the terms of the WTFPL, Version 2
// For more information see LICENSE.txt or http://www.wtfpl.net/
//
// For more information, the home page:
// http://pieroxy.net/blog/pages/lz-string/testing.html
//
// LZ-based compression algorithm, version 1.4.4
var LZString = (function() {
@tophf
tophf / sublimeRunner.cpp
Last active February 23, 2016 14:08
sublimeRunner starts ST3 and removes its window title bar
#include <windows.h>
#include <shlwapi.h>
#include <strsafe.h>
#pragma optimize("gsy", on)
#pragma comment(linker, "/ENTRY:start")
#pragma comment(linker, "/NODEFAULTLIB:no")
void reuseRunningInstance(HWND hST) {
int argc;
@tophf
tophf / qp2VFRchapters.py
Created October 19, 2015 15:11
Convert qp-file to simple chapters file using timecodes v1 file
#!python3
import sys, re, bisect, collections, argparse
def run():
parser = HelpfulParser()
parser.add_argument('qpfile', type=argparse.FileType('r'),
help='the source qp file')
parser.add_argument('timecodesfile', type=argparse.FileType('r'),
help='the source timecodes v1 file')
parser.add_argument('chaptersfile', type=argparse.FileType('w'), nargs='?', default=sys.stdout,
@tophf
tophf / menu.json
Created May 4, 2014 23:50
Copy field macros in the context menu
{
"grid_context" : [
{ "command" : "subtitle/insert/before", "text" : "&Insert (before)" },
{ "command" : "subtitle/insert/after", "text" : "Insert (after)" },
{ "command" : "subtitle/insert/before/videotime", "text" : "Insert at video time (before)" },
{ "command" : "subtitle/insert/after/videotime", "text" : "Insert at video time (after)" },
{},
{ "command" : "edit/line/duplicate" },
{ "command" : "edit/line/split/before" },
{ "command" : "edit/line/split/after" },
export script_name = 'Delete keyframe'
export script_description = 'Delete keyframe from a loaded "keyframe format v1" file'
aegisub.register_macro script_name, script_description, (subs) ->
local kf_file
error 'Load video first.' if not aegisub.frame_from_ms 0
info_section_scanned = false
for line in *subs
@tophf
tophf / aegisub-focus-editbox.ahk
Created January 24, 2014 06:44
Aegisub: focus editbox with Alt-~
#IfWinActive,ahk_class wxWindowNR,sashWindow
!`::ControlClick,wxWindowNR12
#IfWinActive
function fixdupfield( clip c, int "thr" )
{
thr = default(thr,4)
s = c.separatefields()
m = mt_lutxy(s.selecteven, s.selectodd, "x y - abs "+string(thr)+" - 255 *")
\ .removegrain(4,-1).mt_expand.mt_inpand.mt_inpand.removegrain(4,-1)
conditionalfilter(m,c.nnedi3,c,"YPlaneMax","==","0")
mergechroma(c)
}