Skip to content

Instantly share code, notes, and snippets.

View kojix2's full-sized avatar
🔬
🧬 🖥️ ♋

kojix2

🔬
🧬 🖥️ ♋
View GitHub Profile
@kojix2
kojix2 / crystal.patch
Last active August 17, 2024 14:30
Investigate crystal compile time
diff --git a/src/compiler/crystal/compiler.cr b/src/compiler/crystal/compiler.cr
index 38880ee9e..c51e2c7ef 100644
--- a/src/compiler/crystal/compiler.cr
+++ b/src/compiler/crystal/compiler.cr
@@ -204,15 +204,28 @@ module Crystal
# Raises `InvalidByteSequenceError` if the source code is not
# valid UTF-8.
def compile(source : Source | Array(Source), output_filename : String) : Result
+ t1 = Time.monotonic
source = [source] unless source.is_a?(Array)
@kojix2
kojix2 / README.md
Last active August 11, 2024 23:47
Investigation of class_getter in crystal
git clone https://github.com/crystal-lang/crystal
git checkout b9ab9968b85ce2b99a875abd4360b1a432e27a98
cd crystal
grep -r class_getter
@kojix2
kojix2 / md5.cr
Created June 14, 2024 07:48
Crystal lang md5 check
require "digest/md5"
require "colorize"
# Get the filename from the command-line arguments
filename = ARGV[0]
# Change the directory to the location of the file
Dir.cd File.dirname(filename)
# Define a FileRecord structure to store the md5sum and file path
@kojix2
kojix2 / test_gzip_generator.c
Created May 8, 2024 06:36
Generate gzip file for testing Compress::Gzip ver1
#include <stdio.h>
#include <string.h>
#include <zlib.h>
#include <time.h>
int main()
{
char *filename = "test.gz";
char *contents = "One\nTwo";
int content_length = strlen(contents);
@kojix2
kojix2 / fuga.c
Last active May 8, 2024 06:31
GZIPのいろんなフラグが立ってるやつ
#include <stdio.h>
#include <string.h>
#include <zlib.h>
#include <time.h>
int main()
{
char *filename = "test.gz";
char *contents = "One\nTwo";
int content_length = strlen(contents);
@kojix2
kojix2 / bam_plp_auto.c
Last active May 2, 2024 11:52
bam_plp_autoの使用例
#include <stdio.h>
#include <stdlib.h>
#include <htslib/sam.h>
typedef struct {
samFile *fp;
bam_hdr_t *h;
} bam_file_handle;
static int process_reads(void *data, bam1_t *b) {

red-datasets-parquet

red-datasets-parquet is a Ruby gem that provides datasets in Apache Arrow's Parquet format. It includes datasets from New York City's Taxi and Limousine Commission (TLC) data, such as green and yellow taxi trip records.

Installation

You can install the red-datasets-parquet gem by adding the following line to your Gemfile:

@kojix2
kojix2 / catgpt.rb
Created March 2, 2023 03:08
CatGPT - Glimmer DSL LibUI
require 'glimmer-dsl-libui'
require 'ruby/openai'
class ChatGPT
class Message < Struct.new(:role, :content)
def role_color
[role, color]
end
def content_color
@kojix2
kojix2 / ddbj_sra_urls.rb
Created September 17, 2022 06:31
Get DDBJ SRA download URLs from BioProject id
# DDBJ SRA URL Getter
# author: kojix2
require 'net/http'
require 'json'
require 'tty-spinner'
project_id = ARGV[0]
if project_id.nil?
warn 'Error: No project name.'
@kojix2
kojix2 / winequality.ipynb
Created September 4, 2022 05:34 — forked from heronshoes/winequality.ipynb
Wine quality
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.