Skip to content

Instantly share code, notes, and snippets.

😉
missing

wisetc

😉
missing
Block or report user

Report or block wisetc

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
@wisetc
wisetc / ContractForm.jsx
Created Sep 17, 2019
Complex interaction with ajax. 纠结的判断。
View ContractForm.jsx
import React, { Component, Fragment } from 'react';
import { Dialog } from 'saltui';
import { observer } from 'mobx-react';
import { toJS } from 'mobx';
import {
Viewport,
InputField,
DataList,
NoContext,
PickerField,
@wisetc
wisetc / deploy.dev.local.sh
Created Sep 3, 2019
gitlab local deployment job scripts
View deploy.dev.local.sh
export DOCKER_MAPPING_DEPLOY_VOLUME="/deployment"
export PROJECT_DEPLOY_DIR_NAME_CURRENT="$DOCKER_MAPPING_DEPLOY_VOLUME/$CI_PROJECT_NAME/$CI_COMMIT_REF_NAME/$(git log -1 --pretty='%h')"
export PROJECT_DEPLOY_DIR_NAME_LATEST="$DOCKER_MAPPING_DEPLOY_VOLUME/$CI_PROJECT_NAME/$CI_COMMIT_REF_NAME/latest"
export TEST_ORIGIN="http://192.168.1.33:8000"
mkdir -p $PROJECT_DEPLOY_DIR_NAME_CURRENT
mkdir -p $PROJECT_DEPLOY_DIR_NAME_LATEST
npm run build
ls -lh build
cp -r build/* $PROJECT_DEPLOY_DIR_NAME_CURRENT
@wisetc
wisetc / _utils.js
Created Sep 3, 2019
Java 微服务前端 request 实例
View _utils.js
import { Toast } from 'saltui';
import Axios from 'axios';
import env from 'src/env';
export const requestHeaders = { 'Content-Type': 'application/json' };
export const transformRequest = (data = {}, headers) => {
if (typeof data === 'string') return data;
return JSON.stringify(data);
@wisetc
wisetc / xhr._utils.js
Created Aug 31, 2019
Make axios instance.
View xhr._utils.js
import { Toast } from 'saltui';
import Axios from 'axios';
import env from 'src/env';
export const requestHeaders = { 'Content-Type': 'application/json' };
export const transformRequest = (data = {}, headers) => {
if (typeof data === 'string') return data;
return JSON.stringify(data);
@wisetc
wisetc / save_build.prod.js
Created Aug 30, 2019
nodejs fetch request with git data.
View save_build.prod.js
// 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 Jul 29, 2019
Basic typescript/javascript project configuration for react.
View tsconfig.json
{
"compilerOptions": {
"allowJs": true,
"target": "es2015",
"baseUrl": "./src",
"outDir": "./build",
"jsx": "react",
"moduleResolution": "node",
"suppressImplicitAnyIndexErrors": true,
"allowSyntheticDefaultImports": true
@wisetc
wisetc / bash
Created Jul 17, 2019 — forked from jonashackt/bash
Remote debugging Spring Boot
View bash
### 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"
View awesome-tpl-style.scss
.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 — forked from fakemelvynkim/advance_commands.vim
advanced vim commands to review
View advance_commands.vim
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
将 react web 项目更新记录到表
View 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;
}
async function getAuthor() {
You can’t perform that action at this time.