- 领取链接填写规则:
<a href="javascript:onGetCoupon(8);">1100</a>
<a href="javascript:onGetCoupon(7);">510</a>
<a href="javascript:onGetCoupon(6);">300</a>
<a href="javascript:onGetCoupon(5);">99</a>
- 代码+到页面最后。
<a href="javascript:onGetCoupon(8);">1100</a>
<a href="javascript:onGetCoupon(7);">510</a>
<a href="javascript:onGetCoupon(6);">300</a>
<a href="javascript:onGetCoupon(5);">99</a>
[ | |
{ | |
"unicode": "😄", | |
"name": "smile", | |
"category": "people" | |
}, | |
{ | |
"unicode": "😃", | |
"name": "smiley", | |
"category": "people" |
# 数组
req_list = %w( http://10.4.2.86:9292/sessions/new http://10.4.1.177:9292/sessions/new http://10.4.10.139:9292/sessions/new http://10.4.6.221:9292/sessions/new )
# 哈希
req_hash = {
'task-server' => 'http://10.4.2.86:9292/sessions/new',
'web-server' => 'http://10.4.10.139:9292/sessions/new',
'app-server' => 'http://10.4.6.221:9292/sessions/new',
'back-server' => 'http://10.4.1.177:9292/sessions/new',
# user_id = '522d3cf8a57cbb890f000005' | |
# send_invites(user_id, secret: 'android', desc: '郑州见面会专用。', welcome: '感谢您使用收留我App。') | |
# send_invites(user_id, { secret: 'android', limit: 50 }, 2) | |
def send_invites(user_id, opts={}, num=1) | |
u = User.find(user_id) | |
return false if u.nil? | |
opts.symbolize_keys! | |
return false if opts[:secret].nil? | |
1.upto(num) { |i| | |
u.invites.create( |
# -*- encoding: utf-8 -*- | |
require './jd' | |
url = 'http://search.jd.com/search?keyword=%E5%B7%B4%E9%BB%8E%E6%AC%A7%E8%8E%B1%E9%9B%85&enc=utf-8&qr=&qrst=UNEXPAND&et=&rt=1&bs=no&stop=1&area=15&wtype=1&ev=&uc=0#select' | |
jd = JD.new(url) | |
items = jd.parse |
require 'formula' | |
class Libxslt < Formula | |
homepage 'http://xmlsoft.org/XSLT/' | |
url 'ftp://xmlsoft.org/libxml2/libxslt-1.1.28.tar.gz' | |
mirror 'http://xmlsoft.org/sources/libxslt-1.1.28.tar.gz' | |
sha1 '4df177de629b2653db322bfb891afa3c0d1fa221' | |
keg_only :provided_by_osx |
gem 'cloopen_rest', github: '9577/cloopen_rest', require: false | |
# -*- encoding: utf-8 -*- | |
require 'cloopen_rest' | |
def auth | |
{ | |
uid: 'aaf98fda45d5903f0145d5e642590064', | |
tid: 'f3cb84d5e3a74f2e82ab3bca39d3160a', | |
aid: 'aaf98fda45d5903f0145d5ecaace0077' |
geocoder = Baidu::Geocoder.new
geocoder.lookup(ip: '221.131.192.80')
geocoder.lookup(address: '杭州长江南路336')
geocoder.lookup(lng: 120.208955, lat: 30.16512)
新增方法
class ActiveRecord::Base
def self.has_translation(*attributes)
attributes.each do |attribute|
define_method "#{attribute}" do
self.send "#{attribute}_#{I18n.locale.to_s.downcase.sub('-','_')}"
end
end
# -*- encoding: utf-8 -*- | |
class ActiveRecord::Base | |
class << self | |
# 去重 | |
def divorce_by(field_name, id = :id) | |
ids = twin_ids_by(field_name, id) | |
self.where(id: ids).delete_all unless ids.empty? | |
end | |
# 找出重复的 ids |