
服务器 最近要在IDE或者浏览器插件中使用到Google翻译,但是国内又不大方便,某大佬提供了一个反代配置
需要一个服务器,然后新建一个站点,然后用NGINX进行配置,其中反代配置如下 location / { proxy_pass https://translate.googleapis.com/; proxy_redirect https://translate.googleapis.com/ /; proxy_cookie_domain translate.googleapis.com [你的域名]; proxy_set_header User-Agent $http_user_agent; proxy_set_header Accept-Encoding ""; sub_filter_once off; add_header Cache-Control no-cache; sub_filter "http://translate.googleapis.com" "http://[你的域名]"; sub_filter "https://translate.googleapis.com" "http…
docker 制作一个包含PHP、MySQL、Redis、swoole、swoole_loader的docker镜像
前言 近期需要部署一个PHP项目,但是项目中带有 swoole,不想在服务器安装swoole扩展,想做一个docker镜像,对服务器干净一些,不对当前环境造成影响,所以就有了这个小功能 文件 一共有4个文件和一个目录 目录 1 . ./data/www 说明 PHP文件存放目录 文件 ./data/nginx.conf NGINX 配置文件 ./swoole_loader.so swoole_loader 扩展文件 ./Dockerfile 镜像构建文件 ./docker-compose.yml docker编排文件 ./data/nginx.conf 文件内容 server { listen 80; server_name _; root /var/www/html; index index.php index.html index.htm; # URL重写配置 location / { if (!-e $request_filename){ rewrite ^(.*)$ /index.php?s=$1 last; break; } try_files $uri $uri/ /ind…
AI 白嫖DeepSeek的一个开源项目Awesome-Ollama-Server
介绍 Awesome-Ollama-Server 是一个用于监控和检测 Ollama 服务可用性和性能的系统。它提供了一个现代化的 Web 界面,支持多语言(中文/英文),并具有实时检测和数据展示功能。这个开源项目可以找到类似 DeepSeek 这样的可用的资源。 功能特点 🔍 服务检测 支持批量检测 Ollama 服务 实时显示检测状态和结果 支持检测结果导出 支持自动 FOFA 扫描 📊 性能监控 测试服务响应时间和 TPS 展示可用模型列表 性能数据可视化 🌐 多语言支持 中文界面 英文界面 一键切换语言 🎯 高级筛选 模型过滤 TPS/更新时间排序 分页显示 Awesome-Ollama-Server地址
前端 微信小程序多组件之间 css 用 deep 不生效的一些处理办法
直接上代码了,vue3 setup 模式下 需要额外写一个script <script> export default { options: { styleIsolation: 'shared' } } </script> styleIsolation 可选项 isolated 表示启用样式隔离,在自定义组件内外,使用 class 指定的样式将不会相互影响(一般情况下的默认值) apply-shared 表示页面 wxss 样式将影响到自定义组件,但自定义组件 wxss 中指定的样式不会影响页面 shared 表示页面 wxss 样式将影响到自定义组件,自定义组件 wxss 中指定的样式也会影响页面和其他设置了 apply-shared 或 shared 的自定义组件。(这个选项在插件中不可用。)
前端 Web Worker使用 import 填坑的一些记录
Web Worker中需要加载js文件中包含import 的文件的话,需要一些设置 // main.js(主线程) const worker = new Worker('/worker.js', { type: 'module' // 指定 worker.js 的类型 这里设置开启 ESModule 模式 });
前端 react 用 react-i18next 做国际化处理的一些使用记录
<Trans i18nKey={'app.btn.setIcon'} defaults={'设置图标'} /> i18nKey 是 对应翻译文件的key,defaults 是默认值,就是找不到翻译文件的时候显示的默认内容 // t 的用法 {t('common.button.cancel', { defaultValue: '取消 {{name}}', name: iconPath })} 第一个参数 common.button.cancel 为翻译文件的key,defaultValue 是找不到翻译时候显示的默认内容, name 的对应 defaultValue 里面的 {{name}} 动态值,他会知道替换里面的内容
前端 使用vue3+provide+inject+watch组件层级太深之后偶发watch监测不到的情况
最近开发页面装修功能,封装了很多层级的子组件,顶层用provide设置当前编辑的右侧数据,如下图 在最里面的子组件使用了watch来监听数据的变化 // 监听数据变化 watch( () => props.modelValue, (newVal) => { if (!newVal) return; rightStyle.value = newVal; }, { deep: true } ); watch( () => rightStyle.value, () => { // 数据更新后,通知父组件更新数据 emit('update:modelValue', rightStyle.value); }, { deep: true } ); 然后奇怪的事情发生了,如下图 watch 竟然监听不到变化,经过反复摸索,代码变更为 // 监听数据变化 watch( () => props.modelValue, (newVal) => { if (!newVal) return; rightStyle.value = newVal; }, {…
golang golang 适配器 单例模式
场景 代码层面的单进单出 比如我要指定一个短信供应商,并且整个程序都使用该供应商 比如我要指定一个缓存适配器,并且整个程序都使用该适配器 比如原来已经有写一个短信供应商,我需要进行重写,又不想修改原来的代码 下面我们以短信为例 根目录下 main.go 文件(位置1) package main import ( "fmt" "test/aliSms" "test/sms" "test/tencentSms" ) func main() { sms.SetAdapter(&aliSms.Adapter{}) fmt.Printf("output: %s \n", sms.GetAdapter().SendSms()) sms.SetAdapter(&tencentSms.Adapter{}) fmt.Printf("output: %s \n", sms.GetAdapter().SendSms()) } sms目录下 main.go 文件 (位置2) …
golang golang 适配器模式 简单示例记录
package main import ( "fmt" ) // Target 是客户端期望的接口 type Target interface { Request() string } // Adaptee1 是第一个需要适配的类 type Adaptee1 struct{} func (a *Adaptee1) SpecificRequest1() string { return "Called SpecificRequest1()" } // Adapter1 是第一个适配器类 type Adapter1 struct { adaptee *Adaptee1 } func (adapter *Adapter1) Request() string { return adapter.adaptee.SpecificRequest1() } // Adaptee2 是第二个需要适配的类 type Adaptee2 struct{} func (a *Adaptee2) SpecificRequest2() string { return "…
PHP wordpress上传文件自动重命名方法一
function custom_rename_uploaded_files($file) { $info = pathinfo($file['name']); $ext = $info['extension']; $newname = uniqid() . '.' . $ext; $file['name'] = $newname; return $file; } add_filter('wp_handle_upload_prefilter', 'custom_rename_uploaded_files');
前端 小程序海报生成神器之一Painter配合uniapp使用示例
本篇详细介绍Painter在uniapp中的使用方法 前置资源: Painter的github库:https://github.com/Kujiale-Mobile/Painter Painter在线设置网站:https://lingxiaoyi.github.io/painter-custom-poster/ 完整demo:https://gitee.com/hackchen/uniapp-painter-demo 新建项目 使用HBuilderX新建一个空项目 新建一个叫painter-demo的页面 新建一个js文件paletteData.js(这个文件可自行决定是否需要,本demo因为数据量太大,所以独立建一个文件) 通过github,下载得到painter项目文件 将项目下的components/painter文件夹复制到uniapp项目的wxcomponents文件夹下 新建完文件后,大致的目录结构如下图 修改pages.json { "pages": [ //pages数组中第一项表示应用启动页,参考:https://uniapp.dcloud.io/…
golang Linux shell 通过环境变量方式启动golang 程序记录
golang程序中使用 os.LookupEnv 获取环境变量时,在Linux下启动golang程序时可以使用 export VAR=b 来赋值 shell 使用时整体示例 #!/bin/bash export HTTP_ADDR=0.0.0.0:39033 export DEBUG=true ./xxx
golang golang 网页截屏开发
最近在做一个网页截屏的功能,通过搜索,找到一个golang下不需要下载Chrome的网页截图的功能,主要是依靠 github.com/chromedp/chromedp 这个库来处理。 github.com/chromedp/chromedp 库简单使用方法在这里记录一下: ctx, cancel := chromedp.NewContext(context.Background()) defer cancel() chromedp.Run(ctx, chromedp.ActionFunc(func(ctx context.Context) error { _, err := domain.SomeAction().Do(ctx) return err }))
前端 鸿蒙开发填坑记录 web 组件01
// xxx.ets import web_webview from '@ohos.web.webview' @Entry @Component struct WebComponent { controller: web_webview.WebviewController = new web_webview.WebviewController(); build() { Column() { // src 不能带协议 Web({ src: 'www.baidu.com', controller: this.controller }) } } } // 需要额外配置当前模块下的 module.json5 文件 requestPermissions 块 { "module": { "name": "entry", "type": "entry", "description": "$string:module_desc&quo…


VMware15 安装 mac OS 10.15 调整分辨率

Quartz MySQL Specified key was too long; max key length is 767 bytes

阿里小号突然不能开机了阿里小号客服电话

VMware 安装 Mac os时必要操作

WordPress出现Briefly unavailable for scheduled maintenance. Check back in a minute. 的解决方法

微信小程序多组件之间 css 用 deep 不生效的一些处理办法

wordpress上传文件自动重命名方法一

使用vue3+provide+inject+watch组件层级太深之后偶发watch监测不到的情况

Linux shell 通过环境变量方式启动golang 程序记录
