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 requests | |
import os | |
import re | |
from datetime import datetime | |
def get_weather_data(location): | |
url = "https://opendata.cwa.gov.tw/api/v1/rest/datastore/F-C0032-001" | |
params = { | |
"Authorization": os.getenv('OPEN_API'), |
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 os | |
import requests | |
from PIL import Image | |
from io import BytesIO | |
import google.generativeai as genai | |
gemini_key = os.getenv('GEMINI_API_KEY') | |
# Initialize the Gemini Pro API |
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 requests | |
from PIL import Image | |
from io import BytesIO | |
import google.generativeai as genai | |
gemini_key = os.getenv('GEMINI_API_KEY') | |
# Initialize the Gemini Pro API | |
genai.configure(api_key=gemini_key) | |
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 os | |
import google.generativeai as genai | |
from uptime_kuma_api import UptimeKumaApi, MonitorStatus | |
from datetime import datetime, timedelta | |
gemini_key = os.getenv('GEMINI_API_KEY') | |
kuma_account = os.getenv('KUMA_ACCOUNT') | |
kuma_password = os.getenv('KUMA_PASSWORD') | |
# Initialize the Gemini Pro API |
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 firebase_admin | |
from firebase_admin import credentials | |
from firebase_admin import firestore | |
# Read Firebase cert from env variable JSON string | |
firebase_cred = tempfile.NamedTemporaryFile(suffix='.json') | |
try: | |
GOOGLE_KEY = os.environ.get('FIREBASE_CRED', '{}') | |
firebase_cred.write(GOOGLE_KEY.encode()) |
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
#!/bin/bash | |
file_name=$1 | |
# 步驟 1 | |
python3 -m decipher transcribe -i "$file_name" --model large | |
# 移除副檔名並另存為新變數 | |
origin_file_name="${file_path%.*}" |
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
@handler.add(MessageEvent, message=ImageMessage) | |
def handle__message(event): | |
message_content = line_bot_api.get_message_content(event.message.id) | |
image_content = b'' | |
for chunk in message_content.iter_content(): | |
image_content += chunk | |
print("_________________") | |
print(base64.b64encode(image_content).decode('ascii')) |
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 requests | |
contents = '' | |
with open("a.md") as f: | |
contents = f.readlines() | |
sum = '' | |
for content in contents: | |
sum += content |
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 { defineConfig } from 'vite'; | |
import vue from '@vitejs/plugin-vue'; | |
import fs from 'fs'; | |
// https://vitejs.dev/config/ | |
export default defineConfig({ | |
server: { | |
https: { | |
key: fs.readFileSync('./cert/localhost-key.pem'), | |
cert: fs.readFileSync('./cert/localhost.pem'), | |
}, |
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
{ | |
"type": "bubble", | |
"body": { | |
"type": "box", | |
"layout": "vertical", | |
"contents": [ | |
{ | |
"type": "image", | |
"url": "https://engineering.linecorp.com/wp-content/uploads/2018/11/linedev_logo-90x90.jpg", | |
"size": "full", |
NewerOlder