Skip to content

Instantly share code, notes, and snippets.

View equal-l2's full-sized avatar

equal-l2

  • Japan
  • 02:17 (UTC +09:00)
View GitHub Profile
@equal-l2
equal-l2 / user.css
Last active April 7, 2024 09:00
Make X/Twitter spoilers looks better
/* Based on https://github.com/noriokun4649/SensitiveImageLover/blob/8173587fae62ecf57d5ca8304dcc6e768d94c9e2/override.css */
/* Remove blur, but make darker to distinguish */
div .r-yfv4eo {
filter: brightness(70%);
}
/* Remove background color for the warning in tweet */
/* as the shadow is already applied in the filter above */
div .r-drfeu3 {
@equal-l2
equal-l2 / png_catch_the_tail.py
Last active January 7, 2023 18:55
Extract data after IEND from PNG (read from stdin, write to stdout)
#!/usr/bin/env python3
import sys
# read all from stdin
data = sys.stdin.buffer.read()
# check header
png_header = b"\x89PNG\x0D\x0A\x1A\x0A"
header_len = len(png_header)
if data[0:header_len] != png_header:
@equal-l2
equal-l2 / money.jl
Last active November 21, 2021 09:28
Money distribution simulation
struct MoneySim
balance::Array{Int64}
members::Int64
end
function init(;members::Int64=1000, initial_balance::Int64=100)::MoneySim
return MoneySim(fill(initial_balance, members), members)
end
function step!(self::MoneySim)
@equal-l2
equal-l2 / yutanpo.py
Created January 12, 2021 19:20
yutanpo
room_temp = 20
hot_temp = 100
def cool(x, time):
assert time >= 0
assert x >= room_temp
# assuming boiling water requires an hour to reach around 40℃
cooling_fact = 4e-4
@equal-l2
equal-l2 / _touhi.md
Last active February 19, 2024 06:08
某カレンダー用

Boushitsu Advent Calendar 2020 三日目

逃避行に失敗した話

人生初のポエム記事がこんなんでいいのか。

Disclaimer

なんの目的もなく名古屋にお出かけしたときのことを、脳内からダンプして書き出しただけのものです。
読みやすさは一切考慮されていないので注意されたし。
文章のテンションがおかしいのは当時のテンションを思い出してそのまま反映したためです。

@equal-l2
equal-l2 / tsubuyaki.md
Last active June 6, 2023 06:33
情報科学実験I 超高性能化課題の進捗つぶやき

TL;DR

GeoTagの構造体を頑張って小さくしてメモリに載せて、actix-webでゴリ押ししたら早くなった

実装したもの一覧

元のCSVファイルを読んでいた春

  • PHP遅いん……
file /private/tmp/wesnoth-20181020-92073-1ysuepp/wesnoth-1.14.5/SConstruct,line 331:
Configure(confdir = build/sconf_temp)
scons: Configure: Checking for C library m...
build/sconf_temp/conftest_0.c <-
|
|
|
|int
|main() {
|
@equal-l2
equal-l2 / ricty.diff
Last active January 5, 2017 15:00
Workaround for ricty's huge inconsolata character
--- a/ricty_generator-4.1.0.sh
+++ b/ricty_generator-4.1.0.sh
@@ -314,6 +314,10 @@ while (i < SizeOf(input_list))
Print("Open " + input_list[i] + ".")
Open(input_list[i])
+ SelectAll()
+ ClearInstrs()
+ UnlinkReference()
+