Skip to content

Instantly share code, notes, and snippets.

View rdlabo's full-sized avatar

Masahiko Sakakibara rdlabo

View GitHub Profile
@rdlabo
rdlabo / Recipe.md
Last active February 6, 2026 02:38

あなたは食品表示法の専門家。日本の食品表示法に基づき、以下のレシピから、食品表示ラベルに必要な情報を生成せよ。

レシピ

${recipe}

生成ルール

  1. 商品名(productName): レシピから適切な商品名を生成。シンプルで分かりやすい名前にする。
  2. 名称(categoryName): 食品表示法に基づく正式な食品分類名(例:惣菜、菓子、調理パン、弁当、漬物、佃煮、煮豆、調味料、ジャム類など)
  3. 原材料名(ingredients):
  • 重量の多い順に記載(レシピの分量から推測)
@rdlabo
rdlabo / Fixer.md
Last active February 6, 2026 02:37

あなたは食品表示法の専門家。日本の食品表示法に基づき、以下のデータの修正点を挙げよ。

現在のデータ

商品名: ${food.productName} 名称: ${food.categoryName} 原材料名: ${food.ingredients}

チェックポイント

1. 原材料名(ingredients)

  • 重量順は維持(間違いが明らかな場合は指摘)。一般的名称に統一(例:グラニュー糖→砂糖)
import { Signal, signal, WritableSignal } from '@angular/core';
import { IsArrayNullable, IsKnownRecordNullable, IsPrimitiveNullable } from './type-utils';
export type DeepModel<T> = IsPrimitiveNullable<T> extends true
? WritableSignal<T>
: IsArrayNullable<T> extends true
? { [K in keyof T]: DeepModel<T[K]> } & WritableSignal<T>
: IsKnownRecordNullable<T> extends true
? { [K in keyof T]: DeepModel<T[K]> } & WritableSignal<T>
@rdlabo
rdlabo / which-main-instance.ts
Last active October 11, 2023 06:17
Which Instance is main on Elastic Beanstalk ( NestJS )
@Injectable()
export class AwsService {
public async isMainInstance(): Promise<boolean> {
/*
* インスタンスメタデータを取得するための手続き。IMDSv2で実装。
* https://docs.aws.amazon.com/ja_jp/AWSEC2/latest/UserGuide/instancedata-data-retrieval.html
*/
const token = await firstValueFrom(
this.http
.put(
import { Component } from '@angular/core';
import { MenuController } from '@ionic/angular';
import { NgZone } from '@angular/core';
@Component({
selector: 'app-tab1',
templateUrl: 'tab1.page.html',
styleUrls: ['tab1.page.scss']
})
export class Tab1Page {
import { Component } from '@angular/core';
import { Plugins, MotionEventResult, MotionOrientationEventResult } from '@capacitor/core';
@Component({
selector: 'app-home',
templateUrl: 'home.page.html',
styleUrls: ['home.page.scss'],
})
export class HomePage {
alter table tweet drop index geom;
alter table tweet modify geom geometry not null SRID 4326 ;
alter table tweet add spatial index(geom);
UPDATE tweet
SET
geom = CASE
WHEN
area_type = 1
THEN
package jp.rdlabo.capacitor.plugin.screenshotevent;
import com.getcapacitor.JSObject;
import com.getcapacitor.NativePlugin;
import com.getcapacitor.Plugin;
import com.getcapacitor.PluginCall;
import com.getcapacitor.PluginMethod;
import com.getcapacitor.util.HostMask;
import android.os.FileObserver;
@rdlabo
rdlabo / memo.swift
Last active January 14, 2020 06:09
import Foundation
import Capacitor
import AVFoundation
/**
* Please read the Capacitor iOS Plugin Development Guide
* here: https://capacitor.ionicframework.com/docs/plugins/ios
*/
@objc(MlkitPlugin)
@rdlabo
rdlabo / reload.ts
Created September 2, 2019 04:16
reload
let isAlert = false;
setTimeout(() => {
if (!isAlert) {
// Alertをだしてユーザが選択したらreload
}
}, 2000); <= Timeout時間
this.afAuth.auth.currentUser.getIdToken(false)
.then()
.finally(() => isAlert = true);