Skip to content

Instantly share code, notes, and snippets.

@8q
8q / .fdignore
Last active September 23, 2022 16:51
fzf ~/.fdignore
/Applications/
/Library/
/.Trash/
/.gradle/
/.cache/
/.nodebrew/
/.npm/
/.pyenv/
/go/
<!DOCTYPE html>
<!-- Let's view the HTML source code of this page!! -->
<!-- Or save this text as HTML source code :) -->
<html>
<head>
<meta charset="utf-8"/>
<title>Quine</title>
<link href="https://fonts.googleapis.com/css?family=Source+Code+Pro&display=swap" rel="stylesheet">
</head>
<body>
on open location url_scheme
(*デリミタで文字列抽出*)
set AppleScript's text item delimiters to {"vlc://"}
set txt_items to text items of url_scheme
set AppleScript's text item delimiters to {""}
set scheme_txt to txt_items as Unicode text
do shell script ({"/Applications/VLC.app/Contents/MacOS/VLC ", scheme_txt} as string)
end open location
@8q
8q / open-vlc.bat
Created February 8, 2020 17:10
VLCスキーム(Win)
set vlcdata=%1
start "" "C:\Program Files\VideoLAN\VLC\vlc.exe" "%vlcdata:~7%"
@8q
8q / tweetdeck.js
Last active December 8, 2019 20:35
(() => {
const texts = [
"俺の勝ち。",
"俺の勝ちだが?",
"お前の負け。",
"お前の負けだが?",
"I win.",
"You lose."
]
@8q
8q / decompose.js
Last active October 31, 2019 08:04
置換->互換の積
// function decompose(l, i) {
// if (i < l.length) {
// var j = l[i]
// if (i === j) {
// return decompose(l, i + 1)
// } else {
// [l[i], l[j]] = [l[j], l[i]]
// return [[i, j]].concat(decompose(l, i + 1))
// }
// } else {
@8q
8q / danime.js
Created October 11, 2019 16:35
dアニメストア10倍速
var speed=10,e=document.querySelector('#speed>.w1');e.setAttribute('data-value', speed);e.click()
@8q
8q / batch.sh
Created July 21, 2019 03:39
m2ts -> mp4バッチ
#!/bin/bash
if [ $# -lt 1 ]; then
echo 'Usage: $ ./batch.sh input_dir'
exit 1
fi
find $1 -type f |
grep -E "\.m2ts$" |
sed 's/\.m2ts$//g' |
@8q
8q / norikae.sh
Last active July 3, 2019 10:11
$EKISPERT_KEY=駅すぱあとAPIのキー norikae 搭乗駅 降車駅 (出発時間:HHMM) ex)$norikae 新宿 大宮 1900
#!/bin/bash
if [ -z "$EKISPERT_KEY" ]; then
echo '$EKISPERT_KEY not set'
exit 1
fi
if [ $# -lt 2 ]; then
echo 'Usage: norikae from_station to_station (search_time:HHMM)'
exit 1
@8q
8q / dentaku.js
Last active June 4, 2019 06:39
逆ポーランド記法
/**
* Word型
* @typedef {object} Word
* @prop {string} type - ワードの種類
* @prop {number} priority? - ワード(演算子)の優先度(大きいほど高い)
* @prop {number} value? - ワード(数値)の値
*/
/**