Skip to content

Instantly share code, notes, and snippets.

View syuilo's full-sized avatar
🥺

syuilo syuilo

🥺
  • Earth
  • 09:30 (UTC +09:00)
View GitHub Profile
export default class Trie {
private tree: any = {};
public add(s: string): void {
let cur = this.tree;
for (const c of s) {
if (!cur[c]) cur[c] = { isString: false };
cur = cur[c];
}
cur.isString = true;
@nagiept
nagiept / distributed_service_catalog.md
Last active October 1, 2023 23:36
Distributed Service Catalog 2018

Distributed Service Catalog 2018

分散SNS Advent Calendar 2018 Fediverseとその他の分散サービスの歴史とプロジェクトを適当に書いておくだけの記事

Progects list

Laconica

ジャンル マイクロブログ
読み ラコニカ(?)
開発者 Evan Prodromou(Control Yourself社)
言語 PHP

Deterministic save load in Factorio

One of the key parts of the save/load process in Factorio is that it must be deterministic. This means that for a given save file (when no external factors change) saving, exiting, and loading the save shouldn't change any observable behavior.

There are a few reasons and benefits for this strict requirement:

  • Without it: You couldn't join a running multiplayer game (and by proxy save, exit, and resume one)
  • Without it: the replay system wouldn't work if you ever saved, exited, and resumed playing.
  • With it: we can easily test that saving and loading produces no observable change letting us know we implemented save/load correctly.
  • With it: you won't see things change randomly as a result of "reloading" like you do in so many other games.
@YuzuRyo61
YuzuRyo61 / LICENSE
Created November 14, 2018 09:29
MisskeyでApiトークンを作成するためのPythonスクリプト。対話式なので簡単に作成できます。pyperclipライブラリを導入しているとクリップボードにもコピーできます。
Copyright 2018 YuzuRyo61
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER D
@xreiju
xreiju / misskey_reaction.js
Last active May 5, 2021 12:21
Show the reactions for the specified noteId #misskey
// Requirement: node-fetch
// How it works:
// $ node misskey_reaction.js xxxxxxxxxxxxxxxxx(noteId)
// $ node misskey_reaction.js https://${host}/notes/xxxxxxxxxxxx(noteId)
// You need to put your token here to get it working.
const i = '!YOUPUTYOURTOKENHERETOGETTHISPROGRAMTOWORK'
//
const fetch = require('node-fetch')
@marihachi
marihachi / XevPubSub.js
Last active October 13, 2018 18:27
xevを使ったpubsub(observerパターン?)実装 [MIT License: (c) 2018 Marihachi]
const Xev = require('xev').default;
const { EventEmitter } = require('events');
class XevPubSub extends EventEmitter {
constructor(namespace) {
super();
this.parentEmitter = new Xev(namespace);
this.list = {};
this.handler = (channel) => (message) => this.emit('message', channel, message);
}
@xreiju
xreiju / misskey.md
Last active March 15, 2021 10:56
Misskey入門.md

Misskey入門

登録、投稿などの基本操作にはすぐに慣れるでしょうから、ここでは触れません!

なお、PC版を使っていることを前提に記述していますが、スマホ版でも似たような手段で設定を変更することができます。

アイコンが丸いのが嫌

設定 -> Web -> 円形のアイコンを使用 のところから、四角いアイコンへ変更できます。

title
Misskey タイムライン機能比較
ホーム ローカル ハイブリッド グローバル
ユーザー フォロー
ローカル
リモート
公開範囲 公開
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>麻雀</title>
<style>
* {
box-sizing: border-box;
transform-style: preserve-3d }
@rinsuki
rinsuki / disablecat.user.js
Last active June 1, 2018 03:05
UserScriptで対抗2018
// ==UserScript==
// @name DisableCat
// @namespace https://rinsuki.net
// @version 0.1
// @description 設定→Web→詳細設定→ストリームを経由したAPIリクエストをOFFにしたあとリロード
// @author rinsuki
// @match https://misskey.xyz/*
// @grant none
// @run-at document-start
// ==/UserScript==