Skip to content

Instantly share code, notes, and snippets.

View jcisio's full-sized avatar

Hai-Nam Nguyen jcisio

View GitHub Profile
@jcisio
jcisio / ideas.md
Last active December 17, 2015 07:39
MHST 2013: xén ảnh thông minh nhờ phát hiện khuôn mặt

Xén ảnh thông minh nhờ phát hiện khuôn mặt

Mức độ: trung bình/khó.

Thực hiện một thuật toán phát hiện khuôn mặt (face detection) trên PHP, sau đó tích hợp vào một hệ quản trị nội dung (CMS) để giải quyết bài toán xén ảnh thông minh.

Vấn đề

Phát hiện khuôn mặt là một bài toán cơ bản trong xử lí ảnh. Đã có khá nhiều thuật toán giải quyết vấn đề này, viết trên nhiều ngôn ngữ khác nhau. Thư viện OpenCV cũng có sẵn công cụ để phát hiện khuôn mặt.

@jcisio
jcisio / bash.git_prompt
Created February 20, 2013 21:20
Make bash prompt know about git
# Colors
NoColor="\033[0m"
Cyan="\033[0;36m"
Green="\033[0;32m"
Red="\033[0;31m"
Yellow="\033[0;33m"
# Chars
RootPrompt="\#"
NonRootPrompt="\$"
@jcisio
jcisio / update_nodes.php
Created January 27, 2013 11:16
Move taxonomy from node to content taxonomy fields. Use with drush.
<?php
/**
* @file
* Move taxonomy term from taxonomy_node table to field tables.
*/
$types = array(
array(
'type' => 'product',
'fields' => array(
@jcisio
jcisio / gist:4603181
Created January 23, 2013 08:35
MySQL table deduplication
-- Deduplication on all rows
CREATE TEMPORARY TABLE bad_temp AS SELECT DISTINCT * FROM your_table;
DELETE FROM your_table;
INSERT INTO your_table SELECT * FROM bad_temp;
-- Deduplication on some rows
CREATE TEMPORARY TABLE bad_temp AS SELECT * FROM your_table GROUP BY field1, field2, field3;
DELETE FROM your_table;
INSERT INTO your_table SELECT * FROM bad_temp;