This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import sys | |
| import openai | |
| import json | |
| def run_conversation(input): | |
| content = f""" | |
| ダジャレの面白さをAからEに評価して、評価の理由を論理的にコメントします。 | |
| ダジャレ:{input} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| package com.example.openaikotlintest | |
| import com.aallam.openai.api.BetaOpenAI | |
| import com.aallam.openai.api.chat.ChatCompletionRequest | |
| import com.aallam.openai.api.chat.ChatMessage | |
| import com.aallam.openai.api.chat.ChatRole | |
| import com.aallam.openai.api.http.Timeout | |
| import com.aallam.openai.api.model.ModelId | |
| import com.aallam.openai.client.OpenAI | |
| import com.aallam.openai.client.OpenAIConfig |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import { connect } from 'cloudflare:sockets'; | |
| export default { | |
| async fetch(req, env) { | |
| const socket = connect({ | |
| hostname: 'neverssl.com', | |
| port: 80 | |
| }); | |
| const writer = socket.writable.getWriter() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import asyncio | |
| import uuid | |
| import semantic_kernel as sk | |
| import semantic_kernel.ai.open_ai as sk_oai | |
| KV = {} # DBのかわり | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // 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 | |
| })); | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // 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 }); | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // 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}`) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import {shallowMount} from '@vue/test-utils' | |
| import {useCounter} from "@/composables/counter"; | |
| const Example = { | |
| setup() { | |
| return { | |
| ...useCounter(0), | |
| } | |
| }, | |
| template: `example`, | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/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++ |