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
// with input as query | |
function run() { | |
const id = "<note-id>"; | |
const app = Application.currentApplication(); | |
app.includeStandardAdditions = true; | |
const d = new Date(); | |
const time = `${d.getFullYear()}/${d.getMonth() + 1}/${d.getDate()} ${d.getHours()}:${d.getMinutes()}`; | |
const text = `{query}\n${time}\n----`; |
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
import { useReducer, useCallback, useRef, useLayoutEffect } from "react"; | |
type Thunk<S, A = any> = ( | |
dispatch: ThunkDispatch<S, A>, | |
getState: () => S | |
) => void; | |
type ThunkDispatch<S, A> = (action: A | Thunk<S, A>) => void; | |
const isThunk = <S, A>(e: any): e is Thunk<S, A> => { |
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
// ==UserScript== | |
// @name [GoogleTranslate] Fix balloon styles | |
// @namespace https://gist.github.com/tkrkt | |
// @include http://translate.googleusercontent.com/* | |
// @version 1 | |
// @grant none | |
// ==/UserScript== | |
const style = document.createElement("style"); | |
style.textContent = ` |
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
// ==UserScript== | |
// @name [QiitaDeck] Gray visited links | |
// @description Gray visited links | |
// @namespace https://gist.github.com/tkrkt | |
// @version 1 | |
// @author tkrkt | |
// @match https://qiitadeck.com/* | |
// @grant none | |
// ==/UserScript== |
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
// ==UserScript== | |
// @name [tabelog] Add to Google Calendar | |
// @namespace https://gist.github.com/tkrkt | |
// @description Add current shop to Google Calendar from send link (need to fix start/end date) | |
// @version 1 | |
// @match https://tabelog.com/* | |
// @grant none | |
// ==/UserScript== | |
const descArea = document.querySelector('.js-rst-info.infosend__textarea'); |
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
{ | |
"global": { | |
"check_for_updates_on_startup": true, | |
"show_in_menu_bar": true, | |
"show_profile_name_in_menu_bar": false | |
}, | |
"profiles": [ | |
{ | |
"complex_modifications": { | |
"parameters": { |
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
// 使い方: | |
// 1. 全部コピーする (右上の Raw をクリックした先でやるのが楽) | |
// 2. Amazon の注文履歴ページ ( https://www.amazon.co.jp/gp/css/order-history/ ) を開く | |
// 3. F12 または 右クリ→要素の検証 とかで出てくる開発者ツールのコンソール (JavaScript REPL) にペースト | |
// 4. エンターで実行 | |
// | |
// format: | |
// type outputJSON = Array<{ | |
// product: string; // ファイル名 | |
// href: string; // 商品ページURL |
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
// ==UserScript== | |
// @name [Qiita] word-break normal | |
// @namespace https://gist.github.com/tkrkt | |
// @version 1 | |
// @author tkrkt | |
// @match https://qiita.com/* | |
// @grant none | |
// ==/UserScript== | |
const style = document.createElement('style'); |
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
// Use an A tag | |
// Firefox: OK, Chrome: NG | |
// Waiting with setTimeout is dirty | |
const downloadWithATag = (filename, text) => { | |
const blob = new Blob([text], {type: 'text/plain;charset=utf-8'}); | |
const url = URL.createObjectURL(blob); | |
const a = document.createElement('a'); | |
a.href = url; |
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
import java.util.HashMap; | |
public class NumberMap { | |
HashMap<String, Number> map = new HashMap<>(); | |
public void put(String key, Number value) { | |
if (value instanceof Double | |
|| value instanceof Float | |
|| value instanceof Integer | |
|| value instanceof Long |
NewerOlder