Monthly Archives: April 2020

Track remote branch (RSA Key for bitbucket) with public key

把目前使用中,而且沒有git的資料夾track remote branch

  1. 連線的PC or server要有SSH Key, 並且把Public key的內容貼到Bitbucket的Repo設定裡 Step by step tutorial: https://confluence.atlassian.com/bitbucket/set-up-an-ssh-key-728138079.html
    1. ssh-keygen
    2. Press the Enter or Return key to accept the default location. (Or leave it empty)
    3. Enter and re-enter a passphrase when prompted.
    4. ls ~/.ssh id_rsa id_rsa.pub
    5. eval ssh-agent
    6. ssh-add ~/.ssh/<private_key_file>
    7. cat ~/.ssh/id_rsa.pub
    8. Paste public key to bitbucket
  2. Git commands to track remote branch
    1. git init
    2. git add .
    3. git commit -m ‘Init git’ (Current branch is master)
    4. git remote add origin [email protected]:/opt/git/project.gitReference or
    5. git fetch
    6. git branch -u origin/master

Fix “detached HEAD” error

https://gitbook.tw/chapters/faq/detached-head.html

Fix “refusing to merge unrelated histories” error:

  1. Force pull

  2. Fix conflicts maybe. Uploading files with conflicts by FTP could be the fastest solution.
  3. git add .
  4. commit
  5. Done

Note: 執行完上方command後,兩方client有不同步或是持續出現conflict的問題,重覆修正幾次之後就好了。原因不明。 Reference:

  1. https://stackoverflow.com/questions/24916708/track-existing-folder-from-remote-git-repo
  2. Track Remote Branch https://stackoverflow.com/questions/520650/make-an-existing-git-branch-track-a-remote-branch
  3. Common commands related to remote https://backlog.com/git-tutorial/tw/reference/remote.html

Classic ASP on Windows Server 2016

To parse XML

Required:

  1. Microsoft Core XML Services (MSXML) 6.0
    https://www.microsoft.com/en-us/download/details.aspx?id=3988
  2. Change script to 6.0
    https://stackoverflow.com/questions/16167111/activex-component-cant-create-object-msxml2-domdocument
  3. Install MSXML 4.0 Service Pack 3 if above steps still fail.
    https://www.microsoft.com/en-us/download/confirmation.aspx?id=15697

Handling Ajax Response Errors From Laravel Form Request Validation: lalavalidate.js

Usage:

 

Google reCaptcha

.env

Front

Backend

Google Verify API response examples

Reference:

  1. reCAPTCHA v3 Example for PHP
    https://stevencotterill.com/articles/adding-google-recaptcha-v3-to-a-php-form
  2. Official
    https://developers.google.com/recaptcha/docs/v3
  3. Admin Console
    https://www.google.com/recaptcha/admin

webpack.mix.js example

Commands

Example

 

footerCallback manipulation

Ajax Get summary info with data (dataSrc)

footerCallback

tfoot

Reference:

  1. dataSrc:
    https://datatables.net/reference/option/ajax.dataSrc
  2. dataSrc example:
    http://live.datatables.net/sagujiza/1/edit

Return view html by Ajax

view()->render()

https://stackoverflow.com/questions/28634712/how-can-i-return-a-view-from-an-ajax-call-in-laravel-5

View

Controller

Javascript