很形象
@lanzhiheng 啊,我八年前在线 commit 的那条记录还影响 push 啊,按你的分析,这个要不要给 github 提个 issue 让他们搞呢,毕竟是他们的在线编辑工具 push 后引起 的,这么想来,他们的 在线编辑器修改后 push 是在服务器上运行的,那他们的服务器上的 push 和 我们 client 看来还是有差别的。
flutter 大法好
好哇好哇,欢迎来骚
@BenX ben 买了情侣装哈 售后处理了,记得秀一下,
用了几年 Turbolinks 了,这么说,我在路上也好几年了
学着起来其实很快,两年前我试了下 vue,很快就能搬砖了。
不过很久没搬,现在好像又忘记了 ,脑子里忘不掉的就是 jQuery 大法,这个太根深蒂固了,估计忘不了了
对对,微信 QQ 甚至是微博 也许比 支付宝更合适这个场景
呼吁贡献回 homeland,这样 ruby-china 也可以绑定 微信和支付宝登陆了
等效与 c# 的
topic?.node?.name
是吗?要是老碰到那样,就要考虑使用 阿里云的 code 那里的 Q 外服务器构建了
可以搞一个 marketplace
C# WinForm/WPF 不香吗?
GitHub Actions 真不错,主要是提供的虚机性能超级棒,打个 image, Docker Hub 自己拉去 Build 所用的时间是用 GitHub Action 这边 build 后 push 过去 的三倍以上,中间顺带还 push 到了 GitHub 自己的 package 服务
好赞的讨论帖
好处是有很多别人已经做好了的基础镜像,拿来就能用,比如 https://github.com/ledermann/docker-rails-base 真香!
就服你的手快
有一部分人相信换 go 得永生
🚄 换 🚌
说个思路吧,
我以前搞过一个,超级难爬,实在没法,换 javascript 写 chrome 插件,run 在 chrome 里。
打开浏览器,登陆目标网站,call 出插件,显示个 button ,点击,该爬的都爬到了,组织好数据,post 到自己的 api 上。
多买几个运营妹子点按钮 😄
ruby abc.ruby
贴一个我的吧
# frozen_string_literal: true
# DFA 算法实现敏感词扫描
module Yfxs
class SensitiveWords
@@sensitiveMap = Hash.new
class << SensitiveWords
def addWord(word)
nowMap = @@sensitiveMap
for i in 0..word.strip.length - 1
c = word[i].chr
if nowMap.has_key? c
nowMap = nowMap[c]
else
child = Hash.new
child["end"] = 0
nowMap[c] = child
nowMap = nowMap[c]
end
end
nowMap["end"] = 1
end
def initWordMap
return true if @@sensitiveMap.size > 0
stop_words = Setting.stop_words.uniq
stop_words.each_with_index do |word, index|
addWord word
end
true
end
def p
initWordMap
@@sensitiveMap.size
end
def scan(word)
initWordMap
word = word.to_s
words = Array.new
for i in 0..word.length - 1
c = word[i]
if @@sensitiveMap.has_key? c
theword = "".freeze
nowMap = @@sensitiveMap
for j in i..word.length - 1
c = word[j]
if nowMap.has_key? c
theword += c
nowMap = nowMap[c]
if nowMap['end'] == 1
words.push theword
end
else
break
end
end
end
end
return words
end
end
end
end
在 rails 内写个 自定义的 validates 丢到 concern 用起来更顺手
# frozen_string_literal: true
module WithSensitiveWords
extend ActiveSupport::Concern
module ClassMethods
def sensitive_words_safe(*args)
args.each do |key|
define_method("#{key.to_s}_without_stopwords") do
Yfxs::Stopword.safe self[key]
end
end
end
def sensitive_words_validates(*args)
validates_each args do |record, attr, value|
# record.errors.add(attr, '包含不允许出现的词语') if Yfxs::SensitiveWords.scan(value).length > 0
if Yfxs::SensitiveWords.scan(value.to_s).length > 0
record.errors[:base] << "请不要发布会给我们带来伤害的内容"
record.errors.add(attr, "包含不允许出现的词语")
end
end
end
end
end
# frozen_string_literal: true
module Yfxs
class Stopword
def self.safe(text)
words = SensitiveWords.scan text
if words.present?
words.each_with_index do |word, index|
text = text.gsub(/#{word}/, "***")
end
end
text
end
end
end
# frozen_string_literal: true
class Comment < ApplicationRecord
include WithSensitiveWords
belongs_to :commentable, polymorphic: true
belongs_to :user, optional: true
sensitive_words_safe :title
sensitive_words_validates :body
end
Android studio 香!
这是个经典问题了。正向遍历的过程中改变了集合的长度
一边从桶里舀水出来,一边把桶高锯掉一些。
这种情况类 for 循环需要倒着遍历,或者用 while … do 这样的循环
过过过儿过过的生活?
这个叫 四舍六入五成双