This file contains hidden or 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
zip data.zip file.txt -rq9 | |
zip data.zip 2015* -rq9 | |
-r recusive directory | |
-q quit | |
-9 best compress |
This file contains hidden or 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/env ruby | |
point = Time.now.strftime("%Y%m%d%H") | |
backpath="/backup/dbback/" | |
path="/tmp/"+point | |
fpath=backpath+point+".tar.gz" | |
`mkdir -p #{path}` | |
`mongodump --out #{path} --quiet` | |
`tar -C /tmp -czvf #{fpath} #{point}` | |
require 'mail' |
This file contains hidden or 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
#encoding: utf-8 | |
require "socket" | |
if Gem::Platform.local.os == "darwin" | |
CurrentPath = "/Users/zxy/current" | |
command_path = "/Users/zxy/command" | |
else | |
CurrentPath = "/root/current" | |
command_path = "/root" | |
end |
This file contains hidden or 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
var patt=/2\d{3}-(0[1-9]|1[012])-(0[1-9]|[12][0-9]|3[01])[\s+](0[0-9]|1[0-9]|2[0-3]):(0[0-9]|[1-5][0-9])/; | |
$(document).ready(function(){ | |
$("#settings").submit(function(){ | |
var tk=true; | |
$("#settings input[type=text]").each(function(){ | |
result = patt.exec($(this).val()); | |
if(result==null){ | |
var txt=$(this).parent().prev("td").text(); | |
alert(txt+"格式不对"); | |
tk=false; |
This file contains hidden or 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
阿里云镜像:http://mirrors.aliyun.com/ | |
网易开源镜像站:http://mirrors.163.com/ | |
搜狐开源镜像站:http://mirrors.sohu.com/ | |
北京交通大学开源镜像站:http://mirror.bjtu.edu.cn | |
兰州大学开源软件镜像站:http://mirror.lzu.edu.cn/ | |
厦门大学开源软件镜像站:http://mirrors.xmu.edu.cn/ | |
上海交通大学开源软件镜像站:http://ftp.sjtu.edu.cn/ | |
清华大学开源软件镜像站:http://mirrors.tuna.tsinghua.edu.cn/ | |
天津大学开源软件镜像站:http://mirror.tju.edu.cn/ | |
中国科学技术大学开源软件镜像站:http://mirrors.ustc.edu.cn/ |
This file contains hidden or 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
<xml> | |
<ToUserName>#{@to_user}</ToUserName> | |
<FromUserName>#{@from_user}</FromUserName> | |
<CreateTime>#{Time.now.to_i}</CreateTime> | |
<MsgType>news</MsgType> | |
<ArticleCount>1</ArticleCount> | |
<Articles> | |
<item> | |
<Title>凤城文化节有奖问答</Title> | |
<Description>快来参加吧</Description> |
This file contains hidden or 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
<xml> | |
<ToUserName>#{@to_user}</ToUserName> | |
<FromUserName>#{@from_user}</FromUserName> | |
<CreateTime>#{Time.now.to_i}</CreateTime> | |
<MsgType>news</MsgType> | |
<ArticleCount>#{@articles.count}</ArticleCount> | |
<Articles> | |
- @articles.each do |article| | |
- unless article.media_infos.blank? | |
- theone=article.media_infos.sample |
This file contains hidden or 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
#encoding: utf-8 | |
require "net/http" | |
require "json" | |
require "xmlsimple" | |
class YixinController < ApplicationController | |
layout nil | |
skip_before_filter :verify_authenticity_token |