Skip to content

Instantly share code, notes, and snippets.

@quynguyen3490
quynguyen3490 / sentences_proccess.py
Created July 25, 2016 18:07
Split Vietnamese Sentences
# -*- coding: utf-8 -*-
"""
Split sentences
Author: Quy Nguyen
Tested under Python 2.7
"""
import io
import re
@quynguyen3490
quynguyen3490 / root-context.xml
Created July 13, 2015 16:34
Spring MVC Config - Put 3 files in WEB-INF
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd">
<!-- Root Context: defines shared resources visible to all other web components -->
</beans>
@quynguyen3490
quynguyen3490 / GPSTracking.java
Created April 4, 2015 05:50
Get Current Location Android
package com.quynguyenblog.mymap;
import android.app.AlertDialog;
import android.app.Service;
import android.content.Context;
import android.content.DialogInterface;
import android.content.Intent;
import android.location.Location;
import android.location.LocationListener;
import android.location.LocationManager;
@quynguyen3490
quynguyen3490 / MainViewController.m
Created January 4, 2015 09:50
Search UI + Table View UI iOS
//
// ViewController.m
// SimpleTableView
//
// Created by Phi Long on 12/30/14.
// Copyright (c) 2014 Phi Long . All rights reserved.
//
#import "ViewController.h"
@quynguyen3490
quynguyen3490 / convert_vi_to_en
Created July 18, 2014 19:00
Bỏ tiếng Việt có dấu
<?php
public function convert_vi_to_en($str) {
$str = preg_replace("/(à|á|ạ|ả|ã|â|ầ|ấ|ậ|ẩ|ẫ|ă|ằ|ắ|ặ|ẳ|ẵ)/", 'a', $str);
$str = preg_replace("/(è|é|ẹ|ẻ|ẽ|ê|ề|ế|ệ|ể|ễ)/", 'e', $str);
$str = preg_replace("/(ì|í|ị|ỉ|ĩ)/", 'i', $str);
$str = preg_replace("/(ò|ó|ọ|ỏ|õ|ô|ồ|ố|ộ|ổ|ỗ|ơ|ờ|ớ|ợ|ở|ỡ)/", 'o', $str);
$str = preg_replace("/(ù|ú|ụ|ủ|ũ|ư|ừ|ứ|ự|ử|ữ)/", 'u', $str);
$str = preg_replace("/(ỳ|ý|ỵ|ỷ|ỹ)/", 'y', $str);
$str = preg_replace("/(đ)/", 'd', $str);
$str = preg_replace("/(À|Á|Ạ|Ả|Ã|Â|Ầ|Ấ|Ậ|Ẩ|Ẫ|Ă|Ằ|Ắ|Ặ|Ẳ|Ẵ)/", 'A', $str);
@quynguyen3490
quynguyen3490 / Pagination Fv5 + CakePHP
Last active August 29, 2015 13:57
A template Pagination: Foundation 5 + Cakephp
<div class="row">
<div class="small-12 columns pagination-centered">
<ul class="pagination">
<?php
echo $this->Paginator->prev('<<',
array(
'tag'=>'li',
'disabledTag'=>'a'
));
echo $this->Paginator->numbers(array(
@quynguyen3490
quynguyen3490 / custom-gridview-with-link-id
Last active August 29, 2015 13:57
A custom GridView in Asp.Net