Skip to content

Instantly share code, notes, and snippets.

tateisu tateisu

Block or report user

Report or block tateisu

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@tateisu
tateisu / Test1.kt
Last active Dec 29, 2019
Is Kotlin's T?.apply{...} slow?
View Test1.kt
class Holder : HashMap<String, String>()
class PrefKey(private val key: String) {
fun put(holder: Holder, value: String) {
holder[key] = value
}
}
fun Holder.putA(pref: PrefKey, value: String): Holder {
pref.put(this, value)
@tateisu
tateisu / gist:ace566d915ea00ba9805a9efdc8b822a
Created Dec 1, 2019
某オーディション予選の結果
View gist:ace566d915ea00ba9805a9efdc8b822a
713048 #0218
654458 #0226
603011 #0125
585600 #0258
564329 #0146
518195 #0455
471647 #0433
394413 #0113
365425 #0109
352889 #0138
View gist:0286a760e0f1ece355acb11d041b53d9
sidekiq_default_1 | 2019-11-24T05:32:22.001Z 6 TID-or5efaspi WARN: Seahorse::Client::NetworkingError: Net::OpenTimeout
sidekiq_default_1 | 2019-11-24T05:32:22.001Z 6 TID-or5efaspi WARN: /opt/ruby/lib/ruby/2.6.0/net/protocol.rb:41:in `ssl_socket_connect'
sidekiq_default_1 | /opt/ruby/lib/ruby/2.6.0/net/http.rb:996:in `connect'
sidekiq_default_1 | /opt/mastodon/vendor/bundle/ruby/2.6.0/gems/httplog-1.3.2/lib/httplog/adapters/net_http.rb:36:in `connect'
sidekiq_default_1 | /opt/ruby/lib/ruby/2.6.0/net/http.rb:930:in `do_start'
sidekiq_default_1 | /opt/ruby/lib/ruby/2.6.0/net/http.rb:925:in `start'
sidekiq_default_1 | /opt/ruby/lib/ruby/2.6.0/delegate.rb:83:in `method_missing'
sidekiq_default_1 | /opt/mastodon/vendor/bundle/ruby/2.6.0/gems/aws-sdk-core-3.65.1/lib/seahorse/client/net_http/connection_pool.rb:297:in `start_session'
sidekiq_default_1 | /opt/mastodon/vendor/bundle/ruby/2.6.0/gems/aws-sdk-core-3.65.1/lib/seahorse/client/net_http/connection_pool.rb:96:in `session_for'
sidekiq_default_1 | /opt/
View gist:69caba4178e56e29308091b365e89415
postgres=# select domain,username,display_name from accounts where display_name ilike '%rssfeed%' order by domain,username;
domain | username | display_name
-----------------------+----------------+---------------------------------
chaosphere.hostdon.jp | 4gamer | 4Gamer.net(RSSfeed)
chaosphere.hostdon.jp | all_about | All About(RSSfeed)
chaosphere.hostdon.jp | animeanime | アニメ!アニメ!(RSSfeed)
chaosphere.hostdon.jp | atmarkit | @IT(RSSfeed)
chaosphere.hostdon.jp | automaton | AUTOMATON(RSSfeed)
chaosphere.hostdon.jp | bizjournal | ビジネスジャーナル(RSSfeed)
chaosphere.hostdon.jp | bunshun | 文春オンライン(RSSfeed)
View gist:65316c8547555151534581de72766b2c
Allan Nordhøy epost@anotheragency.no Translated using Weblate (English)
Allan Nordhøy epost@anotheragency.no Translated using Weblate (Norwegian Bokmål)
ButterflyOfFire ButterflyOfFire@protonmail.com Translated using Weblate (Arabic)
ButterflyOfFire ButterflyOfFire@protonmail.com Translated using Weblate (French)
Ch ccwpc@hanmail.net Translated using Weblate (Korean)
Elizabeth Sherrock lizzyd710@gmail.com Translated using Weblate (Chinese (Simplified))
Gennady Archangorodsky gen2002@gmail.com Translated using Weblate (Hebrew)
inqbs Siina incubass64@gmail.com Translated using Weblate (Korean)
Jeong Arm kjwonmail@gmail.com Translated using Weblate (Korean)
Kai Zhang kai.zhangxa@gmail.com Translated using Weblate (Chinese (Simplified))
View gist:9e31c50ad07c34487c4c92ec5448f578
["2019-10-13 22:58:19 +0900,twittersupport,mastodon.social",
"2019-10-14 20:50:46 +0900,Noshigo,mastodon.social",
"2019-10-15 09:06:07 +0900,darkmagepr,mastodon.social",
"2019-10-17 18:50:41 +0900,clad_ask,mastodon.social",
"2019-10-18 00:31:35 +0900,DocTwo,mastodon.social",
"2019-10-18 18:47:04 +0900,vemus,mastodon.social",
"2019-10-19 12:48:15 +0900,teamvass,mastodon.social",
"2019-10-22 20:25:54 +0900,moritz,mastodon.social",
"2019-10-24 04:10:37 +0900,Unknown283,mastodon.social",
"2019-10-25 15:23:05 +0900,ruimou,mastodon.social",
View print.sh
#!/bin/ash
echo "count=$#, 1=$1, 2=$2"
View removeSpam2.pl
#!/usr/bin/perl --
# プロフィールの表のの中のURLのホスト名のIPアドレスが特定の値ならサスペンドします。
# usage:
# export PSQL="docker exec mastodon1_db_backend_1 psql -U user database"
# export RAILS_CONSOLE=""docker-compose run --rm web bundle exec rails console"
# perl removeSpam2.pl --userDomain=mastodon.social 185.117.119.170
use strict;
@tateisu
tateisu / checkRetry.pl
Last active Oct 28, 2019
check sidekiq retry
View checkRetry.pl
#!/usr/bin/perl
use strict;
use warnings;
use JSON::XS;
use Data::Dump qw(dump);
open(my $fh,"-|","docker exec mastodon1_redis_1 redis-cli zrange retry 0 -1")
or die "can't open redis-cli. $!";
View gist:647f9149ad6e2bf54dc4a369b5d6c6b4
select count(*) as c,domain from accounts
where exists(select from follows left join accounts as a2 on a2.id=follows.account_id
where a2.domain is null and target_account_id=accounts.id)
group by domain order by c desc limit 100;
c | domain
------+-------------------------------
1476 | pawoo.net
1186 | mstdn.jp
396 |
You can’t perform that action at this time.