Skip to content

Instantly share code, notes, and snippets.

View hnakamur's full-sized avatar

Hiroaki Nakamura hnakamur

View GitHub Profile
@gingerBill
gingerBill / dumb_handle_map.odin
Last active May 27, 2026 00:52
Handle-based Map
package dumb_handle_map
// NOTE: ONLY TO SHOW WHAT A GENERATION IS DOING
// BUT DOES NO INSERTION WHATSOEVER
Handle_Map :: struct($T: typeid) {
entries: [dynamic]Entry(T),
}
Entry :: struct($T: typeid) {
@skeeto
skeeto / main.c
Last active October 7, 2024 00:49
// Ref: https://old.reddit.com/r/C_Programming/comments/1dlc4kw
#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#define new(n, t) (t *)calloc(n, sizeof(t))
typedef struct node node;
struct node {
@laytan
laytan / LICENSE
Last active June 27, 2026 09:56
LLDB script to visualise Odin slices, maps, and strings
Anyone is free to copy, modify, publish, use, compile, sell, or
distribute this software, either in source code form or as a compiled
binary, for any purpose, commercial or non-commercial, and by any
means.
In jurisdictions that recognize copyright laws, the author or authors
of this software dedicate any and all copyright interest in the
software to the public domain. We make this dedication for the benefit
of the public at large and to the detriment of our heirs and
successors. We intend this dedication to be an overt act of
@orimanabu
orimanabu / ansible_enable_winrm_with_openssl_self_certificate.md
Last active March 5, 2024 11:48
Enable WinRM for Ansible using self signed certificate generated by OpenSSL

はじめに

これは、AnsibleでWindowsを管理するために、WinRMにHTTPSで接続できるよう設定するためのドキュメントです。 自己証明書は、PowerShellの New-SelfSignedCertificate ではなくLinux上でopensslコマンドで作成したものを使用します。

設定対象のWindows VMを

  • ホスト名: wintest1
  • IPアドレス: 192.168.122.70
@laytan
laytan / minicoro.odin
Last active March 10, 2026 14:49
Odin minicoro port
// This package started out as a port of the minicoro library with the following copyright:
//
// Copyright (c) 2021-2023 Eduardo Bart (https://github.com/edubart/minicoro)
//
// Permission is hereby granted, free of charge, to any person obtaining a copy of
// this software and associated documentation files (the "Software"), to deal in
// the Software without restriction, including without limitation the rights to
// use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
// of the Software, and to permit persons to whom the Software is furnished to do
// so.
@kumagi
kumagi / virtual_memory_limit.c
Last active October 29, 2023 07:39
mmap_max
#include <memory.h>
#define _XOPEN_SOURCE_EXTENDED 1
#include <sys/mman.h>
#include <stdint.h>
#include <stdio.h>
#include <climits>
#include <algorithm>
int main() {
@wtnbgo
wtnbgo / wsl2_docker_from_windows.md
Last active January 29, 2024 16:35
WSL2の Docker に WIndows から直接アクセスする手順

WSL2の Docker に Windows から直接アクセスする手順

Linxu側準備

Linux 側で Docker のポートを準備しておく

古い方式

docker のオプションとして直接指定

@uakihir0
uakihir0 / Bluesky の歩き方.md
Last active July 7, 2024 05:34
Bluesky の歩き方.md

Bluesky の歩き方

 Bluesky は Twitter の類似サービスとして期待されている分散 SNS の一つです。 Twitter の創設者である Jack Dorsey による出資を受けており、 Bluesky, PBLLC によって開発・運営されています。 Bluesky は現在公式のアプリ・ウェブでは、日本語の UI がなくとっつきにくい部分があるため、ここでは楽しみ方について簡単に説明します。

日本語話者の探し方

 まずは何にせよ、フォローする人を見つける必要があります。 Bluesky 公式 Web または、公式アプリからログインしている人は、以下の日本語話者カスタムフィード (ユーザーが作成した、独自のタイムライン) Japanese Cluster を見れば、日本語話者が見つかると思います。

 とはいえ、このカスタムフィードでは、人が多すぎて何がなんだかと思う人も多いと思うので、今トレンドのポスト (投稿) を取得する方法を説明します。まず、設定からコンテンツ言語を日本語にします。コンテンツ言語は、カスタムフィードにおいて、どの言語のポストを取得するか? という設定になります。左メニューから、 Settings > Content Languages の順にアクセスすると変更できます。

@doraTeX
doraTeX / ocr.m
Last active October 28, 2025 08:10
Original Swift / Objective-C / AppleScriptObjC codes from which ocr.sh (https://gist.github.com/doraTeX/da9a1a26dffbf3fe5d6ec12a9c79267c) is converted
#import <Quartz/Quartz.h>
#import <Vision/Vision.h>
int main(int argc, const char * argv[]) {
@autoreleasepool {
NSString *target = @"test.pdf";
CGFloat dpi = 200;
PDFDocument *doc = [[PDFDocument alloc] initWithURL:[NSURL fileURLWithPath:target]];
NSUInteger pageCount = [doc pageCount];
@hiroyuki-sato
hiroyuki-sato / file_system_book.md
Last active November 22, 2024 14:52
linuxのディスクI/O周りやxfsのソースコードを読めるようになるためのおすすめの参考資料募集中です