Skip to content

Instantly share code, notes, and snippets.

anonymous
anonymous / newtom.md
Created January 17, 2018 20:24
AMラジオを使ってApple Newtonの起動時の問題を直した話

Apple Newtonの起動時の問題をこの方法(システムバスのノイズをラジオで聞く)でデバグしたことがある。その問題では、最新のフラッシュイメージが、開発用ハードウェアでは起動するのに実機ではまったく動かなかった(なのでLEDやGPIOなども使えなかった)。でも実機に新しいOSイメージをフラッシュすることはできた。

そこで僕は、システムバスに対してそれぞれ異なる動作をする小さなループをいくつか書いて(なのでループの実行中にバスから出るノイズをラジオで聞くとそれぞれ違う音がする)、起動時に実行されるコードの各所にそれを埋め込んで、AMラジオでバスのノイズを聞いてみた。この仕掛けを使って起動時のコードをトレースしていくことで、問題の場所を1時間ほどでみつけることができた。

多分もっとよい方法もあったのだろうけど、でも面白い方法だったと思う。

https://news.ycombinator.com/item?id=16168499

@klaaspieter
klaaspieter / ASS.md
Created June 22, 2017 07:59 — forked from anonymous/ASS.md
Acronyms Seriously Suck - Elon Musk

From time to time, Musk will send out an e-mail to the entire company to enforce a new policy or let them know about something that's bothering him. One of the more famous e-mails arrived in May 2010 with the subject line: Acronyms Seriously Suck:

There is a creeping tendency to use made up acronyms at SpaceX. Excessive use of made up acronyms is a significant impediment to communication and keeping communication good as we grow is incredibly important. Individually, a few acronyms here and there may not seem so bad, but if a thousand people are making these up, over time the result will be a huge glossary that we have to issue to new employees. No one can actually remember all these acronyms and people don't want to seem dumb in a meeting, so they just sit there in ignorance. This is particularly tough on new employees.

That needs to stop immediately or I will take drastic action - I have given enough warning over the years. Unless an acronym is approved by me, it should not enter the SpaceX glossary.

@ljjjustin
ljjjustin / socat-tcp-to-unix-socket.sh
Last active April 4, 2024 15:00
socat-unix-socket-to-tcp.sh
#!/bin/bash
if [ $# -ne 3 ]; then
echo "usage: $0 <unix socket file> <host> <listen port>"
exit
fi
SOCK=$1
HOST=$2
PORT=$3
@juanca
juanca / github_load_all_diffs.js
Created March 2, 2017 18:42
Github PR bookmarklet: Load all file diffs
javascript:
document.querySelectorAll('.load-diff-button').forEach(node => node.click())
@timakin
timakin / go-job-worker.md
Last active February 5, 2024 07:37
Go製ジョブワーカーライブラリの比較

ライブラリ検索するときに便利 -> https://golanglibs.com

  • benmans/goworker(1584 stars)
    • redis-backed
    • Go製のジョブワーカーでは一番メジャーぽい
    • 当初Enqueueがなかったようだが、2015/12に追加されてる: 参考
    • リポジトリ自体は4年前からあって、7か月前にも更新はされてる
  • rallison/go-workers(816 stars)
    • redis-backed  - 機能的にはgoworkerとほぼ変わらなさそう
@max-mapper
max-mapper / index.sh
Last active November 2, 2023 10:13
generate ES512 and RS256 elliptic curve keypairs for JWT JWK (JSON Web Token JSON Web Key) using openssl
# RS256
# private key
openssl genrsa -out rs256-4096-private.rsa 4096
# public key
openssl rsa -in rs256-4096-private.rsa -pubout > rs256-4096-public.pem
# ES512
# private key
openssl ecparam -genkey -name secp521r1 -noout -out ecdsa-p521-private.pem
# public key
@schmohlio
schmohlio / sse.go
Last active February 13, 2023 08:38 — forked from ismasan/sse.go
Example SSE server in Golang
// v2 of the great example of SSE in go by @ismasan.
// includes fixes:
// * infinite loop ending in panic
// * closing a client twice
// * potentially blocked listen() from closing a connection during multiplex step.
package main
import (
"fmt"
"log"
@a2ikm
a2ikm / partition_size.sql
Last active September 2, 2016 04:48
パーティションごとのサイズを算出するSQL
SELECT
TABLE_SCHEMA,
TABLE_NAME,
PARTITION_NAME,
TABLE_ROWS,
CEIL(DATA_LENGTH / 1024 / 1024) AS DATA_LENGTH_MiB,
CEIL(INDEX_LENGTH / 1024 / 1024) AS INDEX_LENGTH_MiB,
CEIL((DATA_LENGTH + INDEX_LENGTH) / 1024 / 1024) AS TOTAL_LENGTH_MiB
FROM
INFORMATION_SCHEMA.PARTITIONS
@csham
csham / show-hidden-comments.js
Last active April 22, 2020 04:46
Show all hidden comments on github's pull request page.
var showHiddenCommentsButtons = document.getElementsByClassName('discussion-item-toggle-closed');
for (var i=0; i < showHiddenCommentsButtons.length; i++) {
showHiddenCommentsButtons[i].click();
}
@rmetzler
rmetzler / docker-compose.yml
Created January 4, 2016 13:35
docker-compose from STDIN
redis:
image: redis
ports:
- "6379:6379"