- アプリケーション開発の言語でIaCするCDKじゃないやつ
Define infrastructure in JavaScript, TypeScript, Python, Go, or any .NET language, including C#, F#, and VB.
- TypeScript事例が多い
- 個人は無料 https://www.pulumi.com/pricing/
| import asyncio | |
| import uuid | |
| import semantic_kernel as sk | |
| import semantic_kernel.ai.open_ai as sk_oai | |
| KV = {} # DBのかわり | |
| // Step 1 | |
| let nodes = Array.from(document.querySelectorAll('span span:not(:empty)')).filter(d => d.textContent != 'Remove'); | |
| for (const node of nodes) { | |
| node.dispatchEvent( new MouseEvent('mouseover', { | |
| bubbles: true, | |
| cancelable: true, | |
| view: window | |
| })); | |
| } |
| // api/post.ts | |
| export const config = { | |
| runtime: 'experimental-edge', | |
| } | |
| export default async (req: Request) => { | |
| if (req.method !== 'POST') { | |
| return new Response('Method not allowed', { status: 405 }); | |
| } |
| // pages/posts/[id].js | |
| export default function Page(props) { | |
| const router = useRouter() | |
| const [post, setPost] = useState(props.post) | |
| if (!post) { | |
| return <Locading /> | |
| } | |
| useEffect(async () => { | |
| if (!post) { | |
| const resp = fetch(`https://example.com/api/post/${router.params.id}`) |
| import { ref, inject, Ref } from 'vue'; | |
| export const CounterKey = Symbol() | |
| export type Counter = { | |
| count: Ref | |
| increment(): void | |
| } | |
| export function useCounter(initialValue: number): Counter { | |
| const count = inject(CounterKey, ref(initialValue)); | |
| return { | |
| count, |
| import {shallowMount} from '@vue/test-utils' | |
| import {useCounter} from "@/composables/counter"; | |
| const Example = { | |
| setup() { | |
| return { | |
| ...useCounter(0), | |
| } | |
| }, | |
| template: `example`, | |
| } |
| #!/bin/sh | |
| # $ ./findlist.bash jack | |
| id=$1 | |
| COUNTER="" | |
| while [ true ] | |
| do | |
| name="list${COUNTER}" | |
| curl -s "https://mobile.twitter.com/search?q=list%3A%40${id}%2F${name}&src=typed_query" | grep -s timeline > /dev/null && echo "list:@${id}/${name} HIT" || echo "list:@${id}/${name} MISS" | |
| let COUNTER++ |
| 第1章 Dockerの復習と「Hello, Kubernetes」 | |
| 第2章 なぜKubernetesが必要なのか? | |
| 第3章 Kubernetes環境の選択肢 | |
| 第4章 APIリソースとkubectl | |
| 第5章 Workloads APIsカテゴリ | |
| 第6章 Service APIsカテゴリ | |
| 第7章 Config&Storage APIsカテゴリ | |
| 第8章 Cluster APIsカテゴリとMetadata APIsカテゴリ | |
| 第9章 リソース管理とオートスケーリング | |
| 第10章 ヘルスチェックとコンテナのライフサイクル |
| import Vapor | |
| struct MyResponse: Content { | |
| let name: String | |
| } | |
| func routes(_ app: Application) throws { | |
| app.get { req in | |
| return MyResponse(name: "popo") | |
| } | |
| } |
Define infrastructure in JavaScript, TypeScript, Python, Go, or any .NET language, including C#, F#, and VB.