Skip to content

Instantly share code, notes, and snippets.

@tateisu
tateisu / timecalc.pl
Last active Mar 26, 2019
雑な時間計算機
View timecalc.pl
#!/usr/bin/perl --
use strict;
use warnings;
use feature qw(switch say);
use Math::BigFloat;
use Term::ReadLine;
use Getopt::Long;
# usage: ./timecalc.pl -v "9h15m + 10m - 20m * ( 0.5h / 15m ) * 0.5"
@tateisu
tateisu / gist:5d1db89783dd2607a7a7a7d98f25a1c8
Last active Mar 23, 2019
my app can get /users/@me/guilds, but can't get /guilds/{id}/channels . why?
View gist:5d1db89783dd2607a7a7a7d98f25a1c8
my app can get /users/@me/guilds, but can't get /guilds/{id}/channels . why?
----------------------------------------
log
$ perl testApp1.pl
apiGet https://discordapp.com/api/v6/users/@me/guilds
[{"owner": false, "permissions": 104324161, "icon": "423a112cd4b14ba6105051dcae0b7880", "id": "231908446830723072", "name": "joinmastodon.org"}, {"owner": false, "permissions": 104324161, "icon": null, "id": "305703658107043850", "name": "mastodon-jp"}, ...]
View gist:b9df6657960ab76666d823923fc87e4b
web_1 | [5db0aa14-ef8d-40e3-b9e9-e91f261cbac3] Rendering stream_entries/show.html.haml within layouts/public
web_1 | [5db0aa14-ef8d-40e3-b9e9-e91f261cbac3] Rendered stream_entries/_og_description.html.haml (3.2ms)
web_1 | [5db0aa14-ef8d-40e3-b9e9-e91f261cbac3] Rendered stream_entries/_og_image.html.haml (1.3ms)
web_1 | [5db0aa14-ef8d-40e3-b9e9-e91f261cbac3] Rendered stream_entries/_poll.html.haml (2.2ms)
web_1 | [5db0aa14-ef8d-40e3-b9e9-e91f261cbac3] Rendered stream_entries/_detailed_status.html.haml (17.5ms)
web_1 | [5db0aa14-ef8d-40e3-b9e9-e91f261cbac3] Rendered stream_entries/_status.html.haml (18.2ms)
web_1 | [5db0aa14-ef8d-40e3-b9e9-e91f261cbac3] Rendered stream_entries/show.html.haml within layouts/public (36.9ms)
web_1 | [5db0aa14-ef8d-40e3-b9e9-e91f261cbac3] method=GET path=/@tateisu/101695324967335706 format=html controller=StatusesController action=show status=500 error='ActionView::Template::Error: undefined method `account' for
View gist:d47dd733cba989adc138f1827236f709
> Task :apng:compileKotlin FAILED
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':apng:compileKotlin'.
> java.io.IOException: アクセスが拒否されました。
* Try:
Run with --info or --debug option to get more log output. Run with --scan to get full insights.
@tateisu
tateisu / gist:026dfb95a029484aed07d149743a6a63
Last active Jan 23, 2019
docker環境でのpostgreSQL 9.6 => 11 へのアップグレード
View gist:026dfb95a029484aed07d149743a6a63
# docker環境でのpostgreSQL 9.6 => 11 へのアップグレード
# https://github.com/tianon/docker-postgres-upgrade を利用する
# リポジトリに (OLD)-to-(NEW) のフォルダがあるか事前に確認しておく
# (今回の場合は 9.6-to-11 )
#################################
# 作業フォルダの作成
mkdir postgres-upgrade-2 && cd postgres-upgrade-2
mkdir -p postgresql/9.6/data postgresql/11/data
View gist:e8ae30f84e21d4423c1439d5677c5da7
+ docker-compose up -d
mastodon1_db_backend_1 is up-to-date
mastodon1_redis_1 is up-to-date
mastodon1_db_1 is up-to-date
Creating mastodon1_sidekiq_push_1
Creating mastodon1_web_1
Creating mastodon1_sidekiq_pull_1
Creating mastodon1_sidekiq_default_1
Creating mastodon1_streaming_1
@tateisu
tateisu / gist:615e807f108f2ef3765f65bdef9e7216
Created Jan 6, 2019
posting scheduled status with media raises error
View gist:615e807f108f2ef3765f65bdef9e7216
web_1 | [ec0d83d0-1b67-4492-9a82-399a665911d6] NameError (undefined local variable or method `media' for #<PostStatusService:0x0000563a60bc8a68>):
web_1 | [ec0d83d0-1b67-4492-9a82-399a665911d6]
web_1 | [ec0d83d0-1b67-4492-9a82-399a665911d6] app/services/post_status_service.rb:93:in `validate_media!'
web_1 | [ec0d83d0-1b67-4492-9a82-399a665911d6] app/services/post_status_service.rb:28:in `call'
web_1 | [ec0d83d0-1b67-4492-9a82-399a665911d6] app/controllers/api/v1/statuses_controller.rb:47:in `create'
View gist:38d480c317e11dc6b1717fa7f014d36b
GET /api/v1/scheduled_statuses does not contains what status will be post.
[{"id":"5","scheduled_at":"2019-01-06T07:27:00.000Z","media_attachments":[]},{"id":"4","scheduled_at":"2019-01-06T07:22:00.000Z","media_attachments":[]},{"id":"3","scheduled_at":"2019-01-06T07:08:00.000Z","media_attachments":[]},{"id":"2","scheduled_at":"2019-01-06T07:08:00.000Z","media_attachments":[]},{"id":"1","scheduled_at":"2019-01-06T07:06:00.000Z","media_attachments":[]}]
View gist:a6f400d8096da41b8db781fc46d2471c
sidekiq_1 | 2019-01-06T07:13:59.701Z 9 TID-gtdyd0mq1 PublishScheduledStatusWorker JID-44c96f3cab61290348ef1d92 INFO: fail: 0.002 sec
sidekiq_1 | 2019-01-06T07:13:59.701Z 9 TID-gtdyd0mq1 WARN: {"context":"Job raised exception","job":{"class":"PublishScheduledStatusWorker","args":[],"retry":true,"queue":"default","jid":"44c96f3cab61290348ef1d92","created_at":1546758669.5828445,"enqueued_at":1546758839.6985576,"error_message":"wrong number of arguments (given 0, expected 1)","error_class":"ArgumentError","failed_at":1546758669.5862696,"retry_count":2,"retried_at":1546758764.0457783},"jobstr":"{\"class\":\"PublishScheduledStatusWorker\",\"args\":[],\"retry\":true,\"queue\":\"default\",\"jid\":\"44c96f3cab61290348ef1d92\",\"created_at\":1546758669.5828445,\"enqueued_at\":1546758839.6985576,\"error_message\":\"wrong number of arguments (given 0, expected 1)\",\"error_class\":\"ArgumentError\",\"failed_at\":1546758669.5862696,\"retry_count\":2,\"retried_at\":1546758764.0457783}"}
sidekiq_1 | 2019-01-06T07:1
View TestMisskeyApi log
C:\Java\jdk-x64-1.8\bin\java.exe "-javaagent:C:\Program Files\JetBrains\IntelliJ IDEA Community Edition 2018.2.5\lib\idea_rt.jar=57948:C:\Program Files\JetBrains\IntelliJ IDEA Community Edition 2018.2.5\bin" -Dfile.encoding=UTF-8 -classpath C:\Java\jdk-x64-1.8\jre\lib\charsets.jar;C:\Java\jdk-x64-1.8\jre\lib\deploy.jar;C:\Java\jdk-x64-1.8\jre\lib\javaws.jar;C:\Java\jdk-x64-1.8\jre\lib\jce.jar;C:\Java\jdk-x64-1.8\jre\lib\jfr.jar;C:\Java\jdk-x64-1.8\jre\lib\jfxswt.jar;C:\Java\jdk-x64-1.8\jre\lib\jsse.jar;C:\Java\jdk-x64-1.8\jre\lib\management-agent.jar;C:\Java\jdk-x64-1.8\jre\lib\plugin.jar;C:\Java\jdk-x64-1.8\jre\lib\resources.jar;C:\Java\jdk-x64-1.8\jre\lib\rt.jar;C:\Java\jdk-x64-1.8\jre\lib\ext\access-bridge-64.jar;C:\Java\jdk-x64-1.8\jre\lib\ext\cldrdata.jar;C:\Java\jdk-x64-1.8\jre\lib\ext\dnsns.jar;C:\Java\jdk-x64-1.8\jre\lib\ext\jaccess.jar;C:\Java\jdk-x64-1.8\jre\lib\ext\jfxrt.jar;C:\Java\jdk-x64-1.8\jre\lib\ext\localedata.jar;C:\Java\jdk-x64-1.8\jre\lib\ext\nashorn.jar;C:\Java\jdk-x64-1.8\jre\lib\ext\su
You can’t perform that action at this time.