Skip to content

Instantly share code, notes, and snippets.

View darallium's full-sized avatar
😆

darallium darallium

😆
  • Ritsumeikan Univ
  • Japan, Osaka
  • 11:34 (UTC +09:00)
View GitHub Profile
@darallium
darallium / cachehound-setup.sh
Last active June 11, 2026 21:43
cachehound setup
#!/bin/bash
sudo apt update
sudo apt install curl -y
curl https://sh.rustup.sh | sh
cargo install --locked ghr
ghr clone github.com:p-ranav/argparse
ghr clone github.com:gabime/spdlog
@darallium
darallium / fix_all_apps.ps1
Created May 20, 2026 06:17
reinstall all installed windows package apps
Get-AppxPackage -AllUsers |
Where-Object {
$_.InstallLocation -and
(Test-Path "$($_.InstallLocation)\AppxManifest.xml")
} |
Group-Object PackageFamilyName |
ForEach-Object {
$_.Group |
Sort-Object Version -Descending |
Select-Object -First 1
@darallium
darallium / gh-stat.py
Created February 15, 2026 02:34
run `span.py --since 2025-04-01 --until 2026-04-01 --dir repos --out out.csv`
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
import os
import sys
import csv
import json
import shutil
import subprocess
from pathlib import Path
#!/bin/bash
set -euo pipefail
cd $(dirname $0)
LOG_DIR="./log"
LOG_NAME="build-log"
ELOG_NAME="build-elog"
LOG_FILE="${LOG_DIR}/${LOG_FILE}"
ELOG_FILE="${LOG_DIR}/${ELOG_FILE}"
if [ ! -d "$LOG_DIR" ]; then
#include <stdint.h>
#include <stdio.h>
#include <math.h>
#include <time.h>
int fast_approx_log10(float x, uint32_t C_offset, uint32_t C_mult) {
uint32_t X = *(uint32_t*)&x;
uint64_t diff = (uint64_t)X - C_offset;
uint32_t shift = (uint32_t)((diff * C_mult) >> 32);
" ================================================================================
" 基本設定
" ================================================================================
" リーダーキーの設定
let mapleader = " "
" ================================================================================
" IdeaVim 基本オプション
" ================================================================================
{
"claude_code_permissions": {
"version": "1.0",
"description": "CLAUDE Code execution permissions for safe code development",
"categories": {
"SAFE": {
"description": "Commands that are safe to run in development contexts",
"auto_allow": true,
"commands": [
"ls", "cat", "head", "tail", "grep", "find", "which", "type", "file", "stat",
{
"claude_git_permissions": {
"version": "1.0",
"description": "CLAUDE Code Git execution permissions for safe Git operations",
"categories": {
"SAFE": {
"description": "Git commands that are safe for read-only operations and basic development",
"auto_allow": true,
"commands": [
"git help", "git version", "git --version",
@darallium
darallium / cuda-vs-py.ps1
Created May 5, 2025 15:20
どうやら最近のPythonライブラリ系でCUDAを強制するのは環境変数に対する依存がある模様
powershell.exe -NoExit -Command " $ENV:FORCE_CMAKE='1'; $ENV:CMAKE_ARGS='-DGGML_CUDA=on'; &{Import-Module """C:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\Common7\Tools\Microsoft.VisualStudio.DevShell.dll"""; Enter-VsDevShell 4a9b1b4f -SkipAutomaticLocation -DevCmdArguments """-arch=x64 -host_arch=x64"""}"
@darallium
darallium / self-sign.ps1
Created March 29, 2025 13:56
自己署名するコマンドを作成するps1
$plc = $MyInvocation.MyCommand.Path
function global:SelfSign-Script {
param(
[string]$MyPs1
)
if (!([Security.Principal.WindowsPrincipal][Security.Principal.WindowsIdentity]::GetCurrent()).IsInRole("Administrators")) {
Start-Process -Verb RunAs -FilePath "pwsh.exe" -ArgumentList "-ExecutionPolicy", "RemoteSigned", "-NoProfile", "-NoExit", "-Command", "$plc;", "SelfSign-Script $MyPs1", ";Read-Host -Prompt 'Press Enter to exit'", ";exit"
}