Skip to content

Instantly share code, notes, and snippets.

View devbhuwan's full-sized avatar

Bhuwan Prasad Upadhyay devbhuwan

View GitHub Profile
@devbhuwan
devbhuwan / jsoup
Created July 16, 2015 18:52
jsoup
/**
*
* @author developerbhuwan
*/
public class JsoupExample {
private static final String URL = "http://www.bhuwanupadhyay.com.np/";
public static void main(String[] args) {
try {
@devbhuwan
devbhuwan / LaunchAppInNativeOSToHandleLinkAndFile.java
Last active August 5, 2016 06:08
How to launch associated applications registered on the native desktop to handle link or a file in Java
import java.awt.Desktop;
import java.io.File;
import java.net.URI;
/**
*
* @author Bhuwan Prasad Upadhyay
*/
public class LaunchAppInNativeOSToHandleLinkAndFile {
@devbhuwan
devbhuwan / pom.xml
Created October 14, 2016 09:41
POM structure for JUnit 5 Milestone released with Mockito
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.yourgroupname</groupId>
<artifactId>junit5-your-artifact-name</artifactId>
<version>1.0</version>
<packaging>jar</packaging>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
@devbhuwan
devbhuwan / HelloWorldInJdk9WithEA.java
Created October 22, 2016 07:13
Hello World In Jdk9 With Early Access Release
public class HelloWorldInJdk9WithEA {
public static void main(String[] args) {
System.out.println("Welcome Java 9!!");
}
}
@devbhuwan
devbhuwan / programmer-quotes.md
Last active December 12, 2016 05:22
Great Computer Programmer Quotes

Java

"Java is C++ without the guns, knives, and clubs." - James Gosling

Pragmatic Practice

"Copy and paste is a design error. " - David Parnas

Software Testing

"Programming is like sex. One mistake and you have to support it for the rest of your life." - Michael Sinz

@devbhuwan
devbhuwan / .gitignore
Last active October 25, 2016 09:15
Ignore IDE project files, java packages and also classes in git under depth sub modules also
#Bytecode
*.class
# Mobile Tools for Java (J2ME)
.mtj.tmp/
# Package Files
*.jar
*.war
*.ear
<plugin>
<!-- Ant Maven Plugin -->
<artifactId>maven-antrun-plugin</artifactId>
<version>1.8</version>
<dependencies>
<!-- For Ant Contrib Tasks -->
<dependency>
<groupId>ant-contrib</groupId>
<artifactId>ant-contrib</artifactId>
<?xml version="1.0" encoding="UTF-8" ?>
<project>
<target name="antBuild">
<!-- Properties value inside this traget scope -->
<property name="rootDir" value="."/>
<property name="author" value="Bhuwan Prasad Upadhyay"/>
<?xml version="1.0" encoding="UTF-8" ?>
<project>
<target name="antCopy">
<!--
<buildDir> and <srcDir> properties are pass in pom.xml in ant target configuration
<rootDir> property pass in antBuild.xml of antBuild target
-->
<?xml version="1.0" encoding="UTF-8" ?>
<project>
<target name="antReplace">
<!--
<buildDir> and <srcDir> properties are pass in pom.xml in ant target configuration
<rootDir> property pass in antBuild.xml of antBuild target
-->