Jul 06
Digg
Stumbleupon
Technorati
Delicious

Clip.vn đã fix 1 bug bự

Nội dung file http://clip.vn/crossdomain.xml đã xóa đi dòng

<allow-access-from domain=”*”/>

Người xóa đi dòng này cho clip.vn hẳn phải được vega vinh danh vì đã tiết kiệm được rất nhiều tiền bạc đầu tư phần cứng cho vega. Tôi không rõ có ai biết được bug đó để lợi dụng DDoS không, rất có thể đã có bởi vì tôi có nghe tin clip.vn chuyển data center để nâng cấp đường truyền. Cá nhân tôi tận dụng bug này để viết flash player cho GET Video nhằm tránh quảng cáo từ flash player của clip.vn, tiếc là áp dụng được lâu :)

Bài học: Đôi khi chỉ cần 1 dòng code cũng tiết kiệm được rất nhiều công sức và tiền bạc.


Author: An Vũ
Jun 27
Digg
Stumbleupon
Technorati
Delicious

bash completion với symfony

Nếu bạn sử dụng linux hoặc DOS, chắc hẳn bạn đã biết tính năng bash completion là 1 tính năng tiện lợi đối với việc gõ lệnh, nó giúp bạn gõ nhanh mà không phải nhớ quá nhiều thứ. Ví dụ tôi muốn gõ lệnh symfony, thay vì phải gõ đầy đủ thì tôi chỉ cần gõ sym<tab> thì linux sẽ tự động thay bằng symfony. Nếu trong trường hợp có nhiều kết quả, nó sẽ hiện ra những trường hợp có thể có. Ví dụ tôi gõ sy<tab><tab>, kết quả hiện ra sẽ là

symfony                       syslogd
synaptic                      syslogd-listfiles
sync                          syslog-facility
synclient                     system-config-printer
syndaemon                     system-config-printer-applet
sysctl                        system-tools-backends
 

Để linux có thể gợi ý tiếp những option khác cho symfony, ví dụ như symfony init-app frontend, bạn cần tạo 1 file /etc/bash_completion.d/symfony như sau:

_symfony()
{            
  local cur prev action
  COMREPLY=()  
  cur=${COMP_WORDS[COMP_CWORD]}
  prev=${COMP_WORDS[COMP_CWORD-1]}
  action=${COMP_WORDS[1]}
 
  case "$prev" in
    init-module|propel-generate-crud|propel-init-crud|propel-init-admin|propel-load-data|propel-build-all-load)
      COMPREPLY=( $( compgen -W "$( ls –color=n -1 apps 2>/dev/null| sed -e ’s/ /\\ /g’ )" — $cur ))
      return 0
    ;;
    init-project)
      COMPREPLY=( $( compgen -W "$( basename $PWD )" — $cur ))
      return 0
    ;;
    init-app)
      COMPREPLY=( $( compgen -W "frontend backend" — $cur))
      return 0
    ;;    
    symfony)
      COMPREPLY=( $( compgen -W "$( symfony -T | awk ‘/^  /’ | cut -d’ ‘ -f3 )" — $cur ) )
      return 0
    ;;    
    plugin-install)
    COMPREPLY=( $( compgen -W ‘local global’ — $cur ) )
    return 0
    ;;
    global|local)
    COMPREPLY=( $( compgen -W ’symfony/’ ) )
    return 0
    ;;

    *)
      case "$action" in
        propel-generate-crud|propel-init-crud|propel-init-admin)
          if (($COMP_CWORD == 3)); then
            COMPREPLY=( $( compgen -W "$( find lib/model -maxdepth 1 -name ‘*.php’ -exec basename {} .php \; |grep -v Peer\$| tr [:upper:] [:lower:] )" — $cur ) )
          elif (($COMP_CWORD == 4)); then
            COMPREPLY=( $( compgen -W "$( find lib/model -maxdepth 1 -name ‘*.php’ -exec basename {} .php \; |grep -v Peer\$ )" — $cur ) )
           
          fi
          return 0
          ;;
      esac
      return 0
    ;;
      sync)
          if (($COMP_CWORD == 3)); then
            COMPREPLY=( $( compgen -W ‘go’ — $cur))
          fi
          return 0
          ;;
 
  esac

    return 0  
}
       
complete -F _symfony symfony

 

sau đó đóng terminal rồi bật lên lại là mọi thứ đã hoạt động.

Test thử xem nào:
sym<tab>

symfony

symfony <tab>

app                                  init-batch
batch                                init-controller
cc                                   init-module
clear-cache                          init-project
clear-controllers                    log-purge
controller                           log-rotate
disable                              module
doctrine-build-all                   new
doctrine-build-all-load              plugin-install
doctrine-build-all-reload            plugin-list
doctrine-build-db                    plugin-uninstall
doctrine-build-model                 plugin-upgrade
doctrine-build-schema                propel-build-all
doctrine-build-sql                   propel-build-all-load
doctrine-convert-schema              propel-build-db
doctrine-dql                         propel-build-model
doctrine-drop-db                     propel-build-schema
doctrine-dump-data                   propel-build-sql
doctrine-generate-crud               propel-convert-xml-schema
doctrine-generate-migration          propel-convert-yml-schema
doctrine-generate-migrations-db      propel-dump-data
doctrine-generate-migrations-models  propel-generate-crud
doctrine-init-admin                  propel-init-admin
–More–
 

