Skip to content

Instantly share code, notes, and snippets.

// ==UserScript==
// @name Remove YouTube Number Hotkeys
// @match https://www.youtube.com/watch
// @run-at document-end
// ==/UserScript==
document.addEventListener('keydown', (event) => {
if (event.target.id === 'movie_player' &&
["1", "2", "3", "4", "5", "6", "7", "8", "9"].includes(event.key)) {
event.stopPropagation();
#!/usr/bin/env python3
# Reference:
# https://github.com/r45635/HVAC-IR-Control/blob/master/Protocol/Panasonic%20HVAC%20IR%20Protocol%20specification.pdf
import argparse
import enum
import pathlib
import subprocess
import sys
// ==UserScript==
// @name Google Classic Search Results
// @version 0.0
// @author Shota Nozaki
// @match https://www.google.com/search*
// @match https://www.google.co.jp/search*
// @run-at document-start
// ==/UserScript==
(function() {
@emonkak
emonkak / pdf2jpg.bat
Last active October 28, 2019 10:33
pdf2jpg
@echo off
powershell -NoProfile -ExecutionPolicy Unrestricted .\pdf2jpg.ps1
echo Done.
pause > nul
@emonkak
emonkak / Sql.hs
Created September 2, 2019 16:48
Sql.hs
{-# LANGUAGE FlexibleInstances, OverloadedLists, OverloadedStrings, TypeFamilies #-}
import Data.Monoid
import Data.String
import GHC.Exts
data Sql = Sql (DiffList Char) (DiffList SqlBinding)
deriving (Show)
data SqlBinding = SqlString String
@emonkak
emonkak / pf.conf
Created May 14, 2019 16:28
pf.conf
block in inet6 all
pass in quick on lo0 inet6 all
pass in quick inet6 proto icmp6 all
pass out inet6 all keep state
@emonkak
emonkak / google-translate
Last active January 20, 2019 10:55
google-translate
#!/usr/bin/python3
#
# Google Translate command-line tool
#
# Usage:
# google-translate [-s SRC_LANG] [-d DEST_LANG] [TEXT]
import argparse
import json
import sys
@emonkak
emonkak / StatefulComponent.ts
Last active December 19, 2018 06:52
StatefulComponent.ts
import { TemplateResult, render } from 'lit-html';
import { PropTypes } from './propTypes';
interface StatefulComponentClass<TProps, TState> {
new(): StatefulComponent<TProps, TState>;
defaultProps: Partial<TProps>;
getInitialState(props: Readonly<TProps>): TState;
observedAttributes: string[];
propTypes: PropTypes<TProps>;
@emonkak
emonkak / RedBlackTree.ts
Last active December 18, 2017 05:45
RedBlackTree.ts
type RedBlackTree<T> = RedBlackTreeNode<T> | RedBlackTreeLeaf;
interface RedBlackTreeNode<T> {
left: RedBlackTree<T>;
right: RedBlackTree<T>;
color: Color;
value: T;
}
type RedBlackTreeLeaf = null;
@emonkak
emonkak / conky-1.10.6-mixer-device.patch
Created June 15, 2017 05:17
conky-1.10.6-mixer-device.patch
diff --git a/src/mixer.cc b/src/mixer.cc
index d888ff81..a72f39cf 100644
--- a/src/mixer.cc
+++ b/src/mixer.cc
@@ -48,12 +48,10 @@
#endif /* __OpenBSD__ */
#endif /* HAVE_LINUX_SOUNDCARD_H */
-#define MIXER_DEV "/dev/mixer"
-