Skip to content

Instantly share code, notes, and snippets.

View legokichi's full-sized avatar
😇
neary heaven

Legokichi Duckscallion legokichi

😇
neary heaven
View GitHub Profile
@rain-1
rain-1 / IRC.md
Created September 11, 2021 18:14
why we use IRC nodes

Why is IRC distributed across multiple servers?

I have been wondering for a long time why IRC networks have multiple servers. Wouldn't it be simpler just to use a single server?

One of the problems of having multiple servers is that netsplits can occur. Anybody who has been on IRC for a while will have witnessed one. Hundreds of people suddenly ripped out of the chat. This can also screw up channel and user modes, and 'some people' have been known to wait for netsplits in order to takeover channels or enter password protected channels.

So lets compare situation (A) a single IRC server everyone connects to with the current setup people use (B) multiple servers. Let's say you run an IRC network with u = 40,000 users and n = 20 server nodes that people connect to via round robin DNS (meaning that when people resolve the DNS it gives them a random server from the set of 20 to connect to). These are vaguely realistic numbers modelled after libera.chat.

So in (B) you have roughly u/n = 2000 clients connected

@azu
azu / browser-resources.md
Last active June 25, 2020 01:57
ブラウザ/セキュリティ/プライバシー周りの一次情報に近い二次情報の情報源をまとめたもの

一次情報に近い二次情報の情報源をまとめたもの。

ここでの一次情報はコミットとかコードのこと。

Browser

@ver-1000000
ver-1000000 / dynmap-chat-logger.js
Last active August 14, 2023 05:07
Chromeで任意のMinecraftのDynmapを開いて、ロケーションバーに`javascript:`って打った後にコピペしてエンターするとチャットログが見れる画面が生まれるやつ
d = document; a = d.createElement('pre'); d.body.appendChild(a); a.style = 'position:fixed;resize:both;top:200px;height:200px;width:400px;overflow:auto;white-space:pre-wrap;background:#46486787;z-index:1'; q = (x) => d.querySelectorAll(x)[0]; m = q('.messagelist'); t = ''; o = new MutationObserver(_ => { tt = ((q('.messagerow')||{}).innerText||'').trim(); if (tt && t != tt) { a.innerText = `[${new Date().toLocaleString('ja-JP')}] ${tt}\n\n${a.innerText}`; t = tt; } }); o.observe(m, { childList: true })
@edmundsmith
edmundsmith / writeup.md
Created July 7, 2019 20:47
Method for Emulating Higher-Kinded Types in Rust

Method for Emulating Higher-Kinded Types in Rust

Intro

I've been fiddling about with an idea lately, looking at how higher-kinded types can be represented in such a way that we can reason with them in Rust here and now, without having to wait a couple years for what would be a significant change to the language and compiler.

There have been multiple discussions on introducing higher-ranked polymorphism into Rust, using Haskell-style Higher-Kinded Types (HKTs) or Scala-looking Generalised Associated Types (GATs). The benefit of higher-ranked polymorphism is to allow higher-level, richer abstractions and pattern expression than just the rank-1 polymorphism we have today.

As an example, currently we can express this type:

@Matthias247
Matthias247 / async_await_cancellation.md
Created May 28, 2019 06:09
Async/Await - The challenges besides syntax - Cancellation

Async/Await - The challenges besides syntax - Cancellation

This is the second article in a series of articles around Rusts new async/await feature. The first article about interfaces can be found here.

In this part of the series we want to a look at a mechanism which behaves very different in Rust than in all other languages which feature async/await support. This mechanism is Cancellation.

@Ishotihadus
Ishotihadus / atr.md
Last active May 19, 2024 15:40
ATR503文元ネタ集

ATR 音素バランス 503 文元ネタ集

判明している音素バランス文の元ネタを集めた。

Subset A

a01: あらゆる現実をすべて自分のほうへねじ曲げたのだ。

「マルサの女 撮影日記」(伊丹十三)(文藝春秋 1987 年 2 月)(c03、g01 と同一)

@LambdaNote
LambdaNote / writing.md
Last active March 5, 2024 01:29
記事の書き方

記事の書き方

記事の執筆には、Markdown形式を利用してください。 Markdownにはさまざまな流派がありますが、GitHub Flavored Markdown(https://github.github.com/gfm/ )をベースとした書式を採用します。

書籍を執筆するための形式として考えると、Markdownには不足している機能が多々あります。 しかし、次のような利点があるので、Markdownを採用することにします。

  • 最低限の構造しかないので、見た目でごまかせる余地が少ない
  • 原稿を著者自身が再利用してもらいやすくしたい
@ssig33
ssig33 / 1.md
Last active June 8, 2024 16:13
tweetdeck スクレイピング

Twitter のストリーミング API が滅亡した今、 tweetdeck をスクレイピング(?)するのが一番簡単に twitter の更新情報をリアルタイムに取得する方法だと思います。

ここではその方法を説明します。

1. puppeteer

puppeteer は極めて強力なソフトウェアで、本物の Chrome を使って簡単に Web サイトの操作を自動化したりスクレイピングしたりできます。

今回のような用途で特筆すべき点は、 puppeteer は Web アプリケーションの Ajax リクエストのレスポンスを横取りできる点です。以下に例を示します