Skip to content

Instantly share code, notes, and snippets.

View rdlabo's full-sized avatar

Masahiko Sakakibara rdlabo

View GitHub Profile

以下のレシピから、食品表示ラベルに必要な情報を生成してください。

【生成ルール】

  1. 商品名(productName): レシピから適切な商品名を生成。シンプルで分かりやすい名前にする。
  2. 名称(categoryName): 食品表示法に基づく正式な食品分類名(例:惣菜、菓子、調理パン、弁当、漬物、佃煮、煮豆、調味料、ジャム類など)
  3. 原材料名(ingredients):
    • 重量の多い順に記載(レシピの分量から推測)
    • アレルゲンは「(〇〇を含む)」形式で各原材料の後に表示
    • 添加物は「/」で区切って記載
  • 一般的な名称を使用(例:「グラニュー糖」→「砂糖」、「薄力粉」→「小麦粉」)

以下の食品ラベルデータを分析し、日本の食品表示法に準拠するための修正提案を行ってください。

【現在のデータ】

  • 商品名: ${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);