Rails

用 Git 和 Github 提高效率的 10 个技巧!

家住魔仙堡 提交于 2020-08-13 02:36:39
作者:张伯函 segmentfault.com/a/1190000003830252 Git 和 GitHub 都是非常强大的工具。即使你已经使用他们很长时间,你也很有可能不知道每个细节。 我整理了 Git 和 GitHub 可能提高日常效率的10个常用技巧。 如果你想看视频教程,请看文末推荐! GitHub 1、快捷键: t 和 w 在你的源码浏览页面,按 t 可以快速进入模糊文件名搜索模式: 在你仓库主页,按 w 可以快速进行分支过滤: 在任意 GitHub 页面中,按 ? 展示当前页面可用的快捷键: 2、忽略空格: ?w=1 在任意的 diff URL 添加 ?w=1 用来整理缩进: 3、按范围过滤提交记录: master@{time}..master 你可以创建一个对比页面通过使用 URL github.com/user/repo/compare/{range}。范围 (range) 可以是两个 SHA 例如 sha1…sha2 或者两个分支名称例如 master…my-branch。范围同时也非常智能的支持使用时间作为关注点。你可以通过 master@{1.day.ago}…master 过滤从昨天开始的提交。例如:链接, https://github.com/rails/rails/compare/master@{1.day.ago}…master 显示 Rails

参数化SQL IN子句

我怕爱的太早我们不能终老 提交于 2020-08-12 08:03:39
问题: How do I parameterize a query containing an IN clause with a variable number of arguments, like this one? 我该如何参数化包含一个带有可变数量参数的 IN 子句的查询,就像这样? SELECT * FROM Tags WHERE Name IN ('ruby','rails','scruffy','rubyonrails') ORDER BY Count DESC In this query, the number of arguments could be anywhere from 1 to 5. 在此查询中,参数的数量可以为1到5之间的任意值。 I would prefer not to use a dedicated stored procedure for this (or XML), but if there is some elegant way specific to SQL Server 2008 , I am open to that. 我不希望为此(或XML)使用专用的存储过程,但是如果有一些特定于 SQL Server 2008的 优雅方法,我可以接受。 解决方案: 参考一: https://stackoom.com/question/1Pqq

用 Git 和 Github 提高效率的 10 个技巧!

人走茶凉 提交于 2020-08-11 12:38:06
作者:张伯函 segmentfault.com/a/1190000003830252 Git 和 GitHub 都是非常强大的工具。即使你已经使用他们很长时间,你也很有可能不知道每个细节。 我整理了 Git 和 GitHub 可能提高日常效率的10个常用技巧。 如果你想看视频教程,请看文末推荐! GitHub 1、快捷键: t 和 w 在你的源码浏览页面,按 t 可以快速进入模糊文件名搜索模式: 在你仓库主页,按 w 可以快速进行分支过滤: 在任意 GitHub 页面中,按 ? 展示当前页面可用的快捷键: 2、忽略空格: ?w=1 在任意的 diff URL 添加 ?w=1 用来整理缩进: 3、按范围过滤提交记录: master@{time}..master 你可以创建一个对比页面通过使用 URL github.com/user/repo/compare/{range}。范围 (range) 可以是两个 SHA 例如 sha1…sha2 或者两个分支名称例如 master…my-branch。范围同时也非常智能的支持使用时间作为关注点。你可以通过 master@{1.day.ago}…master 过滤从昨天开始的提交。例如:链接, https://github.com/rails/rails/compare/master@{1.day.ago}…master 显示 Rails

理解Rails真实性令牌

帅比萌擦擦* 提交于 2020-08-11 04:01:19
问题: I am running into some issues regarding the Authenticity Token in Rails, as I have many times now. 我正在遇到有关Rails中的Authenticity Token的一些问题,因为我现在已经多次了。 But I really don't want to just solve this problem and go on. 但我真的不想只是解决这个问题而继续下去。 I would really like to understand the Authenticity token. 我真的很想了解真实性令牌。 Well, my question is, do you have some complete source of information on this subject or would you spend your time to explain in details here? 那么,我的问题是,您是否有关于此主题的完整信息来源,或者您是否会花时间在此详细解释? 解决方案: 参考一: https://stackoom.com/question/3wx0/理解Rails真实性令牌 参考二: https://oldbug.net/q/3wx0/Understanding

在Ruby on Rails中对nil v。空v。空白的简要解释

一个人想着一个人 提交于 2020-08-10 05:39:17
问题: I find myself repeatedly looking for a clear definition of the differences of nil? 我发现自己一再寻找 nil? 差异的明确定义 nil? , blank? , blank? , and empty? , empty? in Ruby on Rails. 在Ruby on Rails中。 Here's the closest I've come: 这是我最接近的: blank? objects are false, empty, or a whitespace string. 对象是false,空或空白字符串。 For example, "" , " " , nil , [] , and {} are blank. 例如, "" , " " , nil , [] 和 {} 为空。 nil? objects are instances of NilClass. 对象是NilClass的实例。 empty? objects are class-specific, and the definition varies from class to class. 对象是特定于类的,并且定义因类而异。 A string is empty if it has no characters, and an