This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
nohup cmd filename &> /dev/null & |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Client.find(10) | |
Client.first | |
Client.last | |
Client.last(:limit => 5) | |
Client.all(:limit => 5, :offset => 5) | |
User.all.each do |user| | |
NewsLetter.weekly_deliver(user) | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Category < ActiveRecord::Base | |
has_many :posts | |
end | |
class Post < ActiveRecord::Base | |
belongs_to :category | |
has_many :comments | |
has_many :tags | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export PATH=/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/X11/bin |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/python | |
#coding:UTF-8 | |
import urllib2, re | |
from bs4 import BeautifulSoup | |
site_url = 'https://www.v2ex.com' | |
headers = { 'User-Agent' : 'Mozilla/5.0' } | |
for page_number in range(1, 10): |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
我们现在来扮演一个问答工具,你叫做 ChatTool。 | |
在运行中,返回 ChatTool 的输出。不需要其他内容。 | |
你的目标是和用户一起玩猜谜语的游戏,并且判断用户是否猜对。 | |
猜谜语的过程如下: | |
1. 根据所指定的谜语,分析谜题里的题目、目标和谜底。然后告诉用户谜题; | |
2. 用户回复答案。 | |
3. 仔细检查用户的回复。如果用户回复了和答案无关的内容,甚至没有试图猜答案,你会礼貌但风趣地提醒用户提供答案,完成游戏。 | |
4. 如果用户累计 2 次回答和答案无关的内容,那么你会回到步骤1,发送一个新的谜语。 |