- 进入你的
home
目录
cd ~
- 编辑
.bashrc
文件
# encoding: utf-8 | |
require 'redis' | |
require 'redis/connection/hiredis' | |
class RedisQueue | |
attr_reader :redis, :queue, :buffer, :timeout | |
attr_accessor :buffer_max | |
def initialize(queue_name, options = {}) |
# a project have many steps | |
class Step | |
module ChainedList | |
extend ActiveSupport::Concern | |
included do | |
# DNode | |
field :prior_step_id, type: BSON::ObjectId | |
field :next_step_id, type: BSON::ObjectId | |
end |
# encoding: utf-8 | |
require 'redis' | |
require 'thread' | |
begin | |
require "active_model/model/validations" | |
rescue LoadError | |
end |
$(function(){ | |
var refresh_id; | |
var scrollToBottom = function(){ | |
$("html, body").animate({ scrollTop: $(document).height() }, 1000); | |
} | |
var refreshDeploymentTrace = function(){ | |
var deployment_id = $('.deployment-show-page').data('id') |
class AuthManager(object): | |
"""Authentication Manager.""" | |
def __new__(cls): | |
singleton = cls.__dict__.get('__singleton__') | |
if singleton is not None: | |
return singleton | |
cls.__singleton__ = singleton = object.__new__(cls) |
from functools import wraps | |
def print_method_name(f): | |
@wraps(f) | |
def decorated(*args, **kwargs): | |
print("enter function: {0}, {1}, {2}".format(f.__name__, args, kwargs)) | |
return f(*args, **kwargs) | |
return decorated |
/** | |
* @author Spirit | |
* @date 2017/12/14 | |
*/ | |
/** | |
* Twitter 雪花算法 | |
* | |
* 0 - 0000000000 0000000000 0000000000 0000000000 0 - 00000 - 00000 - 000000000000 | |
* 1 位标识 |
# -*- mode: ruby -*- | |
# vi: set ft=ruby : | |
BOX_NAME = ENV['BOX_NAME'] || "centos/7" | |
VAGRANTFILE_API_VERSION = "2" | |
CONSUL_ENCRYPT = "eEZJ2MTe0keJc2EkvZ+l3Q==" | |
CONSUL_DATACENTER = "nyc" | |
CONSUL_DATA_DIR = "/var/consul" | |
CONSUL_NODE_IP = { |
global | |
tune.ssl.default-dh-param 1024 | |
defaults | |
timeout connect 10000ms | |
timeout client 60000ms | |
timeout server 60000ms | |
frontend fe_http | |
mode http |