2018年3月1日 星期四

Laravel 5 recursive query


使用 laravel 5 做的例子, 以下幾個站說明的很清楚

https://itsolutionstuff.com/post/laravel-5-category-treeview-hierarchical-structure-example-with-demoexample.html

https://heera.it/laravel-model-relationship

https://heera.it/laravel-nested-relationship-revised#.V9ntypN94dU


2018年2月13日 星期二

諸葛亮從來不問

 偶然從網路上看到的,還滿有道理的~~

===========================================

諸葛亮從來不問劉備,為什麼我們的箭那麼少?
關羽從來不問劉備,為什麼我們的士兵那麼少?
張飛從來不問劉備,兵臨城下我該怎麼辦?
於是一一
有了草船借箭、
有了過五關斬六將、
有了據水斷橋嚇退曹兵……

趙子龍接到進攻軍令時手上只有20個兵,
收穫成果時已攻下了十座城池、
多了2萬兵、增了三千匹馬,
軍令只是寫著:攻下城池!

——如若萬事俱備 你的價值何在!

孫悟空是在取經的路上碰到的,
豬八戒是在取經的路上碰到的,
沙和尚是在取經路上碰到的,
白龍馬也是在取經路上碰到的,
所以要碰到可以與你一路同行的人,
你必須先上路!
不是有了同行者才上路,
是因為你在路上才會有同行者!

2018年1月5日 星期五

clone windows 10 to another disk


從 HDD to HDD 可以,
從 HDD to SSD 也可以。

https://www.backup-utility.com/free-backup-software.html

2017年12月30日 星期六

Android 開發


使用者授權

android API 23 之後的,都需要在程式裡詢問使用者,以取得相關授權,以下文章,說明的方式是我目前覺得最簡單的方式。
https://altbeacon.github.io/android-beacon-library/requesting_permission.html






2017年12月9日 星期六

macOS 10.13 High Sierra Setup



macOS 10.13 High Sierra Apache Setup: Multiple PHP Versions
https://getgrav.org/blog/macos-sierra-apache-multiple-php-versions


macOS 10.13 High Sierra Apache Setup: MySQL, APC & More...

ref: https://getgrav.org/blog/macos-sierra-apache-mysql-vhost-apc

========================================= 

Apache2

The default ports have been set in
/usr/local/etc/httpd/httpd.conf to 8080 and in
/usr/local/etc/httpd/extra/httpd-ssl.conf to 8443
so that httpd can run without sudo.

========================================= 

PHP 7.1

/usr/local/etc/php/7.1/php.ini
 
========================================= 
 
SMB

ref: https://gist.github.com/natritmeyer/6621231

#Mount the share:
mount_smbfs //username:password@server.name/share_name share_name/

#Unmount the share:
umount share_name

========================================= 



Python 學習資源

以下依個人喜好優先順序排序

莫煩 Python
https://morvanzhou.github.io/tutorials/




2017年12月2日 星期六

瀏覽器直接列印的設定



firefox

from: https://stackoverflow.com/questions/945691/automatically-print-image-from-website

The only solution to avoid print dialog that I found was creating a variable on Mozilla Firefox to set auto-print. Maybe is not the best solution if you need to use other browser, but in my case, I only need to print a report automatically and it works:
1- Open Firefox and type "about:config" in the address bar
2- Right click on any preference and select "New" > "Boolean"
3- Add a variable called "print.always_print_silent" with "true" value
4- Restart Firefox.

Google Chrome

--kiosk 的動作,我目前試不出來,猜想應該是新版本不支援了。