Skip to content

Instantly share code, notes, and snippets.

View nukopy's full-sized avatar

Yosuke Okuwaki nukopy

View GitHub Profile
@nukopy
nukopy / EventBus.cs
Created November 7, 2025 13:06
電脳ノマチ:NATS.Net 実装例
using System;
using System.Collections.Concurrent;
using System.Collections.Generic;
using System.Text.Json;
using System.Text.Json.Serialization;
using System.Threading;
using System.Threading.Tasks;
using UnityEngine;
using NATS.Client.Core;
@nukopy
nukopy / latex-in-markdown-for-pandoc.md
Created October 5, 2025 17:41
Image storage for LaTeX in Markdown for Pandoc
image
@nukopy
nukopy / multi_thread_signal_handling.c
Last active September 27, 2025 08:44
C 言語でのマルチスレッドにおけるシグナルハンドリング
#include <pthread.h>
#include <signal.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
/* サンプルコードの目的: マルチスレッド環境でのシグナルの扱いを理解する
*
* ## シグナルを扱うための関数の説明
@nukopy
nukopy / sigset_basic.c
Last active September 26, 2025 20:35
シグナル集合の操作
#define _POSIX_C_SOURCE 200809L
#include <signal.h>
#include <stdio.h>
/*
* sigset_basic.c
* --------------
* 目的: sigset_t の操作だけを目で追えるようにするシンプルなデモ。
* シグナルハンドラや sigprocmask は使わず、集合操作の結果を表示する。
@nukopy
nukopy / learn_struct_pointer.c
Created September 22, 2025 07:28
C 言語の構造体変数と構造体ポインタの動作検証
#include <limits.h>
#include <stdbool.h>
#include <stdlib.h>
#include <stdint.h>
#include <stdio.h>
#ifndef DEVICE_NAME_LENGTH
#define DEVICE_NAME_LENGTH 32
#endif
@nukopy
nukopy / race_condition_demo.c
Created September 21, 2025 17:53
C 言語でのマルチスレッドプログラミングでデータ競合を起こす
#include <stdio.h>
#include <pthread.h>
#include <unistd.h>
#include <string.h>
struct net_device {
unsigned int index;
char name[16];
};
@nukopy
nukopy / logger.py
Last active September 19, 2025 16:51
Python でのロガーの設定とそのテスト
"""アプリケーション共通のロギング設定."""
from __future__ import annotations
import logging
import os
from typing import Final
LOGGER_NAME: Final[str] = "app.logging_config"
@nukopy
nukopy / ci.yml
Created May 25, 2024 17:09
CI workflow in Rust projects on GitHub Actions
name: CI
on:
push:
branches:
- main
paths-ignore:
- "**.md"
- ".gitignore"
pull_request:
@nukopy
nukopy / sample_num_cpus.rs
Created June 19, 2023 17:50
Get the number of logical / physical cores in Rust
// ref: https://docs.rs/num_cpus/latest/num_cpus/fn.get.html
fn main() {
let logical_cpus = num_cpus::get();
let physical_cpus = num_cpus::get_physical();
println!("Logical CPUs: {}", logical_cpus);
println!("Physical CPUs: {}", physical_cpus);
/*
if logical_cpus > physical_cpus {
@nukopy
nukopy / .gitignore.unity
Created March 3, 2023 15:57
.gitignore for Unity
## User Settings
.DS_Store
## Rider
.idea
## for build
# Roulette/Roulette_iOS*/**
# !Roulette/Roulette_iOS*/.gitkeep