Skip to content

Instantly share code, notes, and snippets.

View hui's full-sized avatar
🏃‍♂️

Hui Zheng hui

🏃‍♂️
View GitHub Profile
find 000 -type f ! -name "*.*" | xargs -t -i mv {} {}.jpg
@hui
hui / gist:3174355
Created July 25, 2012 04:15
京东配送服务id
JingdongFu.get method: '360buy.delivery.logistics.get'
=> {"delivery_logistics_get_response"=>{"logistics_companies"=>{"vender_id"=>21562, "logistics_list"=>[{"sequence"=>"3", "logistics_id"=>465, "logistics_name"=>"邮政EMS", "logistics_remark"=>"您好!本商城在全国绝大部分地区都能送货上门,因为涂料的特殊性小部分地区只能发送物流,可能需要您自提货物,到指定省市后物流会电话通知客户提货并告知您提货地点,感谢您的理解和支持! \r\n"}, {"sequence"=>"4", "logistics_id"=>1499, "logistics_name"=>"中通速递", "logistics_remark"=>"您好!本商城在全国绝大部分地区都能送货上门,因为涂料的特殊性小部分地区只能发送物流,可能需要您自提货物,到指定省市后物流会电话通知客户提货并告知您提货地点,感谢您的理解和支持! \r\n"}, {"sequence"=>"1", "logistics_id"=>1274, "logistics_name"=>"厂家自送", "logistics_remark"=>"您好!本商城在全国绝大部分地区都能送货上门,因为涂料的特殊性小部分地区只能发送物流,可能需要您自提货物,到指定省市后物流会电话通知客户提货并告知您提货地点,感谢您的理解和支持!"}, {"sequence"=>"2", "logistics_id"=>463, "logistics_name"=>"圆通快递", "logistics_remark"=>"您好!本商城在全国绝大部分地区都能送货上门,因为涂料的特殊性小部分地区只能发送物流,可能需要您自提货物,到指定省市后物流会电话通知客户提货并告知您提货地点,感谢您的理解和支持! \r\n"}]}, "code"=>"0"}}
@hui
hui / gist:3069595
Created July 8, 2012 06:02 — forked from joelmoss/gist:2470666
Capistrano recipe for Puma start/stop/restarts
set :shared_children, shared_children << 'tmp/sockets'
namespace :deploy do
desc "Start the application"
task :start, :roles => :app, :except => { :no_release => true } do
run "cd #{current_path} && RAILS_ENV=#{stage} bundle exec puma -b 'unix://#{shared_path}/sockets/puma.sock' -S #{shared_path}/sockets/puma.state --control 'unix://#{shared_path}/sockets/pumactl.sock' >> #{shared_path}/log/puma-#{stage}.log 2>&1 &", :pty => false
end
desc "Stop the application"
task :stop, :roles => :app, :except => { :no_release => true } do
@hui
hui / rails31init.md
Created January 31, 2012 10:19 — forked from jraines/rails31init.md
Rails 3.1 with Rspec, Cucumber, Factory Girl, Haml, and Simple Form

Install Rails 3.1 RC

gem install rails --pre

generate new app, skipping Test::Unit file generation

rails new my_app -T

Set up Gemfile

@hui
hui / gist:1103342
Created July 25, 2011 01:07
jruby on rails
Gemfile:
if defined?(JRUBY_VERSION)
gem 'jdbc-mysql'
gem 'activerecord-jdbc-adapter'
gem 'activerecord-jdbcmysql-adapter'
gem 'jruby-openssl'
else
gem 'sqlite3'
end
<?xml version="1.0" encoding="UTF-8"?>
<!-- *******************************************************************************************************
based on : Stephan Partzsch
website : http://www.powerflasher.de
date : 05.10.2007
edit by : Marvin Blase
website : http://www.beautifycode.com
/*
### jQuery Google Maps Plugin v1.01 ###
* Home: http://www.mayzes.org/googlemaps.jquery.html
* Code: http://www.mayzes.org/js/jquery.googlemaps1.01.js
* Date: 2010-01-14 (Thursday, 14 Jan 2010)
*
* Dual licensed under the MIT and GPL licenses.
* http://www.gnu.org/licenses/gpl.html
* http://www.opensource.org/licenses/mit-license.php
###
source :gemcutter
gem 'rails', '2.3.5'
gem 'refinerycms'
gem 'authlogic'
gem 'friendly_id'
gem 'hpricot'
gem 'rmagick', '2.12.2'
gem 'will_paginate'
git archive master | bzip2 > ../test.tar.bz2
using terms from application "Google Chrome"
tell application "Google Chrome"
activate
display dialog "Please select a size." buttons {"640 x 480", "800 x 600", "1024 x 768"} with icon note
set button_pressed to the button returned of the result
if button_pressed is "640 x 480" then
set x_size to 640