Skip to content

Instantly share code, notes, and snippets.

View bayashi's full-sized avatar
💎
OK

bayashi bayashi

💎
OK
View GitHub Profile
@bayashi
bayashi / ai-web-bookmarklet.js
Last active April 12, 2026 00:19
AI Web UIで頻出する操作を便利にするブックマークレット
javascript:void(function(){var L=['US English','UK English','中国語','スペイン語','フランス語','ポルトガル語','ドイツ語','アラビア語','ヒンディー語','トルコ語','インドネシア語','韓国語'];var JP='\n```\n\n上記文章を\n丁寧な表現、カジュアル、技術的の3パターンで ';var SFX=' に翻訳して1クリックでコピーできるようにして';var SVCS={perplexity:{q:'https://www.perplexity.ai/search/new?q=',home:'https://www.perplexity.ai/'},claude:{q:'https://claude.ai/new?q=',home:'https://claude.ai'},chatgpt:{q:'https://chatgpt.com/?prompt=',home:'https://chatgpt.com/'}};var ACTS={ja:'和訳して1クリックでコピーできるようにして',edit:'校正して',sum:'要約して',dia:'図解して',brk:'分解して補足説明して',vfy:'真偽検証して',md:'マークダウン形式に変換して'};function go(t,m){var q;if(m==='raw'){q=t;}else{var H='```\n'+t+'\n```\n\n上記の文章・内容を';q=ACTS[m]?H+ACTS[m]:'```\n'+t+JP+m+SFX;}var s=SVCS[svc.value]||SVCS.perplexity;var w=open(s.q+encodeURIComponent(q),'_blank');if(w)w.focus();}var M=/Mac/i.test(navigator.platform),mod=M?'⌘':'Ctrl',alt=M?'⌥':'Alt';var E=document.createElement.bind(document);var host=E('div');host.style.cssText='position:fixed;top:0;left:0;width:100%;height:100%;z-index:99999';
@bayashi
bayashi / gist:dd002cde2e8d958bd010929ea807d1c3
Last active April 12, 2026 00:19
Build AI prompt bookmarklet
javascript:void(function(){var L=['Spanish','Chinese','French','Portuguese','German','Arabic','Hindi','Turkish','Indonesian','Korean','Japanese'];var TPFX='\n```\n\nTranslate the above text into ';var TSFX=' in 3 patterns — polite, casual, and technical — and make it copyable with one click.';var SVCS={perplexity:{q:'https://www.perplexity.ai/search/new?q=',home:'https://www.perplexity.ai/'},claude:{q:'https://claude.ai/new?q=',home:'https://claude.ai'},chatgpt:{q:'https://chatgpt.com/?prompt=',home:'https://chatgpt.com/'}};var ACTS={en:'English and make it copyable with one click.',edit:'well-polished text',sum:'a summary',dia:'a diagram',brk:'a breakdown with notes',vfy:'a fact check',md:'Markdown'};function go(t,m){var q;if(m==='raw'){q=t;}else{var H='```\n'+t+'\n```\n\nConvert the above text into ';q=ACTS[m]?H+ACTS[m]:'```\n'+t+TPFX+m+TSFX;}var s=SVCS[svc.value]||SVCS.perplexity;var w=open(s.q+encodeURIComponent(q),'_blank');if(w)w.focus();}var M=/Mac/i.test(navigator.platform),mod=M?'⌘':'Ctrl',alt=M?'⌥':
@bayashi
bayashi / irir-config-gotest.yaml
Last active December 31, 2023 00:45
irir-config-gotest.yaml
---
gotest:
- type: prefix
match: "--- PASS"
color: green
target: line
- type: prefix
match: "ok"
color: green
target: line
@bayashi
bayashi / go-tmpl.patch
Last active December 8, 2023 23:19
go-tmpl.patch for Module::Setup flavor
diff --git a/additional/config.yaml b/additional/config.yaml
new file mode 100644
index 0000000..2fbf0ff
--- /dev/null
+++ b/additional/config.yaml
@@ -0,0 +1 @@
+--- {}
diff --git a/config.yaml b/config.yaml
new file mode 100644
index 0000000..3777dd0
@bayashi
bayashi / DeepL_ja-en.js
Last active September 27, 2021 22:39
DeepL JA-EN bookmarklet
javascript:(function(){Q=''+(window.getSelection?window.getSelection():document.getSelection?document.getSelection():document.selection.createRange().text);if(!Q)Q=prompt("Text?","");A=Q.match(/^[a-zA-Z\-\=\"\!\&\.\,\'\s]+$/)?'en/ja/':'ja/en/';if(Q)open('https://www.deepl.com/translator#'+A+encodeURIComponent(Q),'_blank');})()
@bayashi
bayashi / the_20039_words_which_could_be_com_domain.txt
Created March 23, 2020 15:57
The 20039 words which could be .com domain
aaronical
abactinal
abandonedly
abaptiston
abarognosis
abbassid
abdicable
abdominocyesis
abdominocystic
abdominogenital
@bayashi
bayashi / the_words_which_could_be_com_domain.txt
Created March 21, 2020 09:26
The words which could be .com domain
aboriginalise
acanthaster
accusatival
accusatorial
aciculate
acidophilic
aconitine
acusector
acoustoelectronics
acoustooptics
@bayashi
bayashi / mylog
Created May 2, 2019 20:51
Invoke this from .bashrc for daily log
#!/usr/bin/env perl
use strict;
use warnings;
my $SUBLIME = '/Applications/Sublime\ Text.app/Contents/SharedSupport/bin/subl';
my $BASE_PATH = '/path/to/physical_file';
my $SHORTCUT = '/path/to/Desktop/mylog.md';
my ($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) = localtime(time);
$year += 1900;
@bayashi
bayashi / userChrome.css
Created December 31, 2018 23:14
firefox userChrome.css
/* For Mac: ~/Library/Application Support/Firefox/Profiles/FOOBAR.default/chrome/userChrome.css */
/* hide tab bar */
#TabsToolbar { visibility: collapse !important; }
/* hide header of side bar */
#sidebar-header { visibility: collapse; }
/* multiple bookmark toolbar */
#personal-bookmarks {
display: block;
@bayashi
bayashi / gist:9e57147e49c0c6e595cbb39cb56c538e
Created February 2, 2018 12:41
vertical explain table for DBIx::QueryLog
return sub {
my %args = @_;
return $sth->fetchall_arrayref(+{}) unless defined $args{print} and $args{print};
my $t = Text::ASCIITable->new();
$t->setCols('explain', 'result');
$t->alignCol({explain => 'right', result => 'left'});
my @cols = @{$sth->{NAME}};
for my $records (@{$sth->fetchall_arrayref}) {