Skip to content

Instantly share code, notes, and snippets.

View gdouzwt's full-sized avatar
💬
I may be slow to respond.

zwt gdouzwt

💬
I may be slow to respond.
View GitHub Profile
@gdouzwt
gdouzwt / delete-remote-branches
Created May 14, 2021 06:50
Delete remote branches
git branch -a
# *master
# test
# remote/origin/master
# remote/origin/test
git push origin --delete test
# To <URL of your repository>.git
# - [deleted] test
@gdouzwt
gdouzwt / GetResourcePath.java
Last active September 12, 2020 15:02
Get absolute path to file in /resources folder
URL res = getClass().getClassLoader().getResource("abc.txt");
File file = Paths.get(res.toURI()).toFile();
String absolutePath = file.getAbsolutePath();
@gdouzwt
gdouzwt / jmeterSample.bat
Created July 25, 2020 23:33
JMeter测试例子
.\jmeter.bat -n -t ..\..\testplan\devicesTest.jmx -l ..\..\testplan\result\result.txt -e -o ..\..\testplan\webreport
@gdouzwt
gdouzwt / StringToHex.java
Created July 4, 2020 12:58
Converting A String to Hexadecimal in Java
public String toHex(String arg) {
return String.format("%040x", new BigInteger(1, arg.getBytes(/*YOUR_CHARSET?*/)));
}
@gdouzwt
gdouzwt / Traverse.java
Created June 6, 2020 00:12
将pom.xml的artifactId和finalName值改为当前目录名
import org.w3c.dom.Document;
import org.w3c.dom.NodeList;
import org.xml.sax.SAXException;
import javax.xml.parsers.DocumentBuilder;
import javax.xml.parsers.DocumentBuilderFactory;
import javax.xml.parsers.ParserConfigurationException;
import javax.xml.transform.Transformer;
import javax.xml.transform.TransformerException;
import javax.xml.transform.TransformerFactory;