Skip to content

Instantly share code, notes, and snippets.

View Narga's full-sized avatar

Nguyễn Đình Quân Narga

View GitHub Profile
@Narga
Narga / wordpress-remove-recent-comment-style.php
Created June 7, 2012 08:26
Wordpress Snippets - remove recent comments style
<?php
//http://www.narga.net/how-to-remove-or-disable-comment-reply-js-and-recentcomments-from-wordpress-header
function twentyten_remove_recent_comments_style() {
global $wp_widget_factory;
remove_action( 'wp_head', array( $wp_widget_factory->widgets['WP_Widget_Recent_Comments'], 'recent_comments_style' ) );
}
add_action( 'widgets_init', 'twentyten_remove_recent_comments_style' );
?>
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 / 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 / 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 / definition-lists-with-wp_nav_menu.php
Created November 27, 2012 01:49
Use definition lists with wp_nav_menu
// Secondary Menu is Widgetable
function widget_secondary_navigation() {
$args = array(
'echo' => false,
'items_wrap' => '<dl id="%1$s" class="%2$s myclass">%3$s</dl>','theme_location' => 'secondary_navigation', 'container' => false, 'menu_class' => 'sub-nav'
);
$subject = wp_nav_menu( $args );
$search = array('<ul', '</ul>', '<li', '</li>');
$replace = array('<dl', '</dl>', '<dd', '</dd>');
@Narga
Narga / simple-signup-form.html
Created June 7, 2012 02:38
Simple Signup Form
//http://www.narga.net/making-awesome-forms-inline-labels-with-jquery
<form id="signup" name="signup">
<label for="email">Email Address</label>
<input class="text" name="email" type="text" />
<label for="username">Username</label>
<input class="text username" name="username" type="text" />
<input class="btn" type="submit" value="Sign Up" />
</form>
@Narga
Narga / wordpress-dropdown-naviation.js
Created June 7, 2012 02:28
Wordpress - Dropdown Navigation jQuery Code
if(!jQuery.browser.msie){jQuery("ul.topnav").css({opacity:"0.95"});} // IE - 2nd level Fix
jQuery(".topnav > li > ul").css({display: "none"}); // Opera Fix
jQuery("ul.sub-menu").parent().append("<div>&nbsp;</div>"); //Only shows drop down trigger when js is enabled - Adds empty span tag after ul.subnav
jQuery("ul.sub-menu li.menu-item").append("<span>&#187;</span>"); //Only shows drop down trigger when js is enabled - Adds empty span tag after ul.subnav
jQuery("ul.menu li a").hover(function() { //When trigger is clicked...
//Following events are applied to the subnav itself (moving subnav up and down)
jQuery(this).parent().find("ul.sub-menu").slideDown('fast').show(400); //Drop down the subnav on hover
jQuery(this).parent().hover(function() {
}, function(){
jQuery(this).parent().find("ul.sub-menu").slideUp('slow'); //When the mouse hovers out of the subnav, move it back up