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 / addTimeToGoogle.user.js
Created June 13, 2017 21:44
Add current date and time to Google search result page
// ==UserScript==
// @name Add current time to google
// @namespace gsDateTime
// @include https://www.google.com/search*
// @include http://www.google.com/search*
// @version 0.1
// @grant GM_addStyle
// ==/UserScript==
GM_addStyle("\
@chyiz
chyiz / mail.xml
Last active October 21, 2015 02:09
qq mail xss
<?xml version="1.0" encoding="utf-8" ?>
<rss version="2.0">
<channel>
<title>aa<![CDATA[aaa\"aaa]]>aBEFIaaaaaa</title>
<link>bbbbbbbbbbb</link>
<description>ccccccccccccc</description>
<language>zh</language>
<image>
<title>ddddddddd</title>
@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")}