Skip to content

Instantly share code, notes, and snippets.

View lelinhtinh's full-sized avatar
🤤
Slimming failure

Thành Thân Thiện lelinhtinh

🤤
Slimming failure
  • Da nang, Vietnam
  • 14:24 (UTC +07:00)
View GitHub Profile
@lelinhtinh
lelinhtinh / README.md
Last active January 2, 2021 17:33
RGB keyboard control for ASUS ROG STRIX G G531GD-AL025T

Trình điều khiển đèn bàn phím RGB cho ASUS ROG STRIX G G531GD-AL025T

Cài đặt

Xem bản phát triển chính cho các dòng laptop ASUS ROG tại wroberts/rogauracore.

Tải phiên bản Retool nếu gặp lỗi ở chế độ Rainbow.

Cài đặt các phần phụ thuộc:

(function() {
// https://stackoverflow.com/a/52549234
function simulateMouseClick(targetNode) {
function triggerMouseEvent(targetNode, eventType) {
var clickEvent = document.createEvent('MouseEvents');
clickEvent.initEvent(eventType, true, true);
targetNode.dispatchEvent(clickEvent);
}
["mouseover", "mousedown", "mouseup", "click"].forEach(function(eventType) {
triggerMouseEvent(targetNode, eventType);
@lelinhtinh
lelinhtinh / lamp-win.md
Last active March 15, 2020 08:23
Cài đặt LAMP server trong WSL

Cài đặt LAMP server trong WSL

Cài đặt Ubuntu

Kích hoạt WSL (Windows Subsystem for Linux) bằng cách mở PowerShell với quyền Admin (Run as administrator), và chạy lệnh:

Enable-WindowsOptionalFeature -Online -FeatureName Microsoft-Windows-Subsystem-Linux

Khởi động lại máy.

const cleanAccents = (str: string): string => {
str = str.replace(/à|á|ạ|ả|ã|â|ầ|ấ|ậ|ẩ|ẫ|ă|ằ|ắ|ặ|ẳ|ẵ/g, 'a');
str = str.replace(/è|é|ẹ|ẻ|ẽ|ê|ề|ế|ệ|ể|ễ/g, 'e');
str = str.replace(/ì|í|ị|ỉ|ĩ/g, 'i');
str = str.replace(/ò|ó|ọ|ỏ|õ|ô|ồ|ố|ộ|ổ|ỗ|ơ|ờ|ớ|ợ|ở|ỡ/g, 'o');
str = str.replace(/ù|ú|ụ|ủ|ũ|ư|ừ|ứ|ự|ử|ữ/g, 'u');
str = str.replace(/ỳ|ý|ỵ|ỷ|ỹ/g, 'y');
str = str.replace(/đ/g, 'd');
str = str.replace(/À|Á|Ạ|Ả|Ã|Â|Ầ|Ấ|Ậ|Ẩ|Ẫ|Ă|Ằ|Ắ|Ặ|Ẳ|Ẵ/g, 'A');
str = str.replace(/È|É|Ẹ|Ẻ|Ẽ|Ê|Ề|Ế|Ệ|Ể|Ễ/g, 'E');
@lelinhtinh
lelinhtinh / palemoon-addons.md
Last active October 8, 2019 07:04
Add-ons recommended for Pale Moon

Add-ons nên dùng cho Pale Moon

Cài đặt Classic Add-ons Archive (JustOff) để sử dụng các add-ons cũ của Firefox.

Giao diện

  • Material Moon (FranklinDM): Giao diện cũ của Google Chrome.
  • NewScrollbars (Aris): Cấu hình như sau:
    • Customizable v2
  • Background: #f1f1f1
@lelinhtinh
lelinhtinh / README.md
Last active October 6, 2019 07:33
ScrollAnywhere Backup
@lelinhtinh
lelinhtinh / androidPushNotification.php
Last active October 2, 2019 07:58 — forked from nelsbels/gist:9087748
Simple PHP script showing how to send an Android push notification. Be sure to replace the API_ACCESS_KEY with a proper one from the Google API's Console page. To use the script, just call androidPushNotification.php?id=THE_DEVICE_REGISTRATION_ID
<?php
// API access key from Google API's Console
define( 'API_ACCESS_KEY', 'YOUR-API-ACCESS-KEY-GOES-HERE' );
$registrationIds = array( $_GET['id'] );
// prep the bundle
$msg = array
[budgie-panel]
dark-theme=true
panels=['fffccb28-de0e-11e9-9cba-1c1b0dda4bf4']
builtin-theme=false
notification-position='BUDGIE_NOTIFICATION_POSITION_TOP_RIGHT'
migration-level=1
[budgie-panel/panels/{fffccb28-de0e-11e9-9cba-1c1b0dda4bf4}]
size=39
dock-mode=false

Đọc văn bản Tiếng Việt bằng Google

Cài đặt

sudo apt install sox libsox-fmt-mp3
sudo apt install python3-pip
pip3 install google_speech