This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /** | |
| * Remove all duplicate items from an array in TypeScript | |
| */ | |
| function |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <table> | |
| <thead> | |
| <tr> | |
| <th colspan="2">The table header</th> | |
| </tr> | |
| </thead> | |
| <tbody> | |
| <tr> | |
| <td>The table body</td> | |
| <td>with two columns</td> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // For most queries, it's usually sufficient to check for the isLoading state, then the isError state, then finally, assume that the data is available and render the successful state: | |
| function Todos() { | |
| const { isLoading, isError, data, error } = useQuery("todos", fetchTodoList); | |
| if (isLoading) { | |
| return <span>Loading...</span>; | |
| } | |
| if (isError) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| - lấy bài hát liên quan: | |
| http://mp3.zing.vn/xhr/recommend?type=audio&id=ZW67OIA0 | |
| - lấy data thông qua key: | |
| http://mp3.zing.vn/xhr/media/get-source?type=audio&key=kmJHTZHNCVaSmSuymyFHLH | |
| http://mp3.zing.vn/html5xml/song-xml/kmJHTZHNCVaSmSuymyFHLH | |
| - lấy info bài hát | |
| https://mp3.zing.vn/xhr/media/get-info?type=audio&id=ZW8I7AAI |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| const handleKeyUp = (event) => { | |
| console.log(event.key) | |
| } | |
| <input type="text" className="zm-input-text__input" placeholder="Nhập tên bài hát, nghệ sĩ hoặc MV..." onKeyUp={} /> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| s1 = u'ÀÁÂÃÈÉÊÌÍÒÓÔÕÙÚÝàáâãèéêìíòóôõùúýĂăĐđĨĩŨũƠơƯưẠạẢảẤấẦầẨẩẪẫẬậẮắẰằẲẳẴẵẶặẸẹẺẻẼẽẾếỀềỂểỄễỆệỈỉỊịỌọỎỏỐốỒồỔổỖỗỘộỚớỜờỞởỠỡỢợỤụỦủỨứỪừỬửỮữỰựỲỳỴỵỶỷỸỹ' | |
| s0 = u'AAAAEEEIIOOOOUUYaaaaeeeiioooouuyAaDdIiUuOoUuAaAaAaAaAaAaAaAaAaAaAaAaEeEeEeEeEeEeEeEeIiIiOoOoOoOoOoOoOoOoOoOoOoOoUuUuUuUuUuUuUuYyYyYyYy' | |
| def remove_accents(input_str): | |
| s = '' | |
| print input_str.encode('utf-8') | |
| for c in input_str: | |
| if c in s1: | |
| s += s0[s1.index(c)] | |
| else: | |
| s += c |
OlderNewer