Skip to content

Instantly share code, notes, and snippets.

@1206yaya
1206yaya / August 29, 2024.md
Last active August 28, 2024 23:51
gistpad-scratch
tag
personal
arb-dir: lib/l10n
template-arb-file: app_en.arb
# `synthetic-package: false` に設定することで、ローカライズコードが特定のディレクトリに生成され、
# 生成されたコードを使ってローカライズされた文字列にアクセスできるようになります。
synthetic-package: false
output-dir: lib/localization/intl
output-localization-file: app_localizations.dart
import re
import shutil
import os
import sys
import yaml
def ensure_directories(zenn_articles_dir, zenn_images_dir):
"""必要なディレクトリが存在するか確認し、なければ作成する。"""
os.makedirs(zenn_articles_dir, exist_ok=True)
os.makedirs(zenn_images_dir, exist_ok=True)
@1206yaya
1206yaya / launch.json
Created September 12, 2023 10:18
fireabse-project-root/functions/.vscode
{
"version": "0.2.0",
"configurations": [
{
"type": "node",
"request": "attach",
"name": "Attach to Functions",
"port": 9229
}
]
@1206yaya
1206yaya / index.ts
Last active August 31, 2023 21:00
Firebase Cloud Functions
import * as admin from "firebase-admin"
import * as functions from "firebase-functions"
import * as logger from "firebase-functions/logger"
import * as firestore from "@google-cloud/firestore"
// This file: https://gist.github.com/1206yaya/06cb8603ffd831f78ef572df7474e008
// const SECRET_NAME = defineString('SECRET_NAME');
// https://firebase.google.com/docs/functions/typescript
export const helloWorld = functions.https.onRequest((request, response) => {
@1206yaya
1206yaya / main.dart
Created October 22, 2022 01:00
LayoutWidgetのサンプル
import 'package:flutter/material.dart';
/// Container: デフォルトでは幅や高さを持たず、子要素の装飾ができる。
/// Column: childrenを垂直に配置。
/// Wrap: childrenにフィット。
/// Center: widthFactorを指定しなければ全体に広がる
///
void main() {
runApp(const MyApp());
}
@1206yaya
1206yaya / main.dart
Created October 20, 2022 23:41
keyboard modal
// https://stackoverflow.com/questions/71554829/textfield-in-modal
import 'package:flutter/material.dart';
void main() {
runApp(MyApp());
}
class MyApp extends StatelessWidget {
@override
Widget build(BuildContext context) {
@1206yaya
1206yaya / SpringbootService.service
Last active August 30, 2022 04:48
Osho Production Web
# File Location /etc/systemd/system/SpringbootService.service
[Unit]
Description=SpringbootService
[Service]
Type=simple
WorkingDirectory=/www/api
ExecStart=/www/api/exec.sh outside
ExecStop=/bin/kill -s QUIT $MAINPID
Restart=on-failure
User=root