Skip to content

Instantly share code, notes, and snippets.

@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 / 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
@YujiSoftware
YujiSoftware / specifications.rb
Created November 23, 2022 07:27
Removed old spec macros and insert specifications macro. For https://github.com/mdn/translated-content/issues/5618
#!/bin/env ruby
content_dir = File.expand_path(ARGV[0])
translated_dir = File.expand_path(ARGV[1])
Dir.glob("**/*.md", base: translated_dir).each do |path|
content_file = "#{content_dir}/#{path}"
translated_file = "#{translated_dir}/#{path}"
has = false
#!/bin/env ruby
require 'yaml'
require 'json'
removed = Hash.new { |hash, key| hash[key] = 0 }
ARGV.each do |base|
Dir.glob(["**/*.html", "**/*.md"], base: base).each do |path|
file = File.join(base, path)
@YujiSoftware
YujiSoftware / Main.java
Last active December 14, 2021 16:54
ラムダのコンパイル結果を5分で説明するよ
import java.lang.String;
import java.util.Arrays;
import java.util.Collections;
import java.util.Comparator;
import java.util.List;
public class Main {
public static void main(String[] args) {
sortByLength(Arrays.asList(args));
}
diff --git a/files/ja/mozilla/add-ons/webextensions/api/alarms/alarm/index.html b/files/ja/mozilla/add-ons/webextensions/api/alarms/alarm/index.html
index 6d91ff819..56bbda4ba 100644
--- a/files/ja/mozilla/add-ons/webextensions/api/alarms/alarm/index.html
+++ b/files/ja/mozilla/add-ons/webextensions/api/alarms/alarm/index.html
@@ -34,9 +34,3 @@ translation_of: Mozilla/Add-ons/WebExtensions/API/alarms/Alarm
<p>{{Compat("webextensions.api.alarms.Alarm")}}</p>
-<p>{{WebExtExamples}}</p>
-
@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 / 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
using System;
using System.Collections;
using System.Collections.Generic;
using System.Linq;
namespace ConsoleApplication1
{
static class LINQ
{
static void Main(String[] args)
@YujiSoftware
YujiSoftware / Kiyoshi.java
Created December 3, 2019 15:15
ズンドコキヨシ (Java)
import java.util.Random;
public enum Kiyoshi {
ズン, ドコ;
private static final Kiyoshi[] answer = new Kiyoshi[] { ズン, ズン, ズン, ズン, ドコ };
public static void main(String[] args) {
Random random = new Random();
int index = 0;