Skip to content

Instantly share code, notes, and snippets.

View LeezQ's full-sized avatar
🏠
Working from home

allence LeezQ

🏠
Working from home
View GitHub Profile
const request = require('request');
const crypto = require('crypto');
const fs = require('fs');
module.exports = antOpenUnionBlockchain;
function antOpenUnionBlockchain(options, callback) {
if(!options.AccessId) return callback('Please provide AccessId.');
if(!options.AccessKey) return callback('Please provide AccessKey Path.');
@LeezQ
LeezQ / api.gen.js
Last active May 22, 2019 11:52
api.gen.js
function config(api, sdkDir) {
const tmp = sdkDir.split('/');
const namespace = tmp[tmp.length - 1];
return {
api,
sdkDir,
namespace: `${namespace[0].toUpperCase()}${namespace.substr(1)}API`,
camelCase: 'lower',
templatePath: './src/services/sdk.njk',
interfaceTemplatePath: './src/services/interface.njk',
@LeezQ
LeezQ / .prettierignore
Created December 27, 2018 11:49
ts 设置
**/*.md
**/*.svg
**/*.ejs
**/*.html
package.json
.umi
.umi-production
@LeezQ
LeezQ / request.js
Created December 26, 2018 10:19
request
import fetch from 'dva/fetch';
import qs from 'qs';
import router from 'umi/router';
import { notification } from 'antd';
import message from 'antd/lib/message';
import getCookie from './getCookie';
const messages = {
@LeezQ
LeezQ / model.ts
Last active December 18, 2018 09:15
dva-model
import * as menuServices from '@/services/atgauth/menu';
export default {
namespace: 'model',
state: {
menuTree: [],
},
effects: {
@LeezQ
LeezQ / 1px.js
Last active December 18, 2018 06:57
1px
if (window.devicePixelRatio && devicePixelRatio >= 2) {
var testElem = document.createElement('div');
testElem.style.border = '.5px solid transparent';
document.body.appendChild(testElem);
if (testElem.offsetHeight == 1) {
document.documentElement.classList.add('hairlines');
}
document.body.removeChild(testElem);
}
@LeezQ
LeezQ / serializeObject.js
Created September 24, 2013 06:34
用于 form 将 searilized 数据转为 json
(function($) {
/**
* code from stackoverflow:
* http://stackoverflow.com/questions/1184624/convert-form-data-to-js-object-with-jquery
*
* 用于处理 serializeAray 数据后格式
*
* <form id="form">
* <input type="text" name="lname" value="lee"/>
* <input type="text" name="fname" value="zq"/>
@LeezQ
LeezQ / js-method
Created September 11, 2013 07:22
js 常用
$.ajax({
url: '/twitter/newtwitter',
type: "POST",
timeout: 60000,
data: data,
dataType: 'json',
success: function(json){
if (json == null) {
alert(MGLANG.msgTimeout);
} else {
@LeezQ
LeezQ / css 常用
Created September 2, 2013 11:37
css 一些常用
/*
* css线性渐变:
* http://www.w3cplus.com/content/css3-gradient
*/
background: -webkit-linear-gradient(top,#fff,#ededed, #fff);
/*
* 带有角度的
*/
background:-webkit-linear-gradient(45deg, #ef3c60 0, #f55679 50%, #f66c8b 50%, #f76f8d 100%);
@LeezQ
LeezQ / gitconfig
Created September 2, 2013 05:38
my git config file
[user]
name = LeezQ
email = lizhenq2009@gmail.com
[push]
default = simple
[alias]
st = status
co = checkout
ci = commit
br = branch