Skip to content

Instantly share code, notes, and snippets.

@chyiz
chyiz / tab-close-on-left.css
Last active February 12, 2020 21:49 — forked from valrus/userChrome.css
Favicons on the left with hover for close button, last tested in Firefox 74
/*
* Move the favicon, throbber, and label to the right so that the close button appears on the left
* Adapted from https://gist.github.com/bramus/724503 & https://gist.github.com/valrus/ccacaf0990d3b76d61adae65ed91d315
*
*/
/* */
/* Hide the close button initially */
.tabbrowser-tab .tab-icon-pending {
display: none !important;
}
# This script may use ~8 MiB Memory, it is fast and safe
def find_IP(dns_ser, domain, timeout = 2):
import dns.resolver, sys
try:
T = dns.resolver.Resolver(); T.nameservers = [dns_ser, ]; T.timeout = T.lifetime = timeout
answers = T.query(domain, raise_on_no_answer=False)
return [rdata for rdata in answers]
except Exception as e:
if e.__class__.__base__ == dns.exception.DNSException:
@chyiz
chyiz / autosub.lua
Last active August 29, 2015 14:19 — forked from selsta/autosub.lua
-- default keybinding: b
-- add the following to your input.conf to change the default keybinding:
-- keyname script_binding auto_load_subs
local utils = require 'mp.utils'
function load_sub_fn()
subl = "/usr/local/bin/subliminal" -- use 'which subliminal' to find the path
mp.msg.info("Searching subtitle")
mp.osd_message("Searching subtitle")
t = {}
t.args = {subl, "-q", "-s", "-l", "en", "--", mp.get_property("path")}