这是从其他地方 fork 过来的部署脚本(deploy.rb 部分代码)
namespace :deploy do
task :setup_solr_data_dir do
run "mkdir -p #{shared_path}/solr/data"
end
end
namespace :solr do
#userful gem [rack-p3p](https://github.com/hoopla/rack-p3p) | |
# [ie_iframe_cookies](https://github.com/grosser/ie_iframe_cookies) | |
# encoding: utf-8 | |
class ApplicationController < ActionController::Base | |
protect_from_forgery | |
before_filter :set_p3p | |
def set_p3p | |
headers['P3P'] = "policyref=\"/w3c/p3p.xml\", CP=\"ALL DSP COR CURa ADMa DEVa TAIa OUR BUS IND UNI COM NAV INT\"" | |
end |
require 'benchmark' | |
iterations = 10_000_000 | |
a = "hub" | |
b = "git" | |
Benchmark.bm do |bm| | |
bm.report do | |
iterations.times do | |
["I'm", a, b].join(" ") |
isEmail: (text)-> | |
/^([\w-\.]+)@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.)|(([\w-]+\.)+))([a-zA-Z]{2,4}|[0-9]{1,3})(\]?)$/.test text |
var _hmt = _hmt || []; | |
$.ajaxSetup({ | |
global: false, | |
type: 'POST', | |
dataType: 'json' | |
}); | |
(function($) { | |
$.extend({ | |
mask: { |
这是从其他地方 fork 过来的部署脚本(deploy.rb 部分代码)
namespace :deploy do
task :setup_solr_data_dir do
run "mkdir -p #{shared_path}/solr/data"
end
end
namespace :solr do
-- PostgreSQL 9.2 beta (for the new JSON datatype) | |
-- You can actually use an earlier version and a TEXT type too | |
-- PL/V8 http://code.google.com/p/plv8js/wiki/PLV8 | |
-- Inspired by | |
-- http://people.planetpostgresql.org/andrew/index.php?/archives/249-Using-PLV8-to-index-JSON.html | |
-- http://ssql-pgaustin.herokuapp.com/#1 | |
-- JSON Types need to be mapped into corresponding PG types | |
-- |
# Image | |
gem "carrierwave" | |
# delay load it when necessory or the rest-client should cause thread-unsafe for Net::HTTP | |
gem "carrierwave-upyun", github: "kaichen/carrierwave-upyun" | |
gem "mini_magick" | |
gem 'rails_config' | |
gem "faraday" | |
gem 'simple_form' |
# Capistrano configuration | |
# | |
# require 'new_relic/recipes' - Newrelic notification about deployment | |
# require 'capistrano/ext/multistage' - We use 2 deployment environment: staging and production. | |
# set :deploy_via, :remote_cache - fetch only latest changes during deployment | |
# set :normalize_asset_timestamps - no need to touch (date modification) every assets | |
# "deploy:web:disable" - traditional maintenance page (during DB migrations deployment) | |
# task :restart - Unicorn with preload_app should be reloaded by USR2+QUIT signals, not HUP | |
name | abbrev | utc_offset | is_dst | |
----------------------------------+--------+------------+-------- | |
Africa/Abidjan | GMT | 00:00:00 | f | |
Africa/Accra | GMT | 00:00:00 | f | |
Africa/Addis_Ababa | EAT | 03:00:00 | f | |
Africa/Algiers | CET | 01:00:00 | f | |
Africa/Asmara | EAT | 03:00:00 | f | |
Africa/Asmera | EAT | 03:00:00 | f | |
Africa/Bamako | GMT | 00:00:00 | f | |
Africa/Bangui | WAT | 01:00:00 | f |
CREATE OR REPLACE FUNCTION complex_retension_sfunc(result integer[], retension_record bit varying) RETURNS integer[] AS $$ | |
DECLARE | |
bit_length integer := 0; | |
BEGIN | |
bit_length := BIT_LENGTH(retension_record); | |
-- 初始化 result | |
IF result IS NULL THEN | |
result := '{}'; | |
FOR i IN 1..bit_length LOOP |