Skip to content

Instantly share code, notes, and snippets.

View Create-react-app
一、为Create-react-app项目配置支持绝对路径引入模块
Messing around I just found one setting that works without craco for the absolute paths:
1 - Update .env file to NODE_PATH=./;
2 - Create one tsconfig.paths.json:
{
"compilerOptions": {
View generateUUID
/**
* @export generateUUID
* @returns {String}
* @description RFC4122 version 4 compliant solution
* @link
* https://stackoverflow.com/questions/105034/create-guid-uuid-in-javascript
*/
export function generateUUID () {
return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(
/[xy]/g, function(c: string) {
View tslint.json
{
"extends": ["tslint-react"],
"rules": {
"ban": false,
"class-name": true,
"comment-format": [
true,
"check-space"
],
"curly": true,
@ydhao
ydhao / Rewrite_GitConfig.sh
Created Dec 3, 2018
rewrite git config user email and name
View Rewrite_GitConfig.sh
#!/bin/sh
git filter-branch --env-filter '
OLD_EMAIL="旧的Email地址"
CORRECT_NAME="正确的用户名"
CORRECT_EMAIL="正确的邮件地址"
if [ "$GIT_COMMITTER_EMAIL" = "$OLD_EMAIL" ]
then
export GIT_COMMITTER_NAME="$CORRECT_NAME"
export GIT_COMMITTER_EMAIL="$CORRECT_EMAIL"
fi
@ydhao
ydhao / gencert.sh
Created Nov 30, 2018 — forked from ansiz/gencert.sh
generate self-signed ssl certs
View gencert.sh
#!/bin/sh
# create self-signed server certificate:
read -p "Enter your domain [www.example.com]: " DOMAIN
echo "Create server key..."
openssl genrsa -des3 -out $DOMAIN.key 1024
View AMap.d.ts
/**
* @copyright ydhao 2018 Clustertech Limited. All rights reserved.
* @author YanDong Hao (377868419@qq.com)
*
* @file Type definitions for AMap
*/
declare module AMap {
/**
* 此对象用于表示地图、覆盖物、叠加层上的各种鼠标事件返回,包含以下字段:
View go-shadowsocks-install.sh
#!/usr/bin/env bash
PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin:~/bin
export PATH
#=================================================================#
# System Required: CentOS, Debian, Ubuntu #
# Description: One click Install Shadowsocks-go server #
# Author: Teddysun <i@teddysun.com> #
# Thanks: @cyfdecyf <https://twitter.com/cyfdecyf> #
# Intro: https://teddysun.com/392.html #
#==================================================================
View install-openvpn.sh
#!/bin/bash
# OpenVPN road warrior installer for Debian, Ubuntu and CentOS
# This script will work on Debian, Ubuntu, CentOS and probably other distros
# of the same families, although no support is offered for them. It isn't
# bulletproof but it will probably work if you simply want to setup a VPN on
# your Debian/Ubuntu/CentOS box. It has been designed to be as unobtrusive and
# universal as possible.
View parseURI.md
function parseURI(url) {
  var m = String(url).replace(/^\s+|\s+$/g, ‘’).match(/^([^:\/?#]+:)?(\/\/(?:[^:@]*(?::[^:@]*)?@)?(([^:\/?#]*)(?::(\d*))?))?([^?#]*)(\?[^#]*)?(#[\s\S]*)?/);
  // authority = ‘//‘ + user + ‘:’ + pass ‘@‘ + hostname + ‘:’ port
  return (m ? {
    href: m[0] || ‘’,
    protocol: m[1] || ‘’,
    authority: m[2] || ‘’,
    host: m[3] || ‘’,
    hostname: m[4] || ‘’,
View Vue_learn.md

Vue-demo Learn

配置基本环境

1、安装node.js

参考文档:https://nodejs.org/zh-cn/

使用nvm作为node.js版本管理工具

You can’t perform that action at this time.
You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.