Skip to content

Instantly share code, notes, and snippets.

View yasaichi's full-sized avatar
😇

Yuichi Goto yasaichi

😇
View GitHub Profile
@necojackarc
necojackarc / Set up Vim with clipboard on Ubuntu on WSL2.md
Last active December 28, 2023 02:45
Set up Vim on Ubuntu on Windows Subsystem for Linux 2 (WSL2) to share clipboard

This explains how to set up Vim on Ubuntu 18.04 on Windows Subsystem for Linux 2 (WSL2) in order to share the clipboard between Windows and Ubuntu.

Environments

  • Windows 10 Home
  • Ubuntu 18.04 on Windows Subsystem for Linux 2 (WSL2)

Steps

  1. Build Vim with the clipboard option enabled
  2. Set up VcXsrv Windows X Server
@waaaaRapy
waaaaRapy / totp.js
Last active November 10, 2023 03:28
Time-Based One-Time Password Generator (RFC6238)
// work on node v10.15.3
const DIGIT = 6;
const TIME_STEP = 30;
/**
* Calculate TOTP value defined in [RFC6238](https://tools.ietf.org/html/rfc6238)
*
* @param {Buffer} key shared secret between client and server
* @param {Date} date date to calculate totp value.
@tbutts
tbutts / tmux-migrate-options.py
Last active February 29, 2024 08:11
For tmux configs: Merge deprecated/removed -fg, -bg, and -attr options into the -style option
#!/usr/bin/env python
# vim: set fileencoding=utf-8
#
# USAGE:
# Back up your tmux old config, run the script and redirect stdout to your conf
# file. Example:
#
# $ cp ~/.tmux.conf ~/.tmux.conf.orig
# $ python ./tmux-migrate-options.py ~/.tmux.conf.orig > ~/.tmux.conf
#
@mala
mala / CVE-2019-5418_is_RCE.md
Last active February 7, 2021 04:25
Rails の CVE-2019-5418 は RCE (Remote code execution) です
@azu
azu / _.txt
Last active December 20, 2018 01:47
2018年のテクノブレーンさん
___様
突然のご連絡失礼致します。テクノブレーン株式会社の______と申します。
弊社は五反田に御座います、エンジニアの方に特化したスカウト会社です。
◆弊社ホームページ>お声かけをさせて頂いた方へ
https://www.techno-brain.co.jp/scout/message/
今回とある企業よりエンジニア組織を作っていきたいと依頼を受け、エンジニアの方をお探しする中で
___様のブログなど拝見し、ご連絡をさせて頂きました。
@tai2
tai2 / omakase_vs_alacarte.md
Last active December 8, 2018 08:55
おまかせ vs アラカルト(Railsdm 2018 Day 4) 付録
@mizchi
mizchi / how-hooks-work.md
Last active March 28, 2024 07:10
(翻訳) React Hooks は魔法ではなく、ただの配列だ

(翻訳) React Hooks は魔法ではなく、ただの配列だ

この記事は https://medium.com/@ryardley/react-hooks-not-magic-just-arrays-cd4f1857236e の日本語訳です。途中で力尽きて雑な翻訳になってる箇所がいくつかあります。


どのように Hooks が動いているか

私は、新しい Hooks の API の "magic" な挙動に悩んでいる人が結構いると聞いています。なのでこの構文の提案が、少なくとも表面的なレベルではどう動いているか、解説してみようと思います。

Chapter1 思考のリファクタリング

エンジニアリングとは

本書は「はじめに」で述べた通り、不確実性を組織の推進に変えることこそがエンジニアリングの本質と述べました。

そもそもエンジニアリングとは何か、というところに立ち戻りましょう。

エンジニアリング、「工学」とは。

工学とは数学と自然科学を基礎とし、ときには人文社会科学の知見を用いて、公共の安全、健康、福祉のために有用な事物や快適な環境を構築することを目的とする学問である(p10)

@voluntas
voluntas / death_march.md
Last active December 29, 2023 15:36
デスマーチが起きる理由 - 3つの指標

デスマーチが起きる理由 - 3つの指標

著者: 青い鴉(ぶるくろ)さん @bluecrow2

これは結城浩さんの運用されていた YukiWiki に当時 Coffee 様 (青い鴉(ぶるくろ)さん)がかかれていた文章です。 ただ 2018 年 3 月 7 日に YukiWiki が運用停止したため消えてしまいました。その記事のバックアップです。

今は 404 ですが、もともとの記事の URL は http://www.hyuki.com/yukiwiki/wiki.cgi?%A5%C7%A5%B9%A5%DE%A1%BC%A5%C1%A4%AC%B5%AF%A4%AD%A4%EB%CD%FD%CD%B3 になります。

昔、自分がとても感銘を受けた文章なので、このまま読めなくなるのはとてももったいないと思い、バックアップとして公開しています。

@sebmarkbage
sebmarkbage / Infrastructure.js
Last active March 14, 2024 17:40
SynchronousAsync.js
let cache = new Map();
let pending = new Map();
function fetchTextSync(url) {
if (cache.has(url)) {
return cache.get(url);
}
if (pending.has(url)) {
throw pending.get(url);
}