Skip to content

Instantly share code, notes, and snippets.

@haintwork
haintwork / java-delete-folder-files.md
Created August 23, 2017 09:50
Java Delete Folder including Sub Folders and Files
import org.apache.commons.io.FileUtils;

FileUtils.deleteDirectory(new File(destination));
@haintwork
haintwork / Adding certificates to the local certificates store and setting local policy using a command line – System Center Updates Publisher example.md
Created August 22, 2017 06:53
Adding certificates to the local certificates store and setting local policy using a command line – System Center Updates Publisher example
@haintwork
haintwork / A Software Developer’s Guide to Side Projects.md
Last active August 20, 2017 11:30
A Software Developer’s Guide to Side Projects
  • A dream is something you chase and a goal is something you do and finish.
  • Become a finisher.
  • Make a side project to serve at least 2 purposes.
  • Side project is a multi-purposes task.
  • Always look through the end before starting somthing and you have to finish it when you start it.
  • Be consistency and discipline, following the schedule.
  • When starting a new side project, make this check list:
    • The minimum set of features you know the project will complete.
    • Set the deadline of project and add some buffer but not too much.
  • Design a system and consistent following that schedule.
@haintwork
haintwork / create-todo-app-with-react-and-redux.md
Last active November 20, 2023 21:18
Tutorial: Create Todo App with React and Redux

Sử dụng Redux

Giới thiệu Redux

  • Redux là thư viện dùng để quản lý trạng thái của ứng dụng/hệ thống.
  • Redux có thể được dùng chung với nhiều Javascript framework khác như AngularJs chứ không riêng gì ReactJs.

Core Concepts

  1. State object
  • Trạng thái của ứng dụng/hệ thống sẽ được lưu vào một đối tượng duy nhất gọi là State Object.
  1. Action
  • Action là một đối tượng có chứa Action Type và các data cần thiết để thay đổi State Object.
  1. Reducer
@haintwork
haintwork / atom-ctrl-backspace.md
Last active August 16, 2017 15:14
atom ctrl backspace key map
'atom-workspace atom-text-editor':
  'ctrl-backspace': 'editor:delete-to-previous-word-boundary'
  'ctrl-delete': 'editor:delete-to-next-word-boundary'
@haintwork
haintwork / netbeans-maven-skip-compile-test.md
Last active August 17, 2017 01:04
Netbeans Maven Skip compile test classes
Dmaven.test.skip=true
@haintwork
haintwork / java-gson.md
Last active October 15, 2017 16:31
[Java Using Gson Notes] #java #json #gson

Create Json Object

JsonObject jsonObj = new JsonObject();
jsonObj.addProperty("propertyA", valueA);
jsonObj.addProperty("propertyB", valueB);
String jsonString = jsonObj.toString();

Json -> Object and Object -> Json

// Java object to JSON, and assign to a String
@haintwork
haintwork / java-long-to-int-value.md
Created August 15, 2017 08:51
Long to Int value