This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(function (global, factory) { | |
// 1. CommonJS: typeof exports === 'object' && typeof module !== 'undefined' | |
// 2. AMD: typeof define === 'function' && define.amd | |
// 3. Browser | |
// factory: function () { 'use strict'; } | |
typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() : | |
typeof define === 'function' && define.amd ? define(factory) : | |
(global.Vue = factory()); | |
}(this, (function () { | |
'use strict'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 剔除前后空格和换行符 | |
function trimWrapSpace(obj) { | |
for (var key in obj) { | |
if (obj.hasOwnProperty(key)) { | |
// 如果是字符串, 直接去除末尾空格以及换行符. | |
// 注意变量中的换行符和实际换行 | |
obj[key] = (typeof obj[key] === 'string' || obj[key] instanceof String) ? obj[key].replace(/[\\r\\n]+/g, '').replace(/^\s+|\s+$/g, '') : obj[key]; | |
} | |
} | |
return obj; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
REM 系统重装环境变量初始化 | |
REM ----------- dev ------------ | |
REM java | |
set JAVA_HOME=D:\Java\jdk1.8.0_112 | |
setx /m JAVA_HOME "%JAVA_HOME%" | |
REM maven | |
set MAVEN_HOME=D:\apache-maven-3.5.0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
git config --system http.sslcainfo "D:\Git\mingw64\ssl\certs\ca-bundle.crt" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
DROP TABLE "DB"."TABLE"; | |
CREATE TABLE "DB"."TABLE" ( | |
"ID" NUMBER NOT NULL , | |
"TITLE" VARCHAR2(100 BYTE) NULL , | |
"IMG" VARCHAR2(400 BYTE) NULL , | |
"URL" VARCHAR2(400 BYTE) NULL , | |
"CRETIME" DATE DEFAULT sysdate NULL , | |
"NUM" NUMBER DEFAULT 0 NULL | |
) | |
LOGGING |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// https://stackoverflow.com/questions/16483873/angularjs-http-post-file-and-form-data | |
$http({ | |
method: 'POST', | |
url: '/upload-file', | |
headers: { | |
'Content-Type': 'multipart/form-data' | |
}, | |
data: { | |
email: Utils.getUserInfo().email, | |
token: Utils.getUserInfo().token, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// validate url | |
// 检查 url 是否合法 | |
// https://stackoverflow.com/questions/3809401/what-is-a-good-regular-expression-to-match-a-url | |
// http://regexr.com/3e6m0 | |
function isUrl(url) { | |
return /(http(s)?:\/\/.)?(www\.)?[-a-zA-Z0-9@:%._\+~#=]{2,256}\.[a-z]{2,6}\b([-a-zA-Z0-9@:%_\+.~#?&//=]*)/i.test(url); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# https://unix.stackexchange.com/questions/90853/how-can-i-run-ssh-add-automatically-without-password-prompt | |
$ sudo vim ~/.bashrc | |
if [ -z "$SSH_AUTH_SOCK" ] ; then | |
eval `ssh-agent -s` | |
ssh-add -D | |
ssh-add ~/.ssh/id_rsa_oschina | |
ssh-add ~/.ssh/id_rsa_github | |
ssh-add -l | |
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
REM local tomcat deploy | |
copy target\*.war %TOMCAT_HOME%\webapps\ | |
%TOMCAT_HOME%\bin\catalina.bat start |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<plugin> | |
<groupId>org.apache.maven.plugins</groupId> | |
<artifactId>maven-war-plugin</artifactId> | |
<version>2.1.1</version> | |
<configuration> | |
<webResources> | |
<resource> | |
<!-- this is relative to the pom.xml directory --> | |
<directory>src/main/webapp</directory> | |
</resource> |
NewerOlder