Skip to content

Instantly share code, notes, and snippets.

View tgfjt's full-sized avatar
🐈

Takashi Fujita tgfjt

🐈
View GitHub Profile
javascript:(() => { const u = document.querySelector('video[src*=".cdninstagram.com"]').src; const a = document.createElement('a'); a.setAttribute('href', 'CLICK'); a.setAttribute('download', u); a.style.display = 'none'; document.body.append(a, 'end'); a.click(); a.remove(); })();
MODEL_ID="gemini-1.0-pro-001"
LOCATION="asia-northeast1"
API_ENDPOINT="$LOCATION-aiplatform.googleapis.com"
PROJECT_ID=$PROJECT_ID
curl -X POST \
-H "Authorization: Bearer $(gcloud auth print-access-token)" \
-H "Content-Type: application/json" \
https://${API_ENDPOINT}/v1/projects/${PROJECT_ID}/locations/${LOCATION}/publishers/google/models/${MODEL_ID}:streamGenerateContent \
-d '{
{
"model": "gpt-3.5-turbo-0613",
"messages": [
{
"role": "user",
"content": "1. give a good 'tip' in 10-15 words.\n2. generate a name for a science fiction universe"
}
],
"functions": [
{
import { Document } from 'langchain/document';
import { OpenAIChat } from 'langchain/llms/openai';
import { OpenAIEmbeddings } from 'langchain/embeddings/openai';
import { RecursiveCharacterTextSplitter } from 'langchain/text_splitter';
import { MemoryVectorStore } from 'langchain/vectorstores/memory';
import { VectorDBQAChain } from 'langchain/chains';
export async function main(apiKey: string) {
const text = `some text`;
const splitter = new RecursiveCharacterTextSplitter({
type SpeechRecognitionListener = (e: SpeechRecognitionEvent) => void;
export function createSpeechRecognition(
onResult: SpeechRecognitionListener,
): SpeechRecognition | undefined {
if (typeof window !== 'object') return;
const SpeechRecognition = window.SpeechRecognition || window.webkitSpeechRecognition;
if (typeof SpeechRecognition !== 'undefined') {
const express = require("express");
const next = require("next");
const compression = require("compression");
const helmet = require("helmet");
const morgan = require("morgan");
const { logger } = require('./logger');
async function startSever() {
const dev = process.env.NODE_ENV === 'development';
const app = next({ dev });
const webfontsGenerator = require('webfonts-generator');
webfontsGenerator({
fontName: 'demo',
html: false,
css: false,
files: [
'A.svg',
'B.svg',
],
/**
* @typedef {Object} MSDocument
* @property {(message: string) => void} showMessage
*/
/**
* @typedef {Object} Context
* @property {MSDocument} document
*/
/*
PadZero returns "043737" when get 43737
https://www.aozora.gr.jp/cards/000081/card43737.html
*/
func PadZero(cardID int) string {
return fmt.Sprintf("%06d", cardID)
}
<h1 id="header"></h1>