Skip to content

Instantly share code, notes, and snippets.

View Colk-tech's full-sized avatar
🤒
Always sick

ITO Manaki (Colk) Colk-tech

🤒
Always sick
View GitHub Profile
@Colk-tech
Colk-tech / config.yml
Created December 18, 2020 16:21
Minecraftのサーバープラグインであるclear lagのメッセージ日本語化
#--------------------------------------------------------------------#
# ClearLag Configuration File #
#--------------------------------------------------------------------#
# Configure to your liking, reload the config by tying: /lagg reload #
# - #
# Here is a helpful tutorial on this configuration setup! (Updated) #
# http://dev.bukkit.org/bukkit-plugins/clearlagg/pages/config-setup/ #
#--------------------------------------------------------------------#
# All possible mob names: https://goo.gl/cch8YK #
#--------------------------------------------------------------------#
@Colk-tech
Colk-tech / 10_3_test_cases.txt
Last active January 3, 2021 20:42
学校の実験で使った結合テスト用のテストケース
A B C D Y
0 0 0 0 0
0 0 0 0 0
0 0 0 0 0
0 0 0 0 0
0 0 0 1 0
0 0 0 1 0
0 0 0 1 0
0 0 0 1 0
0 0 1 0 0
@Colk-tech
Colk-tech / prime_factorization.py
Created January 18, 2021 09:55
学校の情報理論の副産物です。整数をできるだけ大きい2つの素数に分解します。
from typing import Tuple
from sympy import sieve
def prime_factorization(n: int) -> Tuple[int, int]:
if n < 0:
raise RuntimeError("Invalid number has passed. Please specify number in the range: 1~")
first_factor = find_greatest_factor(n)
@Colk-tech
Colk-tech / haracho_arch.py
Created February 9, 2021 14:53
@approver のはらちょBOT様DiscordBOTの雛形です
import os
import discord
class MainClient(discord.Client):
def __init__(self, token: str):
intents = discord.Intents.all()
intents.members = True
super(MainClient, self).__init__(presences=True, guild_subscriptions=True, intents=intents)
@Colk-tech
Colk-tech / random4Letters0x.go
Created March 19, 2021 15:38
ランダムで4桁の16進数を生成します
package main
import (
"fmt"
"math/rand"
"time"
)
const letters = "0123456789ABCDEF"
@Colk-tech
Colk-tech / proxy.pac
Last active June 16, 2021 00:08
iOSでもSocksが使いたい!
function FindProxyForURL(url, host) {
return "SOCKS 172.16.226.147:1080";
}
@Colk-tech
Colk-tech / sort_int_array.c
Created April 10, 2021 15:08
intの配列を昇順にソートするプログラム (A program that sorts array of int in ASCENDING order)
int is_sorted(int target_array[], int array_length) {
for (int i = 0; i < array_length - 1; i++) {
if (target_array[i] > target_array[i+1]) {
return 0;
}
}
return 1;
}
@Colk-tech
Colk-tech / mylib.c
Last active May 13, 2021 00:11
学校の授業でよく使うマクロをまとめたテンプレートです。
//
// Created by Manaki ITO on 2021/05/07.
//
#include <stdio.h>
#include <stdlib.h>
#define print_green(...) {printf("\x1b[32m"); printf(__VA_ARGS__); printf("\x1b[39m\n");}
#define print_yellow(...) {printf(" \x1b[33m"); printf(__VA_ARGS__); printf("\x1b[39m\n");}
#define print_error(...) {fprintf(stderr, "\x1b[31m"); fprintf(stderr, __VA_ARGS__); fprintf(stderr, "\x1b[39m\n");}
#define fatal(exit_code, ...) {print_error(__VA_ARGS__); exit(exit_code);}
@Colk-tech
Colk-tech / read_line_from.c
Last active June 17, 2021 15:17
A useful library to read a file which is variable length. Written in C.
//
// Created by Manaki ITO on 2021/06/17.
//
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#define DEFAULT_STR_BUFFER_LENGTH 512
#define DEFAULT_BUFFER_BYTES DEFAULT_STR_BUFFER_LENGTH * sizeof(char)
@Colk-tech
Colk-tech / nitic-class.txt
Last active June 24, 2021 13:23
茨城高専のクラスにマッチする正規表現です (2021年度現在) 用途は完全に謎です
([1-2]-[1-5])|([3-5](M[1-2]|E|I|C))