Author Archives: admin

Sort by array values

Reference:

  1. https://stackoverflow.com/questions/8055138/mysql-sort-order-by-array-value

Laravel Cookie

Save cookie with redirect or response

Get cookie

Reference:

  1. https://laravel.com/docs/5.8/requests#cookies
  2. https://laravel.com/docs/5.8/responses#attaching-cookies-to-responses

Git pull show all files are modified and with a lot conflicts

  1. Change line ending config
  2. Change file mode:
  3. Clear cache

Reference:

  1. elharony commented on 7 Dec 2018
    https://github.com/microsoft/WSL/issues/184
  2. https://github.com/microsoft/WSL/issues/2900

Add existing folder in repo and track remote branch

Github solution

Reference:

  1. https://docs.github.com/en/github/importing-your-projects-to-github/adding-an-existing-project-to-github-using-the-command-line
  2. https://docs.github.com/en/github/using-git/adding-a-remote

Make TinyMCE Disable or Readonly

Javascript

Reference:

  1. https://stackoverflow.com/questions/13881812/make-readonly-disable-tinymce-textarea

TinyMce Get Instance

Javascript

HTML

Reference:

  1. https://stackoverflow.com/questions/36383626/how-do-i-get-tinymce-editor-instance-by-the-element-selector/36386886

AES Decrypt

AES/CBC/PKCS5Padding encryption

  1. MD5 Digest the password(REST_API_KEY) using SHA-256
  2. iv parameter is empty
  3. Decrypt the encrypted contents using AES/CBC/PKCS5Padding

Laravel verifycsrftoken except not working

Path issue

Example URL: http://localhost:8000/wingpay/listener

Reference:

  1. https://stackoverflow.com/questions/32751063/laravel-verifycsrftoken-exception-not-working

Javascript execute twice

iframe