Skip to content

Instantly share code, notes, and snippets.

View tonthanhhung's full-sized avatar
🏠
Working from home

Hung Ton tonthanhhung

🏠
Working from home
View GitHub Profile
@tonthanhhung
tonthanhhung / .zshrc
Last active July 3, 2019 09:56
Note. wsl
# If you come from bash you might have to change your $PATH.
# export PATH=$HOME/bin:/usr/local/bin:$PATH
# Path to your oh-my-zsh installation.
export ZSH="/home/hungton/.oh-my-zsh"
export DISPLAY=127.0.0.1:0.0
# Set name of the theme to load --- if set to "random", it will
# load a random theme each time oh-my-zsh is loaded, in which case,
# to know which specific one was loaded, run: echo $RANDOM_THEME
@tonthanhhung
tonthanhhung / config
Last active November 5, 2018 01:12
i3 configuration
# This file has been auto-generated by i3-config-wizard(1).
# It will not be overwritten, so edit it as you like.
#
# Should you change your keyboard layout some time, delete
# this file and re-run i3-config-wizard(1).
#
# i3 config file (v4)
#
# Please see https://i3wm.org/docs/userguide.html for a complete reference!
Lương của guru
Bài viết trước "Coder Hell" bạn Thắng có đề cập đến việc "cứ làm cho tốt đi và tin tưởng là lương sẽ tăng theo", tớ xin phép được phản biện, cách làm của bạn Thắng là cách làm bị động, và thường ko mang lại kết quả như mong đợi, nhất là với những người mà xác định "làm lớn, hưởng lớn" như mình.
Theo mình, vấn đề lương là phải chủ động, phải là người điều khiển cuộc chơi, chứ ko thể chờ đợi hảo tâm của người khác được. Đừng bao giờ đề tương lai của mình cho người khác sắp đặt, vì xác suất cao là họ sẽ đặt mình vào chỗ lởm.
Tại sao lại phải chủ động?
Khi làm dự án thì mình và sếp là cùng 1 chiến tuyến, sống chết có nhau, nhưng khi bàn đến lương lậu thì phải xác định rằng 2 bên đang đối đầu, rằng đây là cuộc chơi Zero-sum, tức là mình được thì nó mất. Nói cách khác, sếp lại là địch thủ của mình. Có ai lại giao phó số mệnh cho kẻ thù ko?
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.annotation.Secured;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import java.util.List;
@RestController
@RequestMapping("/register")
public class RegisterController {
@tonthanhhung
tonthanhhung / new_gist_file.java
Created October 2, 2017 12:08
Error Log when click on Mtan request, or Price Request (OTC)
19:00:38.168 [http-nio-8088-exec-3] DEBUG c.e.o.b.c.i.MTanServiceImpl DIGITALUSER1 Entering requestMTANInternal(referenceId=3, mTANType=UserMTanObjectType.TRANCHE_REGULAR)
19:00:38.322 [http-nio-8088-exec-3] DEBUG c.e.t.d.i.GenericMapperDao DIGITALUSER1 findById(ExternalUserEntity,7)
19:00:38.325 [http-nio-8088-exec-3] DEBUG c.e.o.b.c.i.MTanServiceImpl DIGITALUSER1 Leaving requestMTANInternal(), mTANValidUntil 2017-10-02T14:01:38.300+0200
19:00:38.346 [http-nio-8088-exec-3] WARN RequestCycleExtra DIGITALUSER1 ********************************
19:00:38.346 [http-nio-8088-exec-3] WARN RequestCycleExtra DIGITALUSER1 Handling the following exception
org.apache.wicket.WicketRuntimeException: Cannot replace a component which has not been added: id='dialogContent', component=[GasTrancheSettlementOrderPanel [Component id = dialogContent]]:
[GasSingleTrancheDialogContainer [Component id = singleTrancheLoginPanel]]
at org.apache.wicket.MarkupContainer.replace(MarkupContainer.java:843) ~[wicket-core-7.3.0.jar:7.3.0]
at
<body>
<ul>*
<li>Item:
<ol>*
<li>Point:
<div>
<ul>*
<li>elem1</li>
</ul>
</div>
@tonthanhhung
tonthanhhung / 0_reuse_code.js
Created August 16, 2017 12:06
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console

Our web application used Java based technology for backend stuff. Everything include static resources (img, js, css, font, ect.) will be bundled inside a single war file. This webapp is kind of slow even with localhost, and even more slow with real intenet connection. After inspecting with Chrome Dev Tool, I found that all resource request have the same cache control header

Cache-Control:no-cache, no-store, max-age=0, must-revalidate
Content-Type:application/javascript
Expires:0

colors.js Build Status

get color and style in your node.js console

Demo

Installation

npm install colors