Skip to content

Instantly share code, notes, and snippets.

@hkneptune
hkneptune / ProgressInformation.java
Created December 19, 2016 16:51
Zip4j Library Archive Progress Information
import java.io.File;
import java.util.ArrayList;
import net.lingala.zip4j.core.ZipFile;
import net.lingala.zip4j.exception.ZipException;
import net.lingala.zip4j.model.ZipParameters;
import net.lingala.zip4j.progress.ProgressMonitor;
import net.lingala.zip4j.util.Zip4jConstants;
/**
@hkneptune
hkneptune / atom.io
Created December 19, 2016 17:05
Recommended Atom.io Packages
atom-beautify
chinese-translator
file-icons
highlight-line
highlight-selected
linter
linter-annotations
minimap
minimap-bookmarks
minimap-highlight-selected
@hkneptune
hkneptune / google-photos-search-tips.md
Last active June 11, 2017 03:16
Google Photos Search Tips

Search by Date Range

For example, the photos that are taken on May 1, 2014 will be shown in the result.

from 20140501 to 20140502

For example, the photos that are taken from April 30, 2014 to May 1, 2014 will be shown in the result.

from 20140501
@hkneptune
hkneptune / eclipse-java-clean-formatter-15.xml
Last active January 9, 2019 05:50
Eclipse Java Clean Formatter
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<profiles version="15">
<profile kind="CodeFormatterProfile" name="Clean Formatter" version="15">
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_ellipsis" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_enum_declarations" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_allocation_expression" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_at_in_annotation_type_declaration" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.parentheses_positions_in_for_statment" value="common_lines"/>
<setting id="org.eclipse.jdt.core.formatter.comment.new_lines_at_block_boundaries" value="true"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_constructor_declaration_parameters" value="insert"/>
@hkneptune
hkneptune / dasho-java-win10.md
Last active September 2, 2020 01:51
DashO for Android & Java Setup on Windows 10

DashO for Android & Java Setup on Windows 10

Prerequisites

  1. Download DashO for Android & Java on PreEmptive Solutions and then extract it into a local directory. For example: D:\programming\DashO-10.3.
  2. Download Java SE Development Kit 8 and install it.
  3. Download Apache Ant and extract it into a local directory. For example: D:\programming\apache-ant-1.10.8.
  4. Put the license file dasho.dat into the DashO directory.

System Environment Variables

@hkneptune
hkneptune / maven-build-with-dasho-obfuscation.md
Last active May 27, 2019 09:05
Configure Obfuscation with the PreEmptive Protection DashO in Apache Maven Project

Configure Obfuscation with the PreEmptive Protection DashO in Apache Maven Project

Prerequisites

  1. Download DashO for Android & Java on PreEmptive Solutions and then extract it into a local directory. For example: C:\programming\DashO-9.3.0.
  2. Activate the DashO with DashOGUI.
  3. Download Open Java Development Kit (OpenJDK) and then extract it into a local directory. For example: C:\Java\jdk-11.0.2.
  4. Dwonload Apache Maven and then extract it into a local directory. For example: C:\programming\apache-maven-3.6.1.
  5. Configure the user variable DASHO_HOME, DASHO_JAVA_HOME, JAVA_HOME, MAVEN_HOME.
DASHO_HOME=C:\programming\DashO-9.3.0
@hkneptune
hkneptune / getting-the-path-of-maven-dependency-as-a-maven-property.md
Last active June 10, 2019 03:52
Getting the Path of Maven Dependency as a Maven Property

Getting the Path of Maven Dependency as a Maven Property

  1. Setup the maven-dependency-plugin plugin with properties goal.
<plugin>
    <groupId>org.apache.maven.plugins</groupId>
    <artifactId>maven-dependency-plugin</artifactId>
    <version>3.1.1</version>
    <executions>
 
@hkneptune
hkneptune / Useful-Eclipse-Plugins.md
Last active January 8, 2020 07:02
Useful Eclipse Plugins
@hkneptune
hkneptune / nowtv-live-fullscreen.user.js
Last active August 7, 2019 14:29
NOWTV LIVE FULLSCREEN SCRIPT
// ==UserScript==
// @name NOWTV-LIVE-FULLSCREEN
// @namespace https://neptuneli.com/
// @version 1.0
// @description NOWTV LIVE FULLSCREEN SCRIPT
// @author Neptune LI (@hkneptune)
// @match https://news.now.com/home/live
// @match https://news.now.com/home/live331a
// @grant none
// ==/UserScript==
@hkneptune
hkneptune / X509CertificateUtils.java
Created September 25, 2019 02:59
Get the Serial Number of a X509 Certificate
package com.neptuneli.utils;
import java.math.BigInteger;
import org.bouncycastle.jce.provider.BouncyCastleProvider;
import java.security.cert.CertificateFactory;
import java.security.cert.X509Certificate;
public class X509CertificateUtils {
public String getCertSerialNo(final String certPath) {