Skip to content

Instantly share code, notes, and snippets.

View wisetc's full-sized avatar
😉
missing

Ben wisetc

😉
missing
  • 中国·杭州
View GitHub Profile
@wisetc
wisetc / save_build.prod.js
Created August 30, 2019 02:45
nodejs fetch request with git data.
// save_build.prod.js
// @format
const util = require('util');
const exec = util.promisify(require('child_process').exec);
async function getCommitMessage() {
const { stdout } = await exec(
'echo $(git log -1 --pretty="%B") | tr -d "\n"'
);
return stdout;
@wisetc
wisetc / tsconfig.json
Created July 29, 2019 03:36
Basic typescript/javascript project configuration for react.
{
"compilerOptions": {
"allowJs": true,
"target": "es2015",
"baseUrl": "./src",
"outDir": "./build",
"jsx": "react",
"moduleResolution": "node",
"suppressImplicitAnyIndexErrors": true,
"allowSyntheticDefaultImports": true
@wisetc
wisetc / bash
Created July 17, 2019 05:51 — forked from jonashackt/bash
Remote debugging Spring Boot
### java -jar
java -Xdebug -Xrunjdwp:transport=dt_socket,server=y,address=8001,suspend=y -jar target/cxf-boot-simple-0.0.1-SNAPSHOT.jar
### Maven
Debug Spring Boot app with Maven:
mvn spring-boot:run -Drun.jvmArguments="-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=8001"
@wisetc
wisetc / awesome-tpl-style.scss
Created July 1, 2019 02:54
Field definition
.trusteeship-form {
$labelWidth: 8em;
display: flex;
flex-wrap: wrap;
.suffix-text {
color: #666;
position: relative;
left: -2em;
}
@wisetc
wisetc / advance_commands.vim
Created May 8, 2019 01:29 — forked from fakemelvynkim/advance_commands.vim
advanced vim commands to review
da< (or) da( (or) da{ // delete the block including <,(,{ and >,),} rsply
di< (or) di( (or) di{ // simillarly, but excluing <,(,{ and >,),} rsply
yi< (or) yi( (or) yi{ // yanks simillarly. Simillarly for ciw, viw, etc
df<Space> // delete from current char including the next space
daw // delete current word including the next space
diq // delete current word excluding the next space
yiw // yank current word excluding the next space
yaw // yank current word including the next space
@wisetc
wisetc / save_build.prod.js
Last active May 5, 2019 06:49
将 react web 项目更新记录到表
// @format
const util = require('util');
const exec = util.promisify(require('child_process').exec);
async function getCommitMessage() {
const {stdout} = await exec('echo $(git log -1 --pretty="%B") | tr -d "\n"');
return stdout;
}
async function getAuthor() {
@wisetc
wisetc / FeeForm.jsx
Created April 26, 2019 09:52
费用表单组件 React
import React, { Component, Fragment } from 'react';
import './FeeForm.scss';
import { Viewport, PickerField, DatetimeField, InputField } from 'components';
import { moneyType as moneyTypeEnum } from 'src/enums';
import { utils, feedback } from 'src/lib';
import { Button } from 'saltui';
import { fee, dingtalk } from 'src/store';
import { observer } from 'mobx-react';
import { isObject } from 'lodash';
@wisetc
wisetc / ContractUploader.jsx
Last active July 1, 2019 03:12
移动端页面之上传PDF附件
import React, { Component } from 'react';
import './ContractUploader.scss';
import { Viewport, FormButton, NoContext } from 'components';
import { debug, getUserId, feedback } from 'src/lib';
import * as formAPI from 'src/xhr/form';
import { workflow } from 'src/store';
import LineUploader from '../components/LineUploader';
export class ContractUploader extends Component {
state = {
@wisetc
wisetc / auth.js
Created November 1, 2018 06:35
Chrome extension site auth save.
function Site(host, loginUrl, jqEls) {
this.host = host;
this.loginUrl = loginUrl;
this.usernameEl = jqEls.usernameEl;
this.passwordEl = jqEls.passwordEl;
this.captchaEl = jqEls.captchaEl;
this.buttonEl = jqEls.buttonEl;
}
@wisetc
wisetc / scraw_ishangzu.js
Created October 16, 2018 11:55
快速获取爱上租城市的分区的商圈信息
const axios = require('axios');
const $ = require('cheerio');
async function visitHome() {
const res = await axios.get('https://nj.ishangzu.com/zufang/');
const hrefArr = Array.from(
$('.term-list', res.data)
.eq(1)
.find('a')
)