Skip to content

Instantly share code, notes, and snippets.

💎
200 OK

Dai Okabayashi bayashi

💎
200 OK
View GitHub Profile
@bayashi
bayashi / DeepL_ja-en.js
Last active Jun 17, 2020
DeepL JA-EN bookmarklet
View DeepL_ja-en.js
javascript:(function(){Q=''+(window.getSelection?window.getSelection():document.getSelection?document.getSelection():document.selection.createRange().text);if(!Q)Q=prompt("Text?","");A=Q.match(/^[\x20-\x7e\s\r\n\t]+$/)?'ja/en/':'en/ja/';if(Q)open('https://www.deepl.com/translator#'+A+encodeURIComponent(Q),'_blank');})()
@bayashi
bayashi / the_20039_words_which_could_be_com_domain.txt
Created Mar 23, 2020
The 20039 words which could be .com domain
View the_20039_words_which_could_be_com_domain.txt
aaronical
abactinal
abandonedly
abaptiston
abarognosis
abbassid
abdicable
abdominocyesis
abdominocystic
abdominogenital
@bayashi
bayashi / the_words_which_could_be_com_domain.txt
Created Mar 21, 2020
The words which could be .com domain
View the_words_which_could_be_com_domain.txt
aboriginalise
acanthaster
accusatival
accusatorial
aciculate
acidophilic
aconitine
acusector
acoustoelectronics
acoustooptics
View Function-Return.diff
diff --git a/lib/Function/Return.pm b/lib/Function/Return.pm
index 59398bc..85e0117 100644
--- a/lib/Function/Return.pm
+++ b/lib/Function/Return.pm
@@ -12,6 +12,8 @@ use Scalar::Util ();
use Scope::Upper ();
use Function::Parameters;
+our $DID_CHECK;
+
@bayashi
bayashi / mylog
Created May 2, 2019
Invoke this from .bashrc for daily log
View mylog
#!/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 Dec 31, 2018
firefox userChrome.css
View 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 Feb 2, 2018
vertical explain table for DBIx::QueryLog
View gist:9e57147e49c0c6e595cbb39cb56c538e
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}) {
View test_slide.md

test だよ


ほげ

ふが

hoge

@bayashi
bayashi / gist:5dbee33e65d5c7e58fa6
Created Aug 21, 2015
YAPC::Asia 2015 Busy Rate
View gist:5dbee33e65d5c7e58fa6
$ perl -MLWP::Simple=get -we 'my %r=(a=>1000, b=>100, c=>120, d=>288, e=>288); for my $room (sort keys %r){ my ($count) = (get("http://api.conbu.net/v1/associations/track_$room") =~ m!:(\d+)!); printf("track".uc($room).": %.2f%%\t%04d/%04d\n", $count/$r{$room}*100, $count, $r{$room}); }'
trackA: 44.60% 0446/1000
trackB: 136.00% 0136/0100
trackC: 66.67% 0080/0120
trackD: 75.35% 0217/0288
trackE: 68.40% 0197/0288
@bayashi
bayashi / build_placeholder.pl
Last active Aug 29, 2015
benchmark of building place holder
View build_placeholder.pl
#!/usr/bin/env perl
use strict;
use warnings;
use Benchmarks sub {
my @list = (1..10);
+{
map_join => sub {
join(',', map { '?' } @list);
You can’t perform that action at this time.