This file contains 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 { Hono } from 'hono' | |
import { CloudflareVectorizeStore } from "langchain/vectorstores/cloudflare_vectorize"; | |
import { OpenAIEmbeddings } from "langchain/embeddings/openai"; | |
import { ChatOpenAI } from "langchain/chat_models/openai"; | |
import { Document } from 'langchain/document'; | |
import { | |
RunnablePassthrough, | |
RunnableSequence, | |
} from "langchain/schema/runnable"; | |
import { StringOutputParser } from "langchain/schema/output_parser"; |
This file contains 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 { createContext, FC, PropsWithChildren, useContext, useEffect, useRef, useState } from "react"; | |
import { Liff } from '@line/liff' | |
const LiffContext = createContext<{ | |
liff?: Liff | |
}>({}) | |
export const useLiff = () => useContext(LiffContext) | |
export const LiffProvider: FC<PropsWithChildren<{ |
This file contains 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 { normalizeForStripeConnect } from './format-address.ts' | |
test.each([ | |
['大阪府堺市北区新金岡町4丁1−8', { | |
state: "大阪府", | |
city: "堺市北区", | |
town: "新金岡町四丁", | |
line1: "1-8" | |
}], | |
["神奈川県横浜市中区本町6丁目50−10", { |
This file contains 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 { NestApplicationOptions, INestApplication } from '@nestjs/common'; | |
import { NestFactory } from '@nestjs/core'; | |
import { Server } from 'http'; | |
import { ExpressAdapter } from '@nestjs/platform-express'; | |
import * as serverless from 'aws-serverless-express'; | |
import * as express from 'express'; | |
import { APIGatewayProxyEvent, Context, APIGatewayEvent } from 'aws-lambda'; | |
let cachedServer: Server; |
This file contains 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 { CloudFront } from 'aws-sdk' | |
import DistributionSummaryList = CloudFront.DistributionSummaryList | |
const cfClient = new CloudFront() | |
/** | |
* @example | |
* const distributions = await listAllDistributions() | |
**/ | |
const listAllDistributions = async (distributions: DistributionSummaryList = [], Marker?: string): Promise<DistributionSummaryList> => { |
This file contains 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
Stripe.invoices.update( | |
'in_xxxx', | |
{ | |
metadata: { | |
order_id: '6735' | |
}, | |
statement_descriptor: 'statement descriptor', | |
alternate_statement_descriptors: { | |
kanji: '漢字', | |
kana: 'カナ' |
This file contains 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
<?php | |
// 存在しなくなったone-column-fluidをロードしようとしているときのフォールバック | |
add_filter( | |
'inc2734_wp_view_controller_layout', | |
function( $layout ) { | |
if ( 'one-column-fluid' === $layout ) { | |
$layout = 'one-column'; | |
} | |
return $layout; | |
} |
This file contains 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
const axios = requier('axios'); | |
// via: https://www.drupal.org/docs/8/core/modules/rest/3-post-for-creating-content-entities | |
const username = 'admin' | |
const password = 'xxxxxxx' | |
const format = 'hal_json' | |
const endpoint = 'http://example.com' | |
const newNode = { | |
_links: { | |
type: { |
This file contains 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
PREFIX dbo: <http://dbpedia.org/ontology/> | |
SELECT DISTINCT ?name (group_concat(DISTINCT ?teamName; separator = ",") AS ?teams) (group_concat(DISTINCT ?positionName; separator = ",") AS ?positionNames) ?battingSide ?throwingSide ?comment | |
WHERE { | |
?link dbo:wikiPageWikiLink <http://ja.dbpedia.org/resource/全球団から本塁打>; | |
<http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://dbpedia.org/ontology/BaseballPlayer>; | |
rdfs:label ?name; | |
dbo:position ?position; | |
dbo:battingSide ?battingSide; | |
dbo:throwingSide ?throwingSide; | |
rdfs:comment ?comment; |
This file contains 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
<?php | |
/* | |
Plugin Name: Admin Intercom Widget | |
Plugin URI: https://gist.github.com/hideokamoto/c0b9002ad73f145e1c6d6bc3b99f2b7b | |
Description: 管理画面にIntercomのWidget出すプラグイン | |
Author: hideokamoto | |
Version: 0.0.1 | |
*/ | |
final class My_IntercomWidget { | |
/** |
NewerOlder