sudo su - postgres
psql
CREATE USER wwwuser WITH PASSWORD 'password';
CREATE DATABASE wwwuser OWNER wwwuser;
GRANT ALL PRIVILEGES ON DATABASE wwwuser to wwwuser;
package main | |
import "testing" | |
func BenchmarkInitLen(b *testing.B) { | |
n := b.N | |
for i := 0; i < n; i++ { | |
a := make([]int64, n) | |
for j := 0; j < n; j++ { | |
a[j] = int64(j) |
{ | |
"environment": "production", | |
"port": 3000, | |
"daemonize": true, | |
"pid_file": "tmp/pids/passenger.pid", | |
"log_file": "log/passenger.log" | |
} |
ActiveRecord::Base.connection.tables.each { |name| puts "VACUUM ANALYZE #{name}"; ActiveRecord::Base.connection.execute("VACUUM ANALYZE #{name};") } |
class CustomError < StandardError | |
# custom options to GraphQLError | |
def options | |
end | |
end | |
class MuationError < CustomError | |
def initialize(key) | |
@key = key | |
message = I18n.t(key, scope: 'mutations.errors') |
# gem 'i18n_generators' | |
# rails g i18n_translation zh-CN | |
require 'yaml' | |
local = YAML.load_file(Rails.root.join('config/locales/translation_zh-CN.yml')) | |
models = local.dig('zh-CN', 'activerecord', 'models') | |
attributes = local.dig('zh-CN', 'activerecord', 'attributes') | |
models.each do |key, value| |
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset="utf-8"> | |
<title>test</title> | |
<script type="text/javascript" src="//cdn.bootcss.com/jquery/1.12.4/jquery.min.js"></script> | |
<script type="text/javascript"> | |
$(function(){ | |
$.get('http://huimin-media0.smart-museum.cn/pano/bingmayong/one.html', function(html) { |
<!DOCTYPE html> | |
<html> | |
<head> | |
<title>系统升级中</title> | |
<meta name="viewport" content="width=device-width,initial-scale=1"> | |
<style> | |
body { | |
background-color: #EFEFEF; | |
color: #2E2F30; | |
text-align: center; |
sudo su - postgres
psql
CREATE USER wwwuser WITH PASSWORD 'password';
CREATE DATABASE wwwuser OWNER wwwuser;
GRANT ALL PRIVILEGES ON DATABASE wwwuser to wwwuser;
# http://www.imagemagick.org/script/command-line-options.php#append | |
# append two images vertically | |
# conver -append first.png second.png result.png | |
MiniMagick::Tool::Convert.new do |convert| | |
convert.append.- | |
convert << "first.png" | |
convert << "second.png" | |
convert << "result.png" | |
end |
#!/bin/bash | |
# Teamcity buildagent daemon start/stop script. | |
### BEGIN INIT INFO | |
# Provides: Teamcity buildagent | |
# Required-Start: $local_fs $network $remote_fs | |
# Should-Start: ypbind nscd ldap ntpd xntpd | |
# Required-Stop: $local_fs $network $remote_fs | |
# Default-Start: 2 3 4 5 |