Skip to content

Instantly share code, notes, and snippets.

View Narga's full-sized avatar

Nguyễn Đình Quân Narga

View GitHub Profile
public function CompositeUnicodeToUnicode($unicode_str){
$unicode_str = str_replace("\u{0065}\u{0309}", "\u{1EBB}",$unicode_str); # ẻ
$unicode_str = str_replace("\u{0065}\u{0301}", "\u{00E9}",$unicode_str); # é
$unicode_str = str_replace("\u{0065}\u{0300}", "\u{00E8}",$unicode_str); # è
$unicode_str = str_replace("\u{0065}\u{0323}", "\u{1EB9}",$unicode_str); # ẹ
$unicode_str = str_replace("\u{0065}\u{0303}", "\u{1EBD}",$unicode_str); # ẽ
$unicode_str = str_replace("\u{00EA}\u{0309}", "\u{1EC3}",$unicode_str); # ể
$unicode_str = str_replace("\u{00EA}\u{0301}", "\u{1EBF}",$unicode_str); # ế
$unicode_str = str_replace("\u{00EA}\u{0300}", "\u{1EC1}",$unicode_str); # ề
@Narga
Narga / compound-to-unicode.java
Created September 9, 2023 12:14 — forked from redphx/compound-to-unicode.java
[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"); //ệ
@Narga
Narga / unicode_utils.py
Created September 9, 2023 12:14 — forked from anhtran/unicode_utils.py
Hàm số Chuyển đổi chuỗi Unicode Tổ Hợp sang Unicode Dựng Sẵn trong Python 3
def compound_unicode(unicode_str):
"""
Chuyển đổi chuỗi Unicode Tổ Hợp sang Unicode Dựng Sẵn
Edited from: `https://gist.github.com/redphx/9320735`
"""
unicode_str = unicode_str.replace("\u0065\u0309", "\u1EBB") # ẻ
unicode_str = unicode_str.replace("\u0065\u0301", "\u00E9") # é
unicode_str = unicode_str.replace("\u0065\u0300", "\u00E8") # è
unicode_str = unicode_str.replace("\u0065\u0323", "\u1EB9") # ẹ
unicode_str = unicode_str.replace("\u0065\u0303", "\u1EBD") # ẽ
### Keybase proof
I hereby claim:
* I am narga on github.
* I am mrnarga (https://keybase.io/mrnarga) on keybase.
* I have a public key ASBZeyhL7NBTub77cDrKvUbVCgMjrd1uVHBrKG2lb6lP-Qo
To claim this, I am signing this object:
@Narga
Narga / buttons.css
Last active September 30, 2019 17:16
Simple, Beauty CSS Buttons
/**
* Simple & Beauty CSS Buttons
* Author URI: https://www.narga.net/
*/
.btn {
font-size: 14px;
line-height: 20px;
position: relative;
@Narga
Narga / 51-noto-color-emoji.conf.xml
Last active February 17, 2020 14:10 — forked from hexchain/51-noto-color-emoji.conf.xml
Google Noto Color Emoji on Arch Linux desktop. Don't forget to remove Firefox's built-in EmojiOne font.
<?xml version="1.0"?>
<!DOCTYPE fontconfig SYSTEM "fonts.dtd">
<!-- /etc/fonts/conf.avail/51-noto-color-emoji.conf -->
<fontconfig>
<selectfont>
<acceptfont>
<pattern>
<patelt name="family"><string>Noto Color Emoji</string></patelt>
</pattern>
</acceptfont>
@Narga
Narga / wp-cli.txt
Last active August 29, 2015 14:09 — forked from cfxd/wp-cli.txt
# Install wordpress
wp core download && wp core config --dbname=wordpress_test_db --dbuser=root && wp core install --url=http://localhost/wp-cli/ --title=Wordpress --admin_user=admin --admin_password=admin --admin_email=youremail@domain.com
# Install and activate Plugins
wp plugin install wordpress-importer --activate && wp plugin install contact-form-7 --activate
# Generate Posts
curl http://loripsum.wpwolf.com | wp post generate --post_content --count=10
# Activate a theme
<?php
function clear_jetpack_published() {
if(empty($_REQUEST['post'])) {
wp_die(__('Invalid post ID or action'));
}
global $wpdb;
$id = isset($_REQUEST['post']) ? absint($_REQUEST['post']) : '';
@Narga
Narga / nginx.conf
Last active August 29, 2015 14:07 — forked from deathbob/nginx.conf
# Basically the nginx configuration I use at konklone.com.
# I check it using https://www.ssllabs.com/ssltest/analyze.html?d=konklone.com
#
# To provide feedback, please tweet at @konklone or email eric@konklone.com.
# Comments on gists don't notify the author.
#
# Thanks to WubTheCaptain (https://wubthecaptain.eu) for his help and ciphersuites.
# Thanks to Ilya Grigorik (https://www.igvita.com) for constant inspiration.
server {

Contract Killer

The popular open-source contract for web designers and developers by Stuff & Nonsense

  • Originally published: 23/12/2008
  • Revised date: 15/12/2013
  • Original post