Skip to content

Instantly share code, notes, and snippets.

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
# curl -o /etc/nginx/conf.d/jenkins.conf https://gist.githubusercontent.com/1206yaya/3b953e7d6df431f306c3255ca43161ef/raw/9053808d295db944f5d102416ad0fe64abc8a90a/gistfile1.txt
upstream jenkins {
server 127.0.0.1:8080;
}
server {
listen 80 default;
server_name sample.jenkins;
access_log /var/log/nginx/access.log;
@1206yaya
1206yaya / index.html
Last active May 29, 2022 00:13 — forked from jcollins-g/index.html
DartPad
<!-- Copyright 2011 the Dart project authors. All rights reserved.
Use of this source code is governed by a BSD-style license
that can be found in the LICENSE file. -->
<h2>Dr. Fibonacci's Sunflower Spectacular</h2>
<div>
<canvas id="canvas" width="300" height="300"></canvas>
</div>
@1206yaya
1206yaya / jenkins.Dockerfile
Last active April 16, 2020 23:03
JenkinsでDockerをつかえるように
FROM jenkins/jenkins:lts
# Install plugins
COPY ./plugins.txt /usr/share/jenkins/ref/plugins.txt
RUN /usr/local/bin/install-plugins.sh < /usr/share/jenkins/ref/plugins.txt
USER root
RUN apt-get update
##### Docker install START >>>
# 前提ソフトウェアのインストール
@1206yaya
1206yaya / cloudSettings
Last active November 17, 2020 03:54
Visual Studio Code Settings Sync Gist
{"lastUpload":"2020-11-17T03:54:22.356Z","extensionVersion":"v3.4.3"}