Skip to content

Instantly share code, notes, and snippets.

xiaohui xiaohui-zhangxh

Block or report user

Report or block xiaohui-zhangxh

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
xiaohui-zhangxh / cloudSettings
Last active Apr 22, 2019
Visual Studio Code Settings Sync Gist
View cloudSettings
xiaohui-zhangxh /
Created Nov 1, 2018 — forked from lgersman/
improved state diagram editor based on featuring curvy connections with helper points

new features

  • css improved
  • css transitions added


  • double click on a node to remove it
xiaohui-zhangxh / qcloud_api.rb
Last active Oct 15, 2018
通过 QCloud API 动态更新域名解析
View qcloud_api.rb
#! /usr/bin/env ruby
require 'active_support/core_ext/string'
require 'active_support/core_ext/hash'
require 'active_support/core_ext/object/to_query'
require 'openssl'
require 'base64'
require 'open-uri'
require 'json'
require 'logger'
xiaohui-zhangxh /
Created Jun 4, 2018 — forked from cmer/
Gem In a Box basic authentication & authorization rackup file
# This is a simple rackup file for geminabox. It allows simple role-based authorization.
# roles:
# - developer
# - upload
# - delete
# - admin (can do anything)
# For example, a developer who can access the service and upload new gems would have the following roles: `%w(developer upload)
View tmux_cheatsheet.markdown

tmux cheatsheet

As configured in my dotfiles.

start new:


start new with session name:

View multimodule_assets.rb
load 'deploy' unless defined?(_cset)
_cset :asset_env, "RAILS_GROUPS=assets"
_cset :assets_prefix, "assets"
_cset :assets_role, [:web]
_cset :normalize_asset_timestamps, false
before 'deploy:finalize_update', 'deploy:mm_assets:symlink'
after 'deploy:update_code', 'deploy:mm_assets:precompile'
xiaohui-zhangxh / take_snapshot_of_mobile_website.rb
Created Oct 31, 2013
How to take snapshot for a mobile website
View take_snapshot_of_mobile_website.rb
** Install required packages
sudo apt-get install xvfb # fake X server
sudo apt-get install xfonts-base xfonts-75dpi xfonts-100dpi # fonts
sudo apt-get install iceweasel # this is firefox
require 'headless'
require 'selenium-webdriver'
require 'webdriver-user-agent'
xiaohui-zhangxh / array_combination.rb
Created Sep 28, 2013
Get all unsorted combinations for a certain number items of array
View array_combination.rb
def combine(arr, size)
return [] if size > arr.size || size <= 0
return [arr] if size == arr.size
return{|item| [item]} if size == 1
last = arr[-1]
left = arr[0..-2]
a = combine(left, size - 1).map{|item| item + [last]}
b = combine(left, size)
return a + b
You can’t perform that action at this time.