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 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}"/>
@tateisu
tateisu / deletePosts.md
Last active Feb 24, 2019
Removing local copies of unreferenced external posts
View deletePosts.md

Removing local copies of unreferenced external posts

日本語 => https://gist.github.com/tateisu/3d98290f2b72d12ba5f1b977a0d5743c

Summary

SQL exapmle that deletes local copies of external posts flowing from the FTL or relays and that are not referenced long time by local users.

Note: It is "reduction" of data increase , not "to be able to operate infinitely with a fixed disk capacity".

@tateisu
tateisu / gist:3d98290f2b72d12ba5f1b977a0d5743c
Last active Feb 24, 2019
使われてない古い投稿の削除
View gist:3d98290f2b72d12ba5f1b977a0d5743c

使われてない古い投稿の削除

English => https://gist.github.com/tateisu/c3c13f2580961e86f79889a17f57260a

背景

  • マストドンのインスタンスを運営していると、記録データが年々蓄積されていく。
  • 自分のインスタンスならローカルユーザ自身の投稿やローカルユーザが興味をもった外部の投稿を記録し続けないといけないのは理解できる。
  • しかし外部タンスの投稿について「もはやフォローされてない外部ユーザの投稿」「リレーで無条件に流れてくる外部ユーザの投稿」をもずっと記録し続ける理由はない。
  • 古い不要な投稿データを削除することで、記録データの増加を軽減できるのではないだろうか。サーバ維持費の増加を抑えられる。
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
View gist:3e50a8c391c0119372ac9e46692a7fbc
error: # Phoenix.Router.NoRouteError at DELETE /api/v1/push/subscription Exception: ** (Phoenix.Router.NoRouteError) no route found for DELETE /api/v1/push/subscription (Pleroma.Web.Router) (pleroma) lib/pleroma/web/router.ex:1: Pleroma.Web.Router.__match_route__/4 (pleroma) lib/phoenix/router.ex:307: Pleroma.Web.Router.call/2 (pleroma) lib/pleroma/web/endpoint.ex:1: Pleroma.Web.Endpoint.plug_builder_call/2 (pleroma) lib/plug/debugger.ex:122: Pleroma.Web.Endpoint."call (overridable 3)"/2 (pleroma) lib/pleroma/web/endpoint.ex:1: Pleroma.Web.Endpoint.call/2 (plug) lib/plug/adapters/cowboy/handler.ex:16: Plug.Adapters.Cowboy.Handler.upgrade/4 ## Connection details ### Params %{} ### Request info * URI: http://pleroma.soykaf.com:80/api/v1/push/subscription * Query string: ### Headers * accept-encoding: gzip * authorization: Bearer Q_hHL6RJ2QoudqIJCIHaOCkWAvc0ePYBQ64UIVzAyhs= * connection: upgrade * content-length: 0 * host: pleroma.soykaf.com * user-agent: SweetTubuan/0.1.1 ### Session nil (HTTP 404) pleroma.soyk
View gist:42a0b9e2b823a46e8758530639a1d785
LGT32
Subway Tooter 3.0.5
11-19 02:15:08.967 17449-17449/jp.juggler.subwaytooter E/AndroidRuntime: FATAL EXCEPTION: main
Process: jp.juggler.subwaytooter, PID: 17449
android.app.RemoteServiceException: Bad notification posted from package jp.juggler.subwaytooter: Couldn't expand RemoteViews for: StatusBarNotification(pkg=jp.juggler.subwaytooter user=UserHandle{0} id=1 tag=49 key=0|jp.juggler.subwaytooter|1|49|10253: Notification(pri=0 contentView=null vibrate=default sound=default defaults=0x7 flags=0x11 color=0xff5a5a5a backgroundColor=0x00000000 groupKey=jp.juggler.subwaytooter:tateisu@misskey.xyz vis=PRIVATE))
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1699)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:154)
at android.app.ActivityThread.main(ActivityThread.java:6316)
You can’t perform that action at this time.