symfony doc<tab>

symfony doctrine-
 

symfony doctrine-ini<tab>

symfony doctrine-init-admin
 

haha, have fun!

Thảm khảo:


Author: An Vũ
Jun 23
Digg
Stumbleupon
Technorati
Delicious

Get Video phiên bản mới

Get Video là website tìm kiếm và download video, phần frontend được viết bằng symfony.
Get Video vừa đạt mốc 20 triệu video, bổ sung thêm tính năng advanced search cho phép tìm kiếm với nhiều tiêu chí, bao gồm:
- Tìm theo tiêu đề, mô tả, tag
- Tìm theo website
- Tìm theo thể loại
- Tìm theo người gửi
- Tìm theo độ dài của video (duration)
và hỗ trợ sắp xếp kết quả theo độ chính xác hoặc độ dài của video.

Điều này rất tiện lợi cho các bạn có nhu cầu tìm phim (độ dài video thường trong khoảng 4-20 phút hoặc trên 20 phút).

Mong nhận được ý kiến đóng góp và sự ủng hộ của các bạn


Author: An Vũ
May 17
Digg
Stumbleupon
Technorati
Delicious

Yahoo! Answer sử dụng symfony

From symfony project weblog

Yahoo! used symfony to redevelop another project. This time symfony was used as part of the foundation for Yahoo! Answers. Yahoo! Answers is the largest collection of human knowledge on the Web with more than 135 million users and 515 million answers worldwide. Yahoo! Answers is the 2nd ranked education & reference site on the web and is available in 26 markets and 12 languages.

Why did Yahoo! choose symfony for another large web application project?

Philosophy

  • Full-stack framework for building complex web applications
  • Adopt best ideas from anywhere, using existing code if available (Mojavi, Prado, Rails, Django)

Design

  • Clean separation between Model, View, and Controller
  • Controller using modules and actions
  • Views using templates in straight PHP with helpers
  • Easy to reuse view modules to compose a page (Layouts, Components, Partials, Slots)

Configurability / Flexibility

  • Features we do not want are easily disabled
  • Use of factories for easy customization

Documentation / Support Community

  • The Definitive Guide to symfony (free online)
  • Excellent tutorials and example applications - Askeet
  • Active community with wiki, mailing lists, forums, irc channel

Once again symfony fits the requirements of an enterprise web application. Dustin Whittle of Yahoo! presented a case study on redeveloping Y! Answers. The focus was how to work with open source tools to create a complete framework (PHP, JS, CSS) for the enterprise. He used his experience redeveloping Yahoo! Answers with symfony and Yahoo! User Interface libraries as a case study. Download the presentation from slideshare.


Author: An Vũ
Apr 09
Digg
Stumbleupon
Technorati
Delicious

chacha.vn sử dụng symfony

Tôi đã từng nghe Huy nói về việc Vega sử dụng symfony trong các project của họ, tuy nhiên cụ thể thì không biết họ dùng symfony trong dự án nào. Huy có nói với tôi Vega có ý định viết lại clip.vn bằng symfony, và hôm nay, tình cờ khi nghe nhạc trên chacha.vn, tôi phát hiện ra chacha cũng được viết dựa trên symfony nhờ 1 thông báo lỗi mà họ đã sơ ý để lộ.

Read more


Author: An Vũ
Apr 02
Digg
Stumbleupon
Technorati
Delicious

symfony 1.0.13 is out

From symfony weblog

symfony 1.0.13 has been released to fix an important bug in the tag helper.

Strings were incorrectly escaped due to the change r7900 the 1.0.12 release. The missing regression test has now been added and the bug is fixed. The 1.1 branche has also been updated.

Here is the changelog :

* r8176: Fixes #3206 - Simple quotes are no more escaped by Tag helper escaping
* r8045: 1.0: added warning to sfPropelUniqueValidator (refs #2467)

We do advise you to update as soon as you can.


Author: An Vũ
Mar 22
Digg
Stumbleupon
Technorati
Delicious

symfony 1.0.12 is (finally) out !

from symfony project weblog:

After two months and more than 30 tickets closed, the 1.0.12 comes with spring. As it fixes an important security issue and windows plugins problems, we do strongly advise you to update your projects.

Here is the changelog :

* r8019: sfWebRequest handles multi-dimensional file input fields (backported from 1.1) (closes #2009)
* r8010: 1.0: merged fix for potential php notice (closes #3168)
* r8006: fixed plugin-install command on windows (closes #2590)
* r7999: button_to produces invalid XHTML (closes #3113)
* r7997: admin generator handles plain fields (closes #2935)
* r7977: fixed view cache doesn’t accept zero client lifetime (closes #3141)
* r7850: fixed default error_reporting values (PHP 5.2 has a new constant) (closes #3098)
* r7831: fixed inclusion of generator.yml for every module (closes #1949)
* r7802: fixed “Cannot unset string offsets” error
* r7769: Etag was not checking correctly the enclosing quotes. (closes #3065)
* r7762: fixed web debug toolbar segfaults PHP when debugging using xdebug
* r7665: correction in DateFormHelper? (fixes #3023)
* r7620: added instructions to allow periods in routes (closes #2295)
* r7589: fixed sfNumberValidator to reject hexadecimal values (closes #2741)
* r7547: fixed uri encoding / xhtml error (closes #2968)
* r7541: fixed hebrew calender language file for 1.0 (closes #2970)


Author: An Vũ