Skip to content

Instantly share code, notes, and snippets.

View xuanyu-h's full-sized avatar
🎯
Focusing

xuanyu xuanyu-h

🎯
Focusing
  • Shanghai
View GitHub Profile
@xuanyu-h
xuanyu-h / deployment.js
Created November 3, 2017 07:06
deployment
$(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')
@xuanyu-h
xuanyu-h / redis_persistence.rb
Last active March 24, 2017 15:32
a simple redis orm
# encoding: utf-8
require 'redis'
require 'thread'
begin
require "active_model/model/validations"
rescue LoadError
end
@xuanyu-h
xuanyu-h / git-branch.md
Created March 23, 2017 03:07 — forked from yisibl/git-branch.md
在Mac、Linux 终端显示 Git 当前所在分支

在Mac、Linux 终端显示 Git 当前所在分支

  1. 进入你的home目录
cd ~
  1. 编辑.bashrc文件
@xuanyu-h
xuanyu-h / ChainedList.rb
Last active December 12, 2016 08:03
ChainedList
# 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
@xuanyu-h
xuanyu-h / redis_queue.rb
Created September 30, 2016 03:15
redis queue
# 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 = {})