Skip to content

Instantly share code, notes, and snippets.

@darkcar
darkcar / myreact.md
Last active September 24, 2019 05:43
react

Webpack

npm init -y

mkdir src dist

npm i webpack -D

npm i webpack-cli -D

@darkcar
darkcar / webpack.md
Created September 23, 2019 03:11
How to use webpack 4+

Here Learning the webpack

1. Steps to follow:

  • npm init -y
  • npm i -D webpack webpack-cli
  • Create ./src/index.js file
  • Edit package.json file, and add script 'build':'any message here'
  • Run the command: npm run webpack
class Solution {
public List<List<Integer>> combinationSum(int[] candidates, int target) {
// Sort candidates
Arrays.sort(candidates); // Time complexity: O(nlogn)
List<List<Integer>> result = new ArrayList<List<Integer>>();
List<Integer> eachSolution = new ArrayList<Integer>();
for(int i = 0; i < candidates.length; i ++) {
if(target % candidates[i] == 0) {
for(int j = 0; j < target / candidates[i]; j ++) {
@darkcar
darkcar / BinarySearchTreeUtils.java
Created April 30, 2019 21:37
The Binary Search Tree Functions Set
package com.frank.binarysearchtree;
import java.util.LinkedList;
public class BinarySearchTreeUtils {
public static TreeNode binarySearchTree(TreeNode root, int target) {
TreeNode node = root;
while (node != null) {
if (node.val < target) {
<?xml version="1.0"?>
<!DOCTYPE user-notification-definitions
PUBLIC "-//Liferay//DTD User Notification Definitions 6.2.0//EN"
"http://www.liferay.com/dtd/liferay-user-notification-definitions_6_2_0.dtd">
<user-notification-definitions>
<definition>
<notification-type>${ca.sk.sgi.employee.portlet.DockBarUserNotificationHandler.PORTLET_ID}</notification-type>
<description>receive-a-notification-when-administrator-triggered</description>
<delivery-type>
<name>email</name>
@darkcar
darkcar / ELVISSignInPortlet.java
Created March 20, 2018 16:19
The login portlet
package elvis.sgi.sk.ca.signin.portlet;
import com.liferay.portal.kernel.exception.PortalException;
import com.liferay.portal.kernel.exception.SystemException;
import com.liferay.portal.kernel.log.Log;
import com.liferay.portal.kernel.log.LogFactoryUtil;
import com.liferay.portal.kernel.portlet.NoRedirectActionResponse;
import com.liferay.portal.kernel.struts.PortletActionInvoker;
import com.liferay.portal.kernel.util.ParamUtil;
import com.liferay.portal.kernel.util.Validator;