Skip to content

Instantly share code, notes, and snippets.

View 27Cobalter's full-sized avatar

27Cobalter / Takumi Kondo 27Cobalter

View GitHub Profile
#include <iostream>
#include <format>
#include <concepts>
#include <span>
#include <valarray>
#include <stdfloat>
#include <chrono>
#include <memory>
#include <new>
#include <random>
#include <chrono>
#include <valarray>
#include <format>
#include <iostream>
#include <memory>
#include <random>
#include <ranges>
#include <immintrin.h>
#include <omp.h>
@27Cobalter
27Cobalter / clang-tidy.cc
Created January 18, 2024 12:57
clang_tidy_sample.cc
#include <iostream>
#include <cstdint>
// https://clang.llvm.org/extra/clang-tidy/checks/readability/identidifer-naming.html
/* .clang-tidy
*
* Checks: 'readability-identifier-naming'
* CheckOptions:
* - key: readability-identifier-naming.ClassCase
@27Cobalter
27Cobalter / Custom_Min_Max.java
Created November 29, 2023 16:03
imagejで一定範囲のmin, maxを求めるplugin
import ij.*;
import ij.gui.*;
import ij.measure.*;
import ij.plugin.*;
import ij.plugin.filter.*;
import ij.process.*;
import java.awt.*;
import java.util.Arrays;
public class Custom_Min_Max implements PlugIn {
@27Cobalter
27Cobalter / i2p
Last active May 11, 2021 04:45
画像をPDF化するやつ
#!/bin/bash
mkdir -p /tmp/i2p
/bin/rm -rf /tmp/i2p/*
find . -type d | xargs -I{} mkdir -p /tmp/i2p/{}
find . -type f -name "*.png" | xargs -I{} convert {} -background white -alpha remove -alpha off /tmp/i2p/{}
find /tmp/i2p -type f | sed -e 's/.*/\"&\"/g' | sort | xargs img2pdf --output ./out.pdf --auto-orient
/bin/rm -rf /tmp/i2p/*
@27Cobalter
27Cobalter / Unlit_Alpha_Trans_hide.shader
Last active October 27, 2022 04:22
KawaiiCameraをカメラで映らなくするシェーダ+最前面表示
// Upgrade NOTE: replaced 'mul(UNITY_MATRIX_MVP,*)' with 'UnityObjectToClipPos(*)'
// Unity built-in shader source. Copyright (c) 2016 Unity Technologies. MIT license (see license.txt)
// Unlit alpha-blended shader.
// - no lighting
// - no lightmap support
// - no per-material color
Shader "Custom/Unlit_Alpha_Trans_hide" {
@27Cobalter
27Cobalter / twitPicDL.py
Created November 5, 2019 13:44
ディレクトリのlist.txtにかかれているURLのパラメータをpngのlargeにしてダウンロードするスクリプト
# pip install requests
import requests
import urllib.parse
if __name__ == "__main__":
with open("list.txt") as f:
lines=f.readlines()
for i in range(len(lines)):
pr=urllib.parse.urlparse(lines[i])
qs=urllib.parse.parse_qs(pr.query)
@27Cobalter
27Cobalter / Steam2VRC.sh
Last active October 31, 2018 17:12
Steam側でスクショした名前形式をVRCCamera側の名前形式に変換するクソスクリプト
#!/bin/bash
# ディレクトリ構造
# |-Steam2VRC.sh
# |-VRChat_steam //src
# |-VRChat_camera //dst
for pic in `ls VRChat_steam/ | grep -v vr | grep jpg`;do
new_pic=`echo $pic | awk '{print("VRChat_camera/VRChat_1920x1080_"substr($0,1,4)"-"substr($0,5,2)"-"substr($0,7,2)"_"substr($0,9,2)"-"substr($0,11,2)"-"substr($0,13,2)".000.jpg")}'`
if [ -e $new_pic ];then
echo "skip $new_pic"
else
void evalute_formation() {
std::cout << "\033[13;0H\e[J" << std::endl;
const auto visible_robots =
static_cast<bool>(team_color_) ? world_.robots_yellow() : world_.robots_blue();
if (mode == test::formation) {
if (!formation_) reset_formation();
auto agents = formation_->execute();
for (auto agent : agents) {
std::string agent_name = typeid(*agent).name();
auto actions = agent->execute();
@27Cobalter
27Cobalter / voice.sh
Last active May 2, 2018 16:47
いい感じのディテクトリ構造にする
#!/bin/bash
# Usage: $ voice.sh dir
dir=$1
cd $1
mkdir etc game_command stage_name
array=("stage_name/normal_first_half" "stage_name/normal_half_time" "stage_name/normal_second_half" "stage_name/extra_first_half" "stage_name/extra_half_time" "stage_name/extra_second_half" "stage_name/penalty_shootout" "stage_name/post_game" "game_command/halt" "game_command/stop" "game_command/normal_start" "game_command/force_start" "game_command/prepare_kickoff_yellow" "game_command/prepare_kickoff_blue" "game_command/prepare_penalty_yellow" "game_command/prepare_penalty_blue" "game_command/direct_free_yellow" "game_command/direct_free_blue" "game_command/indirect_free_yellow" "game_command/indirect_free_blue" "game_command/timeout_yellow" "game_command/timeout_blue" "game_command/goal_yellow" "game_command/goal_blue" "game_command/ball_placement_yellow" "game_command/ball_placement_blue" "etc/red_card_yellow" "etc/red_card_blue" "etc/yellow_card_yellow" "etc/yellow_card_blue" "etc/yellow_card_timeup_yellow" "etc/yellow_car