Skip to content

Instantly share code, notes, and snippets.

View chemzqm's full-sized avatar
🇨🇳
Focusing

Qiming zhao chemzqm

🇨🇳
Focusing
View GitHub Profile
@chemzqm
chemzqm / css.diff
Created October 12, 2016 06:49
微信小程序 101100 版本样式变更
diff --git a/public/css/default.css b/public/css/default.css
index f5a50e2..f50d447 100644
--- a/public/css/default.css
+++ b/public/css/default.css
@@ -1,19 +1,15 @@
-html,
-body {
+html {
-webkit-user-select: none;
- -moz-user-select: none;
{
"rules": {
"at-rule-empty-line-before": [ "always", {
"except": [
"blockless-after-same-name-blockless",
"first-nested"
],
"ignore": ["after-comment"]
}],
"at-rule-name-case": "lower",
@chemzqm
chemzqm / devlorem.vim
Created September 13, 2016 03:51
load lorem from web API
command! -nargs=* Lorem :call s:LoadLorem(<f-args>)
" load lorem with number and optional tag name
function! s:LoadLorem(...)
let num = get(a:, 1, 1)
let html_tag = exists('a:2') ? a:2 : ''
let url = 'https://devlorem.kovah.de/api/'.num.'/json'
let output = system('curl -s '.url)
if v:shell_error && output !=# ""
echohl Error | echon output | echohl None
if exists('did_completes_me_loaded') || v:version < 700
finish
endif
let did_completes_me_loaded = 1
function! s:completes_me(shift_tab)
let dirs = ["\<c-p>", "\<c-n>"]
if get(b:, 'complete_disable', 0)
return a:shift_tab ? "\<S-Tab>" : "\<Tab>"
endif
@chemzqm
chemzqm / neorun.vim
Last active February 21, 2016 13:43
" vim:set et sw=2 ts=2 tw=78 nofen:
if exists('did_neorun_loaded') || v:version < 700 || !has('nvim')
finish
endif
let did_neorun_loaded = 1
command! -nargs=? Nrun :call s:TernimalRun(<q-args>)
function! s:TernimalRun(cmd)
execute 'belowright 5new'
@chemzqm
chemzqm / .pydistutils.cfg
Last active February 19, 2016 17:28
fix pip3 not works on OSX EL Captain
# this would fix the error like: [Errno 1] Operation not permitted: '/bin/vint'
# file should be ~/.pydistutils.cfg
# use homebrew to install python/python3
# see also http://stackoverflow.com/questions/33004708/osx-el-capitan-sudo-pip-install-oserror-errno-1-operation-not-permitted
[install]
prefix=/usr/local
@chemzqm
chemzqm / simple_pairs.vim
Last active May 9, 2019 16:28
Fixed simple_pairs
" ============================================================================
" Description: Insert pair charactor automaticly
" Author: Qiming Zhao <chemzqm@gmail.com>
" Licence: Vim licence
" Version: 0.1
" Last Modified: Sep 13, 2016
" ============================================================================
if exists('did_simple_pairs_loaded') | finish | endif
let did_simple_pairs_loaded = 1
let s:pairs = {'(': ')', '[': ']', '{': '}', '"': '"', "'": "'", '`' : '`'}
@chemzqm
chemzqm / chrome.sh
Last active January 29, 2016 19:20
Fixed open url for Chrome
#!/usr/bin/env bash
if [[ $1 =~ ^http.* ]]; then
file=$1
else
file=file://`realpath $1`
fi
cat << EOF | sed "s+full_path+$file+" | osascript -
if application "Google Chrome" is not running then
@chemzqm
chemzqm / Qdo.vim
Created January 16, 2016 08:30
Add Qdo and Qargs command used for replaceAll
" ============================================================================
" Description: Add Qdo and Qargs command used for replaceAll
" Author: Qiming Zhao <chemzqm@gmail.com>
" Licence: Vim licence
" Version: 0.1
" Last Modified: December 31, 2015
" ============================================================================
if exists('did_qdo_loaded') || v:version < 700
finish
endif
@chemzqm
chemzqm / system.vim
Last active January 19, 2016 06:32
Some system commands for vim
" ============================================================================
" Description: Some system commands for vim
" Author: Qiming Zhao <chemzqm@gmail.com>
" Licence: Vim licence
" Version: 0.2
" Last Modified: January 19, 2016
" ============================================================================
if exists('did_system_loaded') || v:version < 700
finish