Skip to content

Instantly share code, notes, and snippets.

Qiming zhao chemzqm

Block or report user

Report or block chemzqm

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
@chemzqm
chemzqm / repl.js
Last active Aug 5, 2019
repl with coc.nvim
View repl.js
// Save the file to ~/.vim/coc-extensions
// Usage: xmap <silent> <TAB> <Plug>(coc-repl-sendtext)
const {commands, workspace} = require('coc.nvim')
exports.activate = context => {
let {nvim} = workspace
let terminal
context.subscriptions.push(commands.registerCommand('repl.openTerminal', async () => {
let filetype = await nvim.eval('&filetype')
let prog = ''
@chemzqm
chemzqm / Address.js
Created May 26, 2019
coc.nvim address extension.
View Address.js
const {sources} = require('coc.nvim')
const {spawn} = require('child_process')
const readline = require('readline')
exports.activate = async context => {
context.subscriptions.push(
sources.createSource({
// unique id
name: 'address',
// unsed in menu
View system.vim
" ============================================================================
" Description: Some system commands for vim
" Author: Qiming Zhao <chemzqm@gmail.com>
" Licence: Vim licence
" Version: 0.3
" Last Modified: Jul 07, 2018
" ============================================================================
if exists('did_system_loaded') || v:version < 700
finish
@chemzqm
chemzqm / e.fish
Last active Mar 14, 2018
Quickly find a directory and file in terminal with fzy
View e.fish
# brew install ag
# brew install fzy
# Usage: e [part of filename]
function e
set -l file (ag . --silent -l -g '' | fzy -q $argv)
if test -z $file
return
else
nvim $file
end
@chemzqm
chemzqm / git-status.js
Created Apr 1, 2017
Gti status by node
View git-status.js
#!/usr/bin/env node
var exec = require('child_process').exec
var Branch = new Promise(function(resolve, reject) {
exec('git symbolic-ref -q HEAD | cut -c 12-', function (err, stdout) {
if (err) return reject(err)
if (stdout.length) return resolve(stdout.replace('\n', ''))
exec('git rev-parse --short HEAD', function (err, stdout) {
if (err) return reject(err)
@chemzqm
chemzqm / promise.js
Created Feb 24, 2017
miniapp promise
View promise.js
var PENDING = 'pending'
var SEALED = 'sealed'
var FULFILLED = 'fulfilled'
var REJECTED = 'rejected'
var NOOP = function(){}
function isArray(value) {
return Object.prototype.toString.call(value) === '[object Array]'
}
@chemzqm
chemzqm / polyfill.js
Created Feb 24, 2017
miniapp polyfill
View polyfill.js
// From https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/keys
if (!Object.keys) {
Object.keys = (function() {
'use strict';
var hasOwnProperty = Object.prototype.hasOwnProperty,
hasDontEnumBug = !({ toString: null }).propertyIsEnumerable('toString'),
dontEnums = [
'toString',
'toLocaleString',
'valueOf',
@chemzqm
chemzqm / gist:faa1f6bac2eddc3c15026c1109a8e69f
Last active Dec 7, 2016
neovim startup log with python remote plugin
View gist:faa1f6bac2eddc3c15026c1109a8e69f
# Command used: nvim --startuptime tmp.txt
# no autocmd and no g:python...
times in msec
clock self+sourced self: sourced script
clock elapsed: other lines
000.009 000.009: --- NVIM STARTING ---
000.592 000.583: locale set
@chemzqm
chemzqm / css.diff
Created Oct 12, 2016
微信小程序 101100 版本样式变更
View css.diff
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;
View .stylelintrc
{
"rules": {
"at-rule-empty-line-before": [ "always", {
"except": [
"blockless-after-same-name-blockless",
"first-nested"
],
"ignore": ["after-comment"]
}],
"at-rule-name-case": "lower",
You can’t perform that action at this time.