- 完成小芳便利店程序 需求1 (请发邮件获得详细需求)
- 阅读Programming Ruby 或者 阅读在线版本 http://www.ruby-doc.org/docs/ProgrammingRuby/
- 在已安装的Linux机器上,完成如下Linux命令的使用:
| // ==UserScript== | |
| // @name Delete Weibo | |
| // @namespace http://tampermonkey.net/ | |
| // @version 0.1 | |
| // @description try to take over the world! | |
| // @author You | |
| // @match https://weibo.cn/<Your WeiboID>/profile | |
| // @grant none | |
| // ==/UserScript== |
| # -*- mode: ruby -*- | |
| # vi: set ft=ruby : | |
| Vagrant.configure("2") do |config| | |
| config.vm.box = "ubuntu/trusty64" | |
| config.vm.network :forwarded_port, guest: 3000, host: 3000 | |
| config.vm.provision :shell, path: 'bootstrap.sh', keep_color: true | |
| config.vm.network "private_network", type: "dhcp" | |
| config.vm.synced_folder ".", "/vagrant", type: "nfs" | |
| config.vm.hostname = 'rails-dev-box' |
| prefix = %w(31 32 33 34 35 36 37 38 39 51 52 53 55 56 57 58 59 70 71 72 73 75 77 80 81 82 83 85 86 87 88 89) | |
| (1..100).each do |n| | |
| puts "1#{prefix.sample}#{rand(10**8)}" | |
| end |
| <%@ WebHandler Language="C#" Class="JinshujuHandler" %> | |
| using System; | |
| using System.Web; | |
| using System.Text; | |
| using System.IO; | |
| using Newtonsoft.Json.Linq;//引用第三方控件Newtonsoft.Json.dll | |
| /* | |
| *Company:QingDao Transinfo | |
| *Author: Andy.Sun |
| require 'octokit' | |
| require 'date' | |
| milestones = [ | |
| "70: JUL29" | |
| ] | |
| start = 92 | |
| range = (Date.parse('2014-01-01')...Date.parse('2014-3-31')) | |
| name = "#{start}: " |
| require 'sinatra' | |
| require "sinatra/streaming" | |
| set connections: [], loggin: true, bind: '0.0.0.0' | |
| get '/stream', provides: 'text/event-stream' do | |
| stream :keep_open do |out| | |
| settings.connections << out | |
| out.callback { settings.connections.delete(out) } | |
| end |
| http://html5boilerplate.com/mobile/ | |
| http://zeptojs.com/ | |
| 中文: | |
| http://www.adobe.com/cn/devnet/html5/articles/flame-on-a-beginners-guide-to-emberjs.html | |
| http://www.w3school.com.cn/html5/html_5_webstorage.asp | |
| 中文: http://emberjs.cn | |
| http://emberjs.com/ |
| map $http_user_agent $is_bot { | |
| default 0; | |
| ~*(crawl|Googlebot|Slurp|spider|bingbot|yodaobot|youdaobot)$ 1; | |
| } | |
| set $should_redirect 1; | |
| if ($is_bot) { | |
| set $should_redirect 0; | |
| } |
| # http://stackoverflow.com/questions/824205/while-processing-an-email-reply-how-can-i-ignore-any-email-client-specifics-th | |
| def find_reply(email) | |
| message_id = email.message_id('') | |
| x_mailer = email.header_string('x-mailer') | |
| # For optimization, this list could be sorted from most popular to least popular email client/service | |
| rules = [ | |
| [ 'Gmail', lambda { message_id =~ /.+gmail\.com>\z/}, /^.*#{FROM_NAME}\s+<#{FROM_ADDRESS}>\s*wrote:.*$/ ], | |
| [ 'Yahoo! Mail', lambda { message_id =~ /.+yahoo\.com>\z/}, /^_+\nFrom: #{FROM_NAME} <#{FROM_ADDRESS}>$/ ], |