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
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
View gist:f3a3fe6bfa854ff02b61cdd76abc63e5
ActivityPubでタイムラインを見るまで
#################################################
GET /.well-known/host-meta
that defined in RFC6415 'Web Host Metadata'
応答例
<?xml version="1.0" encoding="UTF-8"?>
<XRD xmlns="http://docs.oasis-open.org/ns/xri/xrd-1.0">
<Link rel="lrdd" type="application/xrd+xml" template="https://mastodon.juggler.jp/.well-known/webfinger?resource={uri}"/>
View InstanceTicker.kt
init{
this.instance = cols[2]
if( cols[5].isEmpty() ){
// typeのデフォルト画像
this.image = type.imageUrl
this.imageWidth = type.imageWidth
}else{
// 独自画像
View gist:c1410a929f1db117e95d20942a7dfb17
enum class Type(
val num : Int,
val imageUrl : String,
val imageWidth : Int,
val colorText:Int,
val colorBg : IntArray
) {
GnuSocial(
0,
View gist:7b9fcadd7fe90acdb1444cd867753187
間違った例。1 はlang指定になるので表示されない
```1
2
3
```
間違った例。 1行目末尾はlang指定と解釈されて、まだ閉じてない。
またコードブロック内部の始端と終端にそれぞれ改行文字が必要なので、2行目でも閉じない。
```code```
```
@tateisu
tateisu / matcher-region.kt
Created Nov 23, 2018
small example of using Matcher.region
View matcher-region.kt
// small example of using Matcher.region
val text = "ABC*DEF*(GHI)*JKL*"
val matchers = arrayOf(
Pattern.compile("""^\*.+?\*""").matcher(text),
Pattern.compile("""\A\(.+?\)""").matcher(text)
)
matchers.forEach { it.useAnchoringBounds(true) }
fun <T, V> Array<out T>.firstNonNull(predicate: (T) -> V?): V? {
for (element in this) return predicate(element) ?: continue
You can’t perform that action at this time.