Skip to content

Instantly share code, notes, and snippets.

View chansuke's full-sized avatar
🎯
Focusing

Yusuke Abe chansuke

🎯
Focusing
  • Tokyo
  • 21:20 (UTC +09:00)
View GitHub Profile
@kat0h
kat0h / vim9script4pythondevelopers.md
Last active March 31, 2021 07:51
Vim9 script for Python Developers

Vim9 script for Python Developers

Vim9 scriptはVim scriptとの互換をなくし変数の型縛りを導入したり、コンパイルをすることなどにより、高速化を実現した新しい処理系です。

defコマンドで定義された関数内、またはVim script内でvim9scriptコマンドを使うことで利用できます(vim9scriptコマンドの後ではfunctionコマンドは利用できません)。

この記事は、 https://gist.github.com/yegappan/16d964a37ead0979b05e655aa036cad0 の内容を元にVim(v8.2.2576)上のVim9 scriptで動作するように改変したものです。

Vim9 scriptで動作を確認できなかったもの、まだ実装されていなものはpassと表記し、省略しています。

@azu
azu / READ.md
Last active May 8, 2021 14:23
JavaScriptの本を書くときに参考にしてるもの

jsprimerというJavaScriptの書籍を書いている。 これを書いてるときに参考にしているものを書いていく。

ECMAScriptのLiving Standardな仕様書ページ。 スナップショットなECMAScriptの仕様書ページもあるけど、基本的にはLiving Standardの方しか見てない。

@qnighy
qnighy / rust-patterns.md
Last active March 20, 2024 03:33
Rustのパターンっぽいやつメモ

パターンとはその言語が抽象化できなかった敗北の歴史である。 しかしどんなに優れた言語であってもあらゆる繰り返しに勝てるわけではない。 人は必ずメタ繰り返しを欲するからだ。 そしてそれはRustも例外ではない。

ここでは、OOPでも知られているパターンよりも、Rustに特有のパターンを思いつく限りまとめてみた。名前は適当。

  • crate splitting
    • でかいcrateを分割して、見通しを良くする・再コンパイルの分量を削減する・並列コンパイルを可能にする
  • 親玉crate(全てにdependする)と殿crate(全てにdependされる)があることが多いので、だいたい束みたいな形になる。
@dentechy
dentechy / WSL-ssh-server.md
Last active July 14, 2024 03:54
A step by step tutorial on how to automatically start ssh server on boot on the Windows Subsystem for Linux

How to automatically start ssh server on boot on Windows Subsystem for Linux

Microsoft partnered with Canonical to create Bash on Ubuntu on Windows, running through a technology called the Windows Subsystem for Linux. Below are instructions on how to set up the ssh server to run automatically at boot.

  1. Edit the /etc/ssh/sshd_config file by running the command sudo vi /etc/ssh/sshd_config and do the following
    1. Change Port to 2222 (or any other port above 1000)
    2. Change PasswordAuthentication to yes. This can be changed back to no if ssh keys are setup.
  2. Restart the ssh server:
    • sudo service ssh --full-restart
  3. With this setup, the ssh server must be turned on every time you run Bash on Ubuntu on Windows, as by default it is off. Use this command to turn it on:
@teppeis
teppeis / es-class-fields.md
Last active March 13, 2022 13:57
ES Class Fieldsのプライベートフィールドがハッシュな変態記法なのは何でなんだぜ?

ES Class Fields (Stage 2 now)

プライベートフィールドがハッシュな変態記法なのは何でなんだぜ?

class Point {
    #x;
    #y;
 constructor(x = 0, y = 0) {
@antirez
antirez / lmdb.tcl
Created April 28, 2017 15:40
LMDB -- First version of Redis written in Tcl
# LVDB - LLOOGG Memory DB
# Copyriht (C) 2009 Salvatore Sanfilippo <antirez@gmail.com>
# All Rights Reserved
# TODO
# - cron with cleanup of timedout clients, automatic dump
# - the dump should use array startsearch to write it line by line
# and may just use gets to read element by element and load the whole state.
# - 'help','stopserver','saveandstopserver','save','load','reset','keys' commands.
# - ttl with milliseconds resolution 'ttl a 1000'. Check ttl in dump!
@gutchom
gutchom / Logger.d.ts
Last active April 20, 2017 06:55
オブジェクトを与えることで画面の状態や操作の履歴を保存したり復元したりしてくれるよ。
interface HistoryLogger {
readonly current: any
readonly stamp: number
jump(stamp: number): void
undo(): void
redo(): void
clear(): void
record(record: any): void
restore(): void
}
@hayajo
hayajo / .gitignore
Last active December 5, 2018 01:03
「GoでくつるLinuxコンテナ」 - 第10回 コンテナ型仮想化の情報交換会@東京 #lxcjp
.vagrant/
@abhiaiyer91
abhiaiyer91 / reduxSelectorPattern.md
Last active July 7, 2024 13:03
Redux Selector Pattern

Redux Selector Pattern

Imagine we have a reducer to control a list of items:

function listOfItems(state: Array<Object> = [], action: Object = {}): Array<Object> {
  switch(action.type) {
    case 'SHOW_ALL_ITEMS':
      return action.data.items
    default:
@tanb
tanb / xhyve-freebsd-tutorial-1.md
Last active November 27, 2021 13:07
FreeBSD running on xhyve tutorial. (Appendix: Resize image with qemu. Create FreeBSD VM with qemu).

TL;DR

  • Create 5GB FreeBSD image.
  • Install FreeBSD on xhyve.
  • Mount host directory.

Requisites