Skip to content

Instantly share code, notes, and snippets.

package main
import (
"context"
"encoding/json"
"fmt"
"net/http"
"os"
"golang.org/x/oauth2"
@YujiSoftware
YujiSoftware / HashMap.java
Created March 23, 2025 15:05
HashMap の実装 (Java 1.2.2)
/*
* @(#)HashMap.java 1.30 01/11/29
*
* Copyright 2002 Sun Microsystems, Inc. All rights reserved.
* SUN PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
*/
package java.util;
import java.io.*;
@YujiSoftware
YujiSoftware / Makefile
Last active February 22, 2025 14:37
Hello world! (by x86-64)
NAME = hello.bin
CC = gcc
SRCS = hello.S
OBJS = $(SRCS:.S=.o)
$(NAME) : $(OBJS)
$(LD) -e main -o $(NAME) $(OBJS)
clean :
$(RM) $(OBJS)
@YujiSoftware
YujiSoftware / metadata.json
Last active December 7, 2024 13:26
Rocky Linux 9.5 for Vagrant
{
"name": "rockylinux/9",
"description": "",
"short_description": "",
"versions": [
{
"version": "4.0.1",
"description_html": "<p><a href=\"https://docs.rockylinux.org/release_notes/9_5/\" rel=\"nofollow\">https://docs.rockylinux.org/release_notes/9_5/</a></p>\n",
"description_markdown": "https://docs.rockylinux.org/release_notes/9_5/",
"providers": [
@YujiSoftware
YujiSoftware / Main.java
Last active November 3, 2024 12:55
WebKit由来のソースコード行数を調べる
package yuji.software;
import java.io.*;
import java.nio.file.Files;
import java.nio.file.Path;
import java.time.OffsetDateTime;
import java.time.ZoneOffset;
import java.util.Optional;
import java.util.function.Predicate;
import java.util.stream.Stream;
@YujiSoftware
YujiSoftware / Module1.bas
Last active August 30, 2024 00:39
Excel から Redmine の情報を取得する方法
Option Explicit
Const API = "http://192.168.1.101/redmine/issues/"
Sub ボタン1_Click()
Dim i As Integer
i = 2
Do While Cells(i, 1) <> ""
'エラー処理ルーチン無効化
@YujiSoftware
YujiSoftware / migrate.rb
Last active May 6, 2024 08:19
Migrate CompatibilityTable to Compat macro on MDN
base = ARGV[0]
en_base = ARGV[1]
regexp = /\{\{\s*Compat\s*\(?.*\}\}/i
Dir.glob("**/*.html", base: base).each do |path|
file = File.join(base, path)
next if not FileTest.file?(file)
content = File.read(file)
@YujiSoftware
YujiSoftware / NG1.java
Created December 13, 2023 16:02
Java の文字列リテラルの最大長は?
import java.nio.charset.StandardCharsets;
public class NG1 {
public static void main(String[] args) {
String str = "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
@YujiSoftware
YujiSoftware / MH-Z19B.ino
Last active July 15, 2023 12:45
Measure carbon dioxide (Co2) concentration with M5StickC and MH-Z19B
#include <M5StickC.h>
#include "MHZ19.h"
#define RX_PIN 36 // Rx pin which the MHZ19 Tx pin is attached to
#define TX_PIN 26 // Tx pin which the MHZ19 Rx pin is attached to
#define BAUDRATE 9600 // Device to MH-Z19 Serial baudrate (should not be changed)
#define LCD_MODE_DIGIT 0
#define LCD_MODE_GRAPH 1
@YujiSoftware
YujiSoftware / Main.class
Last active May 27, 2023 15:05
javap -v Main.java
Classfile /home/yuji/repos/gist/jjug_ccc_2023/sample/com/example/Main.class
Last modified 2023/05/28; size 426 bytes
SHA-256 checksum 2887486397f85a098cd8908463d9499351497938089eafc72988a5cbaf4b55e0
Compiled from "Main.java"
public class com.example.Main
minor version: 0
major version: 64
flags: (0x0021) ACC_PUBLIC, ACC_SUPER
this_class: #21 // com/example/Main
super_class: #2 // java/lang/Object