Skip to content

Instantly share code, notes, and snippets.

View darallium's full-sized avatar
😆

darallium darallium

😆
  • Ritsumeikan Univ
  • Japan, Osaka
  • 12:07 (UTC +09:00)
View GitHub Profile
@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"
}
import logging
from colorama import init, Fore, Back
init(autoreset=True)
class ColorFormatter(logging.Formatter):
COLORS = {
"WARNING": Fore.RED,
"ERROR": Fore.RED + Back.WHITE,
@darallium
darallium / Change TS to MP4.ps1
Created March 5, 2025 21:20
目下の.tsをあんまり損失無いように.mp4コンテナに詰め込むpowershell script
Get-ChildItem -Path . -Recurse -Filter "*.ts" | ForEach-Object {
$tmp = $_.FullName -replace "\.ts$", ".mp4"
$bitrate = ffprobe -v error -select_streams v:0 -show_entries format=bit_rate -of default=noprint_wrappers=1:nokey=1 "$_"
if ([string]::IsNullOrEmpty($bitrate)) {
$bitrate = "2000000" # default: 2mbps
}
Write-Output "変更ファイル:$($_.BaseName)"
Write-Output "ビットレート:$bitrate"
# 1パス目
ffmpeg -v error -stats -i "$_" -c:v hevc_nvenc -preset slow -b:v 0 -pass 1 -an -f null /dev/null