Skip to content

Instantly share code, notes, and snippets.

@kaishuu0123
kaishuu0123 / index.common.js
Created July 31, 2020 03:49
markdown-it-drawio-viewer
'use strict';
var index = function (md, name, options) {
function validateDefault(params) {
return params.trim().split(' ', 2)[0] === name
}
function renderDefault(tokens, idx, _options, env, self) {
if (tokens[idx].nesting === 1) {
tokens[idx].attrPush(['class', name]);
@kaishuu0123
kaishuu0123 / x11_docker_mac.md
Created January 26, 2022 07:18 — forked from cschiewek/x11_docker_mac.md
X11 in docker on macOS

To forward X11 from inside a docker container to a host running macOS

  1. Install XQuartz: https://www.xquartz.org/
  2. Launch XQuartz. Under the XQuartz menu, select Preferences
  3. Go to the security tab and ensure "Allow connections from network clients" is checked.
  4. Run xhost + ${hostname} to allow connections to the macOS host *
  5. Setup a HOSTNAME env var export HOSTNAME=`hostname`*
  6. Add the following to your docker-compose:
 environment:
@kaishuu0123
kaishuu0123 / main.go
Created April 1, 2022 02:42
AllenDang/giu で CHIP-8 エミュレータを書こうとした残骸
package main
import (
"fmt"
"image"
"image/color"
"github.com/AllenDang/giu"
g "github.com/AllenDang/giu"
"github.com/AllenDang/imgui-go"
@kaishuu0123
kaishuu0123 / xv6.md
Last active April 23, 2022 15:56
xv6 を読む
@kaishuu0123
kaishuu0123 / main.go
Last active August 5, 2022 16:25
Golang Memory Usage (like vmstat)
import (
"fmt"
"time
)
func main() {
fmt.Println("Hello, world")
go func() {
t := time.NewTicker(3 * time.Second) // 3秒おき
@kaishuu0123
kaishuu0123 / keybindings.json
Created December 1, 2023 14:23
VSCode keybindings
[
{
"key": "ctrl+p",
"command": "cursorUp",
"when": "terminalFocus"
},
{
"key": "ctrl+n",
"command": "cursorDown",
"when": "terminalFocus"
wsl --shutdown
diskpart
# open window Diskpart
select vdisk file="C:\WSL-Distros\…\ext4.vhdx"
attach vdisk readonly
compact vdisk
detach vdisk
exit