wget --no-check-certificate -O shadowsocks.sh https://raw.githubusercontent.com/teddysun/shadowsocks_install/master/shadowsocks.sh
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
# -p parameter tells wget to include all files, including images. | |
# -e robots=off you don't want wget to obey by the robots.txt file | |
# -U mozilla as your browsers identity. | |
# --random-wait to let wget chose a random number of seconds to wait, avoid get into black list. | |
# Other Useful wget Parameters: | |
# --limit-rate=20k limits the rate at which it downloads files. | |
# -b continues wget after logging out. | |
# -o $HOME/wget_log.txt logs the output | |
wget --random-wait -r -p -e robots=off -U mozilla http://www.example.com |
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
tell application "Google Chrome" | |
if not (exists window 1) then reopen | |
set myBMFolder to bookmark folder "xxx" of bookmark folder "其他书签" | |
set bmURLs to URL of bookmark items of myBMFolder | |
repeat with aUrl in bmURLs | |
tell application "Safari" | |
tell window 1 | |
open location aUrl | |
delay 15 |
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
<%= f.association :country, label: "请选择国家", | |
disabled: true, collection: Proc.new{ Country.all.map{ |c| [c.name, c.id, {data_country: c.short_name}] } } %> |
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
# 查询字段是否为验证字段,如果是验证字段返回 true | |
def presence?(poi, field) | |
presence_fields = poi.constantize.validators.map do |v| | |
v.attributes if v.is_a? ActiveRecord::Validations::PresenceValidator | |
end | |
# 去 nil 并 二维转一维 | |
if presence_fields.compact.flatten.include?(field) | |
return true | |
else | |
return false |
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
# 查询字段是否为验证字段,如果是验证字段返回 false 不是 返回 true | |
def is_presence poi, field | |
presence_fields = poi.constantize.validators.map do | v | | |
if v.is_a? ActiveRecord::Validations::PresenceValidator | |
v.attributes | |
end | |
end | |
# 去 nil 并 二维转一维 | |
if presence_fields.compact.flatten.exclude?(field) | |
return true |
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
// 获取当前列表 经纬度 | |
var latlngMarkerArray = <%= raw @lat_lng.to_json %>; | |
var markers = []; | |
var mapOptions = { | |
zoom: 10, | |
} | |
if(latlngMarkerArray.length > 0){ | |
mapOptions['center'] = latlngMarkerArray[0] | |
} |
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
<?php if (!defined('BASEPATH')) exit('No direct script access allowed'); | |
/** | |
* @ignore | |
*/ | |
class OAuthException extends Exception { | |
// pass | |
} | |
class Oauth2_lib { |
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
set-option -g prefix 'C-\' | |
setw -g mode-keys emacs |
NewerOlder