Skip to content

Instantly share code, notes, and snippets.

Nofollow属性一般处理不希望搜索引擎继续爬行的URL上面,因为会传递权重
<a href="https://minkabu.jp/top/truste" target="_blank" rel="nofollow">
<font style="vertical-align: inherit;">
<font style="vertical-align: inherit;">隐私声明
</font>
</font>
</a>
@zhouxiaozhen-github
zhouxiaozhen-github / 整合重复网址
Created April 23, 2019 06:36
head中的那些'SEO'
在非关键页面的head中加入,链接到关键地址(希望用户可以搜索到的地址)
<link rel="canonical" href="https://itf.minkabu.jp/login">
如果规范网页有移动版,请为其添加 rel="alternate" 链接,并使该链接指向此网页的移动版:
<link rel="alternate" media="only screen and (max-width: 640px)" href="http://m.example.com/dresses/green-dresses">
@zhouxiaozhen-github
zhouxiaozhen-github / google搜索规则之检索词 SEO.md
Last active April 23, 2019 06:05
google 搜索规则之检索词

SEO之片面理解: 1 检索词的权重(最为重要) 2 适应大部分用户的搜索习惯

下面列举了搜集到的搜索方法

1 and

最常见的搜索规则

@zhouxiaozhen-github
zhouxiaozhen-github / ajax in rails
Created April 23, 2019 01:51
rails项目使用AJAX的无脑四步骤
1 view 页面显示
<button id="floor_price_<%=product.id%>" onclick="get_floor_price(<%=product.id%>)">获取最低价</button>
2 view页面添加 ajax
<script>
function get_floor_price(p_id){
url = "/admin/products/floor_price/" + p_id
$.ajax({
@zhouxiaozhen-github
zhouxiaozhen-github / 固定位置内容切换.md
Created April 18, 2019 07:32
显示切换/display + toggle
<script src="https://cdn.bootcss.com/jquery/3.4.0/jquery.min.js"></script>

<h1 id='mico1' style='display: none'></h1>

<h1 id='mico2' style='display: block'>micomico</h1>

<button onclick="mico()">切换</button>

<script>

function mico(){

@zhouxiaozhen-github
zhouxiaozhen-github / 嵌入页面
Last active April 18, 2019 07:02
利用bootstrap的data-toggle
页面可能添加一些弹出界面,但是不常用,页面可以先不渲染,我们可以利用bootstrap的toggle方法,加上jquery的replaceWith进行页面替换
1 目标页面
(1) <a data-target="#subModal" data-toggle="modal" id="edit_trigger"></a>
(或者直接换成一个button,主页面点击的时候,也可以起到效果 . <button type="button" class="btn btn-primary" data-toggle="modal" data-target="#subModal">Large modal</button>)
(2) 预留一个空的div(此处就是不用提前渲染内容位置)
<div id="vehicleModal">
</div>
2 任意局部页面
@zhouxiaozhen-github
zhouxiaozhen-github / CustomLogger.md
Last active April 18, 2019 07:05
Rails 做一个自己的logger

Rails 开发很多时候想要吧一些独立的业务处理单独写在一个 log 文件.

Rails 想要新建一个单独的 log 文件是很简单的。

这里我利用单独 logger 来纪录 resque worker 的一些事情。

首先建立一个 logger model

class WorkerLogger < Logger

@zhouxiaozhen-github
zhouxiaozhen-github / gist:d78343b662d34e9499d9b51d3908f837
Created April 17, 2019 09:22
解决这个问题: NSPlaceholderDictionaryinitialize
objc[3032]: +[__NSPlaceholderDictionaryinitialize] may have been in progress in another thread when fork() was called.We cannot safely call it or ignore it in the fork() child process. Crashing instead. Set a breakpoint on objc_initializeAfterForkError to debug.
export OBJC_DISABLE_INITIALIZE_FORK_SAFETY='YES' >> ~/.bash_profile
@zhouxiaozhen-github
zhouxiaozhen-github / mysql排错.md
Last active April 17, 2019 07:15
mysql 安装之后 bundle 出问题?

MAC 系统中问题解决


mysql client is missing. You may need to 'brew install mysql' or 'port install mysql', and try again.

*** extconf.rb failed *** Could not create Makefile due to some reason, probably lack of necessary

@zhouxiaozhen-github
zhouxiaozhen-github / jQuery - css() 方法.md
Created April 17, 2019 06:55
[jQuery - css() 方法]#jQuery

jQuery css() 方法

css() 方法设置或返回被选元素的一个或多个样式属性。


返回 CSS 属性

如需返回指定的 CSS 属性的值,请使用如下语法: