API Control Vimeo videos (play and mute) with Flex slider

Plugin: https://github.com/tanepiper/vimeo-froogaloop2/tree/master/javascript

 

SendGrid API Example

Doc: https://github.com/sendgrid/sendgrid-php

Complete example:
https://github.com/sendgrid/sendgrid-php/blob/master/USE_CASES.md#attachments

Example:

 

TCPDF

Doc: https://tcpdf.org/docs/srcdoc/tcpdf/class-TCPDF/

Note:

  • HTML裡面的圖片網址一定要是完整路徑,不能是localhost, 否則輸出會有”unable to get the size of the image” error
    crontab執行的時候,base_url()就是抓到localhost,所以要注意

Example:

 

Reference:

Localization of datatable

Localization file:

Sample code:

Display priority:

  1. Localization file
  2. paginate option
  3. aria

Reference:

Laravel Queue and Job

Official Doc: https://laravel.com/docs/5.3/queues#introduction

Command to build job class:

Command to dispatch job:

Command to execute start queue worker:

Note:

  • Every time related scripts are changed, the queue worker must be restarted or the job will always read the script in some cache.

ECPay e-invoice

Response after invoice is created:

 

Install Apache + PHP + MySQL Manually on Windows Server 2008

  1. Install Visual C++ Redistributable 2012
    https://www.microsoft.com/en-US/download/details.aspx?id=30679
    Important!! 
    VC version is very very very important! VC 2012 = VC11, Apache and PHP must be the same version VC11
  2. Install Apache: (win64)
    https://www.apachelounge.com/download/VC11/
  3. Edit httpd.conf
  4. Install service:
    httpd -k install -n “Apache 2.4”
  5. Install PHP
    If using laravel which require openssl_encrypt function, you must choose threat safe version:
    http://windows.php.net/download#php-5.6
  6. Edit php.ini
  7. Enable .htaccess in Apache:
    1. Set AllowOverride All for document directory.
    2. Enable rewrite module:
      LoadModule rewrite_module modules/mod_rewrite.so

Reference:

Advanced where clause – pass variable into annonymous function