Skip to content

Instantly share code, notes, and snippets.

import os
from flask import current_app
import polib
from openai import OpenAI
client = OpenAI(
base_url="https://api.deepseek.com/v1",
api_key=current_app.config['DEEPSEEK_SECRET_KEY']
)
@kingkong-cmd
kingkong-cmd / gist:bed300bfb275e437e0b0d8ebb6bebd85
Created September 9, 2024 17:27
Read grib and create tiles in webmercator projection and render in openlayers
# This code shows a few things:
# 1. Read a GRIB file into xarray WITHOUT any GDAL etc.
# 2. Encode the grib data into xyz png tiles in 256x256 format
# 3. Reproject the GRIB data from EPSG:4326 to EPSG:3857 (webmercator) so that the tiles can be used
# directy in openlayers without needing to reproject on client.
# Install dependencies
# pip install gribberish (rust based grib reader)
# pip install xarray as xr
########## iwconfig #######################
lo no wireless extensions.
wlp1s0 IEEE 802.11 ESSID:"AndroidAP"
Mode:Managed Frequency:5.18 GHz Access Point: XXX
Bit Rate=52 Mb/s Tx-Power=3 dBm
Retry short limit:7 RTS thr:off Fragment thr:off
Power Management:off
Link Quality=70/70 Signal level=-40 dBm