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 / .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 / 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 / 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 / flexbox.less
Last active August 29, 2015 14:21 — forked from jayj/flexbox.less
// FlexLess
// ========
//
// Less mixins for using flexbox without crying.
//
// Last update: 02.08.2013
@LeezQ
LeezQ / js.jade
Created May 11, 2015 04:34
jade 中使用 Inline script
simply use a 'script' tag with a dot after.
script.
var users = !{JSON.stringify(users).replace(/<\//g, "<\\/")}
@LeezQ
LeezQ / vertical-align.css
Created May 4, 2015 14:47
图片垂直居中
.swipe-wrap > div a {
-webkit-transform-style: preserve-3d;
display: block;
}
.swipe-wrap a img {
position: relative;
top: 50%;
transform: translateY(-50%);
}
@LeezQ
LeezQ / Enhance.js
Last active August 29, 2015 14:20 — forked from sebmarkbage/Enhance.js
import { Component } from "React";
export var Enhance = ComposedComponent => class extends Component {
constructor() {
this.state = { data: null };
}
componentDidMount() {
this.setState({ data: 'Hello' });
}
render() {