Skip to content

Instantly share code, notes, and snippets.

@ryu1
ryu1 / removeEventsOnHolidays.gs
Last active November 10, 2025 01:50
google app scripts for calendar
function removeEventsOnHolidays() {
// 評価期間:現在〜1年後
const now = new Date();
const oneYearLater = new Date(now);
oneYearLater.setFullYear(now.getFullYear() + 1);
keywords = ["event name 1", "event name 2"];
// Googleが公開している日本の祝日カレンダー
const holidayCalendar = CalendarApp.getCalendarById("ja.japanese.official#holiday@group.v.calendar.google.com");
@ryu1
ryu1 / aes-crypto.js
Last active June 4, 2025 11:00
Implementation of AES encryption/decryption in GraalJS
const JavaBase64 = Java.type("java.util.Base64");
const JavaCipher = Java.type("javax.crypto.Cipher");
const JavaIvParameterSpec = Java.type("javax.crypto.spec.IvParameterSpec");
const JavaSecretKeySpec = Java.type("javax.crypto.spec.SecretKeySpec");
const JavaString = Java.type("java.lang.String");
const JavaSystem = Java.type("java.lang.System");
const JavaArrays = Java.type("java.util.Arrays");
const JavaArray= Java.type("java.lang.reflect.Array");
const JavaMethod = Java.type("java.lang.reflect.Method");
const CHARSET_NAME = Object.freeze({
/**
* Converts a string to a byte array using the UTF-8 encoding scheme, ensuring each byte fits in the signed range.
* In GraalJS, you cannot call java.lang.String#getBytes(). Use this instead.
* For details, see https://github.com/oracle/graaljs/issues/708
* @param {string} str - The input string to be converted.
*
* @returns {number[]} - The byte array representation of the input string.
*
* @throws {Error} - If an error occurs during the conversion.
*
@ryu1
ryu1 / big_file_encryption.bash
Created April 30, 2023 08:49
Big file encryption
# 秘密鍵を作成する(パスフレーズ有り)
openssl genrsa -aes256 4096 > private.key
# X.509 証明書生成 (自己署名証明書)
openssl req -new -x509 -key private.key -out cert.pem -days 36500 -subj /CN="sample"
# 証明書情報の確認
openssl x509 -noout -subject -dates -in cert.pem
# 暗号化
@ryu1
ryu1 / jdk8_download.sh
Created November 30, 2022 03:25 — forked from apiOmat/jdk8_download.sh
JDK8 command line download script; For JDK10, please check: https://gist.github.com/P7h/9741922
##### ##### ##### ##### ##### ##### ##### ##### ##### ##### ##### ##### ##### ##### ##### ##### #####
### Shell script to download Oracle JDK / JRE / Java binaries from Oracle website using terminal / command / shell prompt using wget / curl.
### You can download all the binaries one-shot by just providing one BASE_URL.
### Script might be useful if you need Oracle JDK on Amazon EC2 env.
### Script is updated for every JDK release.
### Features:-
# 1. Resumes a broken / interrupted [previous] download, if any.
# 2. Renames the file to a proper name with including platform info.
@ryu1
ryu1 / osc52.sh
Created November 7, 2022 08:17
クリップボードを操作するエスケープシーケンス
#!/bin/sh
# Copyright (c) 2012 The Chromium OS Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
# Max length of the OSC 52 sequence. Sequences longer than this will not be
# sent to the terminal.
OSC_52_MAX_SEQUENCE="100000"
# Write an error message and exit.
# Usage: <message>
die() {
package test;
import org.dbunit.DefaultOperationListener;
import org.dbunit.IDatabaseTester;
import org.dbunit.IOperationListener;
import org.dbunit.JdbcDatabaseTester;
import org.dbunit.database.DatabaseConfig;
import org.dbunit.database.IDatabaseConnection;
import org.dbunit.dataset.IDataSet;
import org.dbunit.dataset.ReplacementDataSet;
@ryu1
ryu1 / migration-m6i.large.md
Created May 13, 2022 06:48
m5.largeからm6i.largeに変更する手順
@ryu1
ryu1 / prevent-multiple-form-submission.js
Last active September 14, 2021 00:53
javascript code to prevent multiple form submission for django
window.addEventListener("load", function() {
(function ($) {
$(function () {
$('form').submit(function () {
$(this).find('input[type="submit"], button[type="submit"]').prop('disabled', 'true');
});
});
})(django.jQuery);
});

HTML-TIPS


上下中央揃え

<style type="text/css">
html, body {
	height: 100%;
}