Skip to content

Instantly share code, notes, and snippets.

View kekeho's full-sized avatar
🐶

Hiroki TAKEMURA kekeho

🐶
View GitHub Profile
@tfutada
tfutada / vegeta.rs
Created December 12, 2022 12:22
HTTP load testing tool to study Rust language.
// usage:
// $ cargo build --bin vegeta --release
// $ ./target/release/vegeta -u http://localhost:8000/foo -r 5 -d 30
// generates 5 requests per second, during 30 seconds, targeting to http://localhost:8000/foo
use std::time::{Duration, Instant};
use tokio::sync::mpsc;
use histogram::Histogram;
use std::io::{self, Write};
use anyhow::Result;
use tokio::sync::mpsc::Sender;
@greymd
greymd / 全裸ネクタイ効果.md
Last active July 20, 2022 11:44
全裸ネクタイ効果

ぜんらねくたいこうか【全裸ネクタイ効果】

「全裸ネクタイのバイアス」とも。

漫画・アニメ・小説などの創作物において、極めて目立つツッコミ所が既にあるにもかかわらず、細々としたマイナーな指摘が先行する現象を指す。

作中で現実世界と比べておかしい点を指摘する際に用いられる表現。 また、指摘の内容が、作品が想定しているリアリティライン(現実レベルの度合い)を考慮していない状況でよく使われる。

指摘内容が特定の人がよく知る領域や、専門知識が必要な場合に発生しやすい。 知識をひけらかしたいといった欲求や、身近に感じているために期待するリアリティラインが作品の想定より高くなってしまう、内情をよく知るために自身の経験が想起されて創作として捉えられなくなってしまう、といった動機が存在すると考えられる。

//SPDX-License-Identifier: MIT
pragma solidity ^0.7.0;
import "@openzeppelin/contracts/token/ERC777/IERC777.sol";
import "@openzeppelin/contracts/token/ERC777/IERC777Recipient.sol";
import "@openzeppelin/contracts/introspection/IERC1820Registry.sol";
abstract contract ERC777Receiver is IERC777Recipient {
IERC1820Registry constant internal ERC1820_REGISTRY = IERC1820Registry(0x1820a4B7618BdE71Dce8cdc73aAB6C95905faD24);
@BonyChops
BonyChops / headerGenerator.js
Last active December 29, 2020 14:01
Generate C header from C source
const fs = require('fs');
const filePath = "mulprec_test.c";
const fileData = fs.readFileSync(filePath).toString();
result = fileData.split("\n").filter(line => line.match(/^(int|double|NUMBER|bool|void).*/)).map(line => line.replace(/(\s)*{(\s)*$/,";")).join("\n");
console.log(result);

evdevのキーマップがよくわからない。

どこに情報があるんだと悩んだもののPythonなので自力で調べられるんじゃないかと。

試す。

from evdev import ecodes as e
kl = dir(e)
with open("keylist.txt","w") as f:
  for l in kl:
    f.write("%s\n" % l )
@trpfrog
trpfrog / itemizeAndTable.tex
Last active October 18, 2022 05:14
LaTeXで表の中に箇条書きを書くやつです。2つのもののメリットとデメリットを書くときなどにどうぞ。
\documentclass[12pt,a4j]{jarticle}
\usepackage{graphicx}
\usepackage{geometry}
\usepackage{plext}
\geometry{top=30truemm,bottom=30truemm,left=25truemm,right=25truemm}
\usepackage{plext}
\newcommand*{\setItemizeInterval}[0]{
\setlength{\parskip}{0cm}
\setlength{\itemsep}{0cm}
}
@khronos227
khronos227 / rpi-wifi-setup.sh
Created January 4, 2019 05:23
script to setup wifi access point for raspbian os
#!/bin/bash
function backup () {
if [ -e $1 -a ! -e $1.bak ]; then
cp $1{,.bak}
fi
}
function restore () {
cp $1{.bak,}
@sifue
sifue / 無料で読めるポール・グレアムの「ハッカーと画家」+αの日本語訳のみのまとめ.md
Last active March 22, 2025 12:06
無料で読めるポール・グレアムの「ハッカーと画家」+αの日本語訳のみのまとめ
@sile
sile / time-clocks.md
Last active October 5, 2024 06:13
『Time, Clocks, and the Ordering of Events in a Distributed System』の要約

Time, Clocks, and the Ordering of Events in a Distributed System

http://research.microsoft.com/en-us/um/people/lamport/pubs/time-clocks.pdf の要約。

著者はレスリー・ランポート (Leslie Lamport), 1978年。

分散アルゴリズムの書籍や論文でお馴染みの、分散システムにおけるイベント群の順序や時刻の概念を説明している論文。

! が先頭についている箇所は、要約者による(いい加減な)注釈。

@Lewiscowles1986
Lewiscowles1986 / rPi3-ap-setup.sh
Last active March 31, 2025 15:46
Raspberry Pi 3 access-point-setup
#!/bin/bash
#
# This version uses September 2017 august stretch image, please use this image
#
if [ "$EUID" -ne 0 ]
then echo "Must be root"
exit
fi