Monthly Archives: October 2020

Add website shortcut to home screen on mobile by javascript

No implement yet.

manifest.json example:

Reference:

  1. https://developer.mozilla.org/en-US/docs/Web/Progressive_web_apps/Add_to_home_screen#How_do_you_use_it
  2. https://stackoverflow.com/questions/6162070/jquery-mobile-add-the-home-screen-options
  3. https://github.com/cubiq/add-to-homescreen

Create Path with Laravel File Facade

 

Facebook Login with PHP SDK

Github Home:

https://github.com/facebookarchive/php-graph-sdk/tree/master/docs

Install

Sample code to get login URL:

Sample code to get access token

Sample code to get long live token

Get login user data

Note:

Please be aware, that there are issues when using the Facebook SDK together with Guzzle 6.x. php-graph-sdk v5.x only works with Guzzle 5.x out of the box. However, there is a workaround to make it work with Guzzle 6.x.

Brand Rules

https://developers.facebook.com/docs/facebook-login/userexperience/#buttondesign

User click cancel and redirect back with some params

 

Reference:

  1. Facebook SDK for PHP
    https://github.com/facebookarchive/php-graph-sdk/tree/master/docs
  2. Login button:
    https://developers.facebook.com/docs/facebook-login/web/login-button/#——–
  3. Permissions
    https://developers.facebook.com/docs/permissions/reference#user-data
  4. Possible problem
    https://stackoverflow.com/questions/31520593/facebook-php-sdk-5-api-2-4-cross-site-request-forgery-validation-failed-r/36684861#36684861

Add Custom Virtual Host in laragon

  1. Add a sub folder in laragon root.
  2. Rewrite .conf in D:\laragon\etc\apache2\sites-enabled
    Change DocumentRoot and Directory
  3. Reload Apache

Example:

Reference

  1. https://stackoverflow.com/questions/63318438/how-to-set-custom-virtual-host-name-in-laragon
  2. Tool
    https://github.com/bantya/CmdVirtualHost