- clone this gist:
git clone https://gist.github.com/5af90be72b98bce36a3e.git mpv-url-overlay-example
- copy (or symlink)
url-overlay.lua
to your mpv scripts directory (~/.config/mpv/scripts
or~/.mpv/scripts
) mpv --no-osc url-overlay-example.mkv
- Hold
tab
to highlight all on-screen urls. If you already usetab
for something, bind some key to the commandmp_url_overlay_show
. - Click urls to launch them. On Linux
xdg-open
is required. Will not work if you haveMOUSE_BTN0
bound to another command.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
convertClipToFP = ( clip ) -> | |
-- only muck around with vector clips (convert scaling factor into floating point coordinates). | |
unless clip\match "[%-%d%.]+, *[%-%d%.]+" | |
-- Convert clip with scale into floating point coordinates. | |
clip = clip\gsub "%((%d*),?(.-)%)", ( scaleFactor, points ) -> | |
if scaleFactor ~= "" | |
scaleFactor = tonumber scaleFactor | |
points = points\gsub "([%.%d%-]+) ([%.%d%-]+)", ( x, y ) -> | |
x = Math.round tonumber( x )/(2^(scaleFactor - 1)), 2 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// clang++ BadTimer.cpp -fPIC -shared -O3 -std=c++11 -o BadTimer.dylib | |
#include <chrono> | |
class BadTimer { | |
private: | |
std::chrono::high_resolution_clock::time_point startTime; | |
std::chrono::high_resolution_clock::time_point endTime; | |
std::chrono::duration<double> timeSpan; | |
public: | |
BadTimer( void ); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
inspectorExample = ( sub, sel, act ) -> | |
dialogStart = -1 | |
for i = 1, #sub | |
if 'dialogue' == sub[i].class | |
dialogStart = i | |
break | |
if -1 == dialogStart | |
log.windowError( "This script does not appear to have any dialogue lines." ) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
fuckWindows = ( logString ) -> | |
ffi.cdef [[int WideCharToMultiByte( unsigned int, unsigned int, const char*, int, char*, int, void*, void* );]] | |
CP_UTF8 = 65001 | |
logLength = math.ceil #logString/2 | |
buffSize = 1 + ffi.C.WideCharToMultiByte CP_UTF8, 0, logString, logLength, nil, 0, nil, nil | |
if 0 == buffSize | |
error "Shit's fucked i aint helping." | |
utf8String = ffi.new "char[?]", buffSize | |
status = ffi.C.WideCharToMultiByte CP_UTF8, 0, logString, logLength, utf8String, buffSize, nil, nil |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python3 | |
import os, sys | |
import vapoursynth as vs | |
def progress( current_frame, total_frames ): | |
print( "\rProgress: {0}/{1}".format( current_frame, total_frames ), file=sys.stderr, end='' ) | |
core = vs.get_core( ) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff -r 514640c6cbd8 Makefile | |
--- a/Makefile Sat Apr 12 16:59:09 2014 -0700 | |
+++ b/Makefile Mon Apr 14 23:35:03 2014 -0700 | |
@@ -2,13 +2,19 @@ | |
# Override the default compiler with `make CXX=g++` or so | |
# Build on *nix with `make EXE=` | |
WARNINGS := -pedantic -Wall | |
+CC := clang | |
CXX := clang++ | |
-CXXFLAGS := $(WARNINGS) -std=c++11 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/wscript b/wscript | |
index 0ef4fc3..b5db61a 100644 | |
--- a/wscript | |
+++ b/wscript | |
@@ -71,13 +71,13 @@ def configure_gcc(conf): | |
add_options(["CFLAGS", "CXXFLAGS"], | |
["-fPIC", "-Wall", "-Wextra", "-Wno-unused-parameter", | |
"-fvisibility=hidden", "-fvisibility-inlines-hidden", | |
- "-Werror", "-std=c++11"]) | |
+ "-std=c++11"]) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Copyright (c) 2013, Martin Herkt | |
# | |
# Permission to use, copy, modify, and/or distribute this software for any | |
# purpose with or without fee is hereby granted, provided that the above | |
# copyright notice and this permission notice appear in all copies. | |
# | |
# THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH | |
# REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY | |
# AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, | |
# INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env ruby | |
# usage: stripiT.rb file1.m4a file2.m4a file3.m4a | |
# automatically outputs to file1 - stripped.m4a, file2 - stripped.m4a, and so on. | |
# Script to remove extraneous/unwanted atoms from iTunes purchased files by way of AtomicParsley. | |
# Output should be comparable to the atoms left over after reencoding the file in iTunes itself. | |
# I only care about songs, so I have no clue how well this applies to video files | |
# Some information taken from: https://code.google.com/p/mp4v2/wiki/iTunesMetadata |
NewerOlder