Skip to content

Instantly share code, notes, and snippets.

View frodo821's full-sized avatar
:octocat:
Working from home

frodo821

:octocat:
Working from home
View GitHub Profile
FROM ubuntu:20.04 as xorg
WORKDIR /workspace
ENV TZ="Asia/Tokyo" DEBIAN_FRONTEND="noninteractive"
RUN apt clean \
&& apt update \
&& apt install -y locales \
&& apt install -y -o Dpkg::Options::="--force-confdef" -o Dpkg::Options::="--force-confold" keyboard-configuration \
*{
background: white!important;
color: black;
}
.markdown-body code {
white-space: pre-wrap!important;
}
.markdown-body pre {
border: solid 2px;
}
@frodo821
frodo821 / __init__.py
Last active May 1, 2023 02:21
同階層、あるいはサブディレクトリにある `.json` ファイルを `import` できるようにする `__init__.py`
"""{description_for_this_resources_module}"""
import os
from os.path import join, dirname, relpath, isdir, splitext
from glob import iglob
import sys
from types import ModuleType
from typing import Any
from warnings import warn
[style]
based_on_style = "google"
column_limit = 120
indent_width = 2
continuation_indent_width = 2
split_before_closing_bracket = true
split_before_first_argument = true
dedent_closing_brackets = true
coalesce_brackets = true
@frodo821
frodo821 / brainfuck.js
Last active April 6, 2023 12:18
Brainfuck interpreter implementation in JavaScript
const insts = Object.freeze({
'>': '1',
'<': 'f',
'+': '2',
'-': 'd',
'.': '3',
',': 'e',
'[': '$',
']': '_',
});
@frodo821
frodo821 / 01.RandomTanka.ipynb
Last active April 4, 2023 13:38
ランダムな短歌を生成する
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
#include <math.h>
#include <string.h>
#include <sqlite3ext.h>
#include <stdlib.h>
#include <stdio.h>
#include <ctype.h>
SQLITE_EXTENSION_INIT1
typedef struct {
int ndims;
@frodo821
frodo821 / conlang-with-GPT4.md
Last active December 10, 2022 21:45
GPT4で人工言語を錬成する実験

Frodo821 I'm introducing you about a language called "Felpheay Aepheay." The language is strongly inflectional language and it has eight cases; nominative, vocative, dative, ablative, accusative, genitive, elative, allative. In addition, for the language, adjectives must have the same case, gender and number as nouns modified by itself. Verbs in Felpheay Aepheay has 3 tenses; present tense, past tense and future tense. And also has 3 forms; participle form, progressive form and perfect form. No tense with those forms and prepend the verb tep before verbs with forms and conjugate the verbs to express forms with tense. Also, I notify you that the basic sentence pattern in Felpheay Aepheay is SOV. And then, adjectives and nouns in Felpheay Aepheay have cases and change along the cases. There are four types of nouns: first feminine noun, second feminine noun, masculine noun, and neuter noun. Most of the second feminine nouns are place names, and the others are first feminine nouns. In addition, the pattern of dec

@frodo821
frodo821 / whea_report_analyser.cpp
Last active December 18, 2022 02:24
Windows Hardware Error Architecture (WHEA) Raw Report Analyser
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "whea_types.hpp"
const char *CPER_BIN_FILE = "CPER";
const char *CPER_ASCII_FILE = "43504552";
/**
* @brief base16エンコードされたファイルであるか、生のバイナリ形式のファイルであるかをチェックする
@frodo821
frodo821 / unittest.h
Last active November 5, 2023 01:39
Cヘッダファイル1つのみの簡易的なユニットテストライブラリ
#ifndef UTILS_UNITTEST_H_
#define UTILS_UNITTEST_H_
#include <stdio.h>
#if defined(linux) || defined(__linux__)
#include <linux/unistd.h>
#elif defined(unix) || defined(__unix__) || defined(__APPLE__)
#include <unistd.h>
#else
#error "Unsupported platform. This header can only be used on linux-like OS."
#endif