会员
众包
新闻
博问
闪存
赞助商
HarmonyOS
Chat2DB
所有博客
当前博客
我的博客
我的园子
账号设置
会员中心
简洁模式
...
退出登录
注册
登录
琼楼玉宇
JUST DO IT
博客园
首页
新随笔
联系
订阅
管理
2023年3月14日
rails header 传参数开发环境正式环境区别
摘要: rails 开发环境api传递access_token参数 在controller用 request.headers["HTTP_ACCESS_TOKEN"] 可获取到值。 但是在生产环境却获取不到值了。 原因是生产环境headers的参数名不可以用下划线。改为access-token。 还是用 r
阅读全文
posted @ 2023-03-14 12:48 wangyuyu
阅读(50)
评论(0)
推荐(0)
2023年2月15日
网页跨域ajax请求问题
摘要: 今天用php的项目网页请求另一个服务器的rails项目的api。首先解决php项目的跨域问题。服务器是ubuntu 用的apache2。 修改文件 /etc/apache2/apache2.conf, 添加一行 Header set Access-Control-Allow-Origin "*" <
阅读全文
posted @ 2023-02-15 20:28 wangyuyu
阅读(63)
评论(0)
推荐(0)
2021年7月23日
Rails跳过回调方法
摘要: 1. 方法跳过 使用下列方法可跳过回调: decrement decrement_counter delete delete_all increment increment_counter toggle touch update_column update_columns update_all up
阅读全文
posted @ 2021-07-23 11:26 wangyuyu
阅读(228)
评论(0)
推荐(0)
2021年7月22日
树莓派接USB温湿度传感器(python)
摘要: 用树莓派接usb温湿度传感器测环境温度湿度。 树莓派是3B, USB温湿度传感器用的达林科技的DL11-MC-S1。 DL11-MC-S1文档中连接方式支持串口读取,我们用python的serial 连接传感器。 需要注意的是命令需要用16进制发送,而且相隔的字符直接是没有文档中的空格符的。 下面是
阅读全文
posted @ 2021-07-22 15:42 wangyuyu
阅读(753)
评论(0)
推荐(0)
2021年1月22日
frp用一个服务器进程frps连接多个客户端frpc
摘要: 用一个frps连接多个frpc,原理上多个frpc和frps绑定同一个端口,但是多个frpc用不同的remote_port连接。 云服务器frps.ini [common] bind_port = 7000 vhost_http_port = 8000 dashboard_addr = 0.0.0.
阅读全文
posted @ 2021-01-22 11:40 wangyuyu
阅读(14212)
评论(2)
推荐(1)
树莓派frp使用
摘要: frp下载地址https://github.com/fatedier/frp/releases 1.配置服务器环境 在阿里云下载安装frp cd /varwget https://github.com/fatedier/frp/releases/download/v0.35.0/frp_0.35.0
阅读全文
posted @ 2021-01-22 11:09 wangyuyu
阅读(567)
评论(0)
推荐(0)
2021年1月5日
rails Rendering Text 用法
摘要: rails5.1版本前用法: You can send plain text – with no markup at all – back to the browser by using the :text option to render: render :text => "OK" rails5.
阅读全文
posted @ 2021-01-05 15:07 wangyuyu
阅读(183)
评论(0)
推荐(0)
2020年7月7日
ruby如何使用redis订阅/发布
摘要: redis提供的发布订阅命令subscribe: subscribe channel [channel …] 订阅一个或多个频道unsubscribe: unsubscribe [channel [channel …]] 退订频道,如果没有指定频道,则退订所有的频道publish: publish
阅读全文
posted @ 2020-07-07 16:41 wangyuyu
阅读(350)
评论(0)
推荐(0)
用python执行rails项目sidekiq任务
摘要: 我们先看一下如何ruby如何推一个任务到sidekiq https://github.com/mperham/sidekiq/wiki/FAQ#how-do-i-push-a-job-to-sidekiq-without-ruby require 'securerandom' require 'js
阅读全文
posted @ 2020-07-07 16:29 wangyuyu
阅读(254)
评论(0)
推荐(0)
2020年5月26日
python datetime,字符串,时间戳相互转换
摘要: #datetime转字符串ex: now = datetime.datetime.now() time_string = now.strftime('%Y-%m-%d %H:%M:%S') #字符串转datetimeex: time_string = '2020-05-26 11:42:54' da
阅读全文
posted @ 2020-05-26 12:00 wangyuyu
阅读(993)
评论(0)
推荐(0)
下一页
公告