Skip to content

Instantly share code, notes, and snippets.

@redphx
redphx / abxy.user.js
Created September 25, 2023 14:06
BAYX to ABXY Userscript
// ==UserScript==
// @name Gamepad buttons swapper
// @namespace https://github.com/redphx
// @version 0.1
// @description try to take over the world!
// @author redphx
// @match https://hardwaretester.com/gamepad
// @match https://www.xbox.com/*/play*
// @grant none
// @run-at document-start
@redphx
redphx / stock_alert.json
Created May 23, 2022 10:18
Stock alert using Node-RED
[
{
"id": "bbd65f58de8fc93e",
"type": "group",
"z": "5501e19c.72a0c",
"name": "Coral USB",
"style": {
"label": true
},
"nodes": [
@redphx
redphx / compound-to-unicode.java
Created March 3, 2014 08:27
[Java] Chuyển tiếng Việt tổ hợp sang dựng sẵn
public static String compound2Unicode(String str) {
str = str.replaceAll("\u0065\u0309", "\u1EBB"); //ẻ
str = str.replaceAll("\u0065\u0301", "\u00E9"); //é
str = str.replaceAll("\u0065\u0300", "\u00E8"); //è
str = str.replaceAll("\u0065\u0323", "\u1EB9"); //ẹ
str = str.replaceAll("\u0065\u0303", "\u1EBD"); //ẽ
str = str.replaceAll("\u00EA\u0309", "\u1EC3"); //ể
str = str.replaceAll("\u00EA\u0301", "\u1EBF"); //ế
str = str.replaceAll("\u00EA\u0300", "\u1EC1"); //ề
str = str.replaceAll("\u00EA\u0323", "\u1EC7"); //ệ