Skip to content

Instantly share code, notes, and snippets.

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

Hui Zheng hui

🏃‍♂️
View GitHub Profile

Keybase proof

I hereby claim:

  • I am hui on github.
  • I am huizheng (https://keybase.io/huizheng) on keybase.
  • I have a public key ASBC8dlox5vsaz3MK66ZZr9F72deCS7cA3OO5DeeizEMcgo

To claim this, I am signing this object:

@hui
hui / postgresql-set-id-seq.sql
Created October 4, 2018 01:59 — forked from henriquemenezes/postgresql-set-id-seq.sql
PostgreSQL set Next ID Sequence Value to MAX(id) from Table
-- Get Max ID from table
SELECT MAX(id) FROM table;
-- Get Next ID from table
SELECT nextval('table_id_seq');
-- Set Next ID Value to MAX ID
SELECT setval('table_id_seq', (SELECT MAX(id) FROM table));
@hui
hui / postgres_queries_and_commands.sql
Created September 25, 2018 11:31 — forked from rgreenjr/postgres_queries_and_commands.sql
Useful PostgreSQL Queries and Commands
-- show running queries (pre 9.2)
SELECT procpid, age(clock_timestamp(), query_start), usename, current_query
FROM pg_stat_activity
WHERE current_query != '<IDLE>' AND current_query NOT ILIKE '%pg_stat_activity%'
ORDER BY query_start desc;
-- show running queries (9.2)
SELECT pid, age(clock_timestamp(), query_start), usename, query
FROM pg_stat_activity
WHERE query != '<IDLE>' AND query NOT ILIKE '%pg_stat_activity%'
@hui
hui / jsfmt.js
Created December 7, 2014 10:26
jsfmt配置
{
"autoformat": true,
"options": {
"preset": "jquery",
"indent": {
"value": " "
},
// plugins included
"plugins": [
"esformatter-quotes",
inputs = %w[
CollectionSelectInput
DateTimeInput
FileInput
GroupedCollectionSelectInput
NumericInput
PasswordInput
RangeInput
StringInput
TextInput
@hui
hui / deploy.rb
Created November 10, 2013 08:47 — forked from stas/deploy.rb
require 'mina/bundler'
require 'mina/rails'
require 'mina/git'
require 'mina/rbenv' # for rbenv support. (http://rbenv.org)
# require 'mina/rvm' # for rvm support. (http://rvm.io)
# Basic settings:
# domain - The hostname to SSH to.
# deploy_to - Path to deploy into.
# repository - Git repo to clone from. (needed by mina/git)
@hui
hui / deploy.rb
Created November 1, 2013 02:54 — forked from stas/deploy.rb
require 'mina/bundler'
require 'mina/rails'
require 'mina/git'
require 'mina/rbenv' # for rbenv support. (http://rbenv.org)
# require 'mina/rvm' # for rvm support. (http://rvm.io)
# Basic settings:
# domain - The hostname to SSH to.
# deploy_to - Path to deploy into.
# repository - Git repo to clone from. (needed by mina/git)
@hui
hui / kindeditor.js.coffee
Last active December 16, 2015 12:29
kindeditor for angularjs
angular.module('kindeditor', []).directive 'kindeditor', ->
require: '?ngModel'
link: (scope, elm, attr, ngModel)->
unless ngModel then return
ngModel.$render = (value)->
unless ngModel.editor
csrfToken = $('meta[name=csrf-token]').attr('content')
csrfParam = $('meta[name=csrf-param]').attr('content')
extraParams = {}
@hui
hui / gist:4736772
Last active December 12, 2015 07:28
// Instructions:
// (1) Browse to your favorite Trello board
// (2) Drop this into your friendly Chrome inspector or Firefox Firebug console
$('.list').each(function(index) {
var outer = $(this);
$(this).find('h2.current').each(function(index) {
$(this).text($(this).text() + " (" + outer.find('.list-card').length + ")");
})
})
  • 解压缩文件, 修正GBK编码
env LANG=GBK 7za x -olande "kepulande-r2  1.31.zip"
find . -exec convmv -f GBK -t utf8 --notest -r {} \;
  • 修改 import_image_libraries_for_kepulande.rake
  • 修改要导入的xls文件名
  • 修改解压缩的文件路径