DoDoG

@fantasy0107

學習筆記 興趣心得

Joined on Nov 12, 2019

  • https://www.ptt.cc/bbs/Soft_Job/M.1548527055.A.F37.html XXX hello world XXX tutorial XXX do's XXX don'ts XXX checklist XXX awesome list XXX by example(s) -- Ching Yi Chan XXX wiki -- 周瑞興
     Like  Bookmark
  • 開發的時候在驗證傳入參數方面,只有用到幾種常用規則像是 required、string、number 等等,沒有用到比較深入的規則想說整理一下並且多認識一些驗證規則(使用的 Laravel 版是是10) exclude: 欄位會被排除掉當使用 validate 或 validated filled: 當出現這個欄位時,它不能是空值 missing: 不能出現欄位 present: 欄位必需要出現 prohibited: 欄位需要是 missing 或 empty empty 如果欄位是以下的值 null
     Like  Bookmark
  • 在開發的時候,可能會因為code髒像是變數命名不好、部分程式碼可以重複使用想要進行重構,往往這個時候我都會找時間直接改掉,沒有使用到 phpstorm 提供的功能,想說來認識一下phpstorm 提供的重構功能 在 phpstorm 工具列有提供 Refactor 或者滑鼠右鍵也會顯示這個功能裡面就包含 Refactor 的功能 截圖 2024-03-20 上午10.37.12 圖1. 工具列 Refactor 功能 截圖 2024-03-20 上午10.42.00 圖2. 滑鼠右鍵 Refactor 功能
     Like  Bookmark
  • vim demo.txt 命令模式 ESC - 回到預設模式 i - 插入模式 : - 底線命令模式,可以在最底一行輸入操作指令 v - 視覺模式 x 刪掉所在字元 :0 - 移動到文件檔案的起點 :{number} - 移動到第 {number} 行 :$ - 移動到文件檔案最後一行
     Like  Bookmark
  • 登入與登出(開機與關機) telnet - telnet 主機位址(或主機名稱) login - 登入 exit - 離開 shutdown - 關機 [root@tsai root]# shutdown <== 系統在兩分鐘後關機,並傳送訊息給在線上的人 [root@tsai root]# shutdown -h now <==系統立刻關機 [root@tsai root]# shutdown -r now <==系統立刻重新開機 [root@tsai root]# shutdown -h 20:30 <==系統在今天的 20:30 分關機
     Like  Bookmark
  • The sticky option is an optional value that can be used to allow the immediate reading of records that have been written to the database during the current request cycle. If the sticky option is enabled and a "write" operation has been performed against the database during the current request cycle, any further "read" operations will use the "write" connection. This ensures that any data written during the request cycle can be immediately read back from the database during that same request. It is up to you to decide if this is the desired behavior for your application. 上面那段話是在說,sticky 參數可以立即取得在當下這個請求被寫入的紀錄.當啟用 sticky 時有任何 write 的寫入動作後,所有的 read 操作都會用 write connection. //database.php 'mysql' => [ 'read' => [ 'host' => [ '192.168.1.1', '196.168.1.2',
     Like  Bookmark
  • 可以用來分析 sql statement 比較重要的 columns https://mariadb.com/kb/en/explain/#columns-in-explain-select Column 名稱 用途 type 有多少資料被撈出來 (join type)
     Like  Bookmark
  • 心得 (暴雷) 這部故事就我目前的觀點來看, 是在講底層人民想要反抗企業壟斷的無奈, 主角生長在貧窮的家庭, 雖然貧窮但是在課業上還是蠻好的, 不過會被同學霸凌就因為他無法用到比較好的裝備, 導致每次想反抗都被有錢人家的同學欺負因為一直長期遭受到霸凌導致越來越不喜歡上課, 在一次意外的事件中, 母親就這樣離開了, 留下了無助的主角, 之後就遇到一位他的貴人的帶著他一起執行任務, 在這個過程中漸漸地依賴這位貴人, 甚至喜歡上了一位同團隊的女孩, 不過漸漸劇情發展到了後面, 越來越失控, 也因為主角使用了副作用大的裝備會導致錯亂, 失去人性, 似乎是個不可避免的結果, 到了後面也真的發生了這樣的事情, 雖然因為拯救了自己心愛的女主角導致自己死了, 不過他也實現了自己的願望而非其他人的, 結果是個悲劇, 就整體下來看完後有種很傷感的 fu 不過是一部蠻特別的作品. 推薦 CYBERPUNK 2077 SOUNDTRACK - I REALLY WANT TO STAY AT YOUR HOUSE by Rosa Walton & Hallie Coggins https://www.youtube.com/watch?v=gzbLODUb1sA&list=RDgzbLODUb1sA&start_radio=1&ab_channel=LakeshoreRecords {%hackmd BJrTq20hE %}
     Like  Bookmark
  • query structure "The cat in the hat" resource.type = "gae_app" 第一列: 任何 LogEntry 或 payload 的 field 內容有包含 "The cat in the hat" 它就會被找出來 第二列: 會用 [FIELD_NAME] [OP] [VALUE] 這種形式去query FIELD_NAME : Log entry 的 filed
     Like  Bookmark
  • 下 migrate 的時候碰到以下問題, 這是 Doctrine\DBAL 的 issue, 是發生在要 change 欄位的時候, 不管是不是要改 enum 欄位 Unknown database type enum requested, Doctrine\DBAL\Platforms\MySQL80Platform may not support it. 解法 在 migration file 的 constructor 加 use Illuminate\Support\Facades\DB; public function __construct()
     Like  Bookmark
  • 用來處理 excel 的匯入 https://docs.laravel-excel.com/3.1/getting-started/ 基礎 安裝 架構概念 https://docs.laravel-excel.com/3.1/architecture/
     Like  Bookmark
  • 可以只拿某些 commit 的部分 sourcetree 有提供這個功能 不過要從最早的拿到最新不然可能會有問題, 然後要跳過不要的 commit 部分 https://ithelp.ithome.com.tw/articles/10223230 會用到這個功能是, 因為沒注意到就把 develop 合進來導致推上 remote 的 release 有髒資料, 會有問題 {%hackmd BJrTq20hE %}
     Like  Bookmark
  • https://eudora.cc/posts/31485/ windows 和 mac Mac 的話 Ctrl 換成 Cmd, ALT 換 OPTION 常用 mac control + - 回上一個鼠標 option + z 自動換行
     Like  Bookmark
  • 在 ini.bat 的 :: Set home path 加入 @cd /d "C:/YOUR_PREFERRED_FOLDER/" :: Set home path // add @cd /d "C:/YOUR_PREFERRED_FOLDER/" https://superuser.com/a/1135139 {%hackmd BJrTq20hE %}
     Like  Bookmark
  • 一系列的 open-source 工具用來建立 OpenAPI 規格包含設計、建立、寫文件等等 範例 DOC 工具 Swagger Editor - 編輯 openAPI 規格 Swagger UI - 顯示 openAPI 規格的互動式API文件 Swagger Codegen - 建立 server studs 和 client libraries
     Like  Bookmark
  • 安裝 socialite 套件 composer require laravel/socialite 設定 Facebook Login // config/services.php 'facebook' => [ 'client_id' => env('FACEBOOK_CLIENT_ID'), 'client_secret' => env('FACEBOOK_CLIENT_SECRET'), 'redirect' => 'http://example.com/callback-url', ],
     Like  Bookmark
  • 沒有 DB local.ERROR: SQLSTATE[HY000] [1049] Unknown database 'default' (SQL: select max(batch) as aggregate from migrations) {"exception":"[object] (Illuminate\Database\QueryException(code: 1049): SQLSTATE[HY000] [1049] Unknown database 'default' (SQL: select max(batch) as aggregate from migrations) at /var/www/vendor/laravel/framework/src/Illuminate/Database/Connection.php:678) 代表沒有資料庫要自己去建立一個 DB_HOST 設定與帳號密碼 在使用 laradock 的時候碰到 local.ERROR: SQLSTATE[HY000] [2002] No such file or directory (SQL: select * from information_schema.tables where table_schema = default and table_name = migrations and table_type = 'BASE TABLE') {"exception":"[object] (Illuminate\Database\QueryException(code: 2002): SQLSTATE[HY000] [2002] No such file or directory (SQL: select * from information_schema.tables where table_schema = default and table_name = migrations and table_type = 'BASE TABLE') at /var/www/vendor/laravel/framework/src/Illuminate/Database/Connection.php:678)
     Like  Bookmark
  • https://laravel.com/docs/8.x/requests Interacting With The Request Laravel 提供 Illuminate\Http\Request 這個 class 去存取進來的請求,透過 dependency injection 去注入 request instance 範例 <?php // route file
     Like  Bookmark
  • mongoDB MongoDB tutorial point 筆記 下 find 的時候會因為 資料型態的不同而撈不到 db.collection.find({num:123}) 和 db.collection.find({num:'123'}) 找出來的結果是不一樣的
     Like  Bookmark
  • 有目標的練習 目標練習法的四大特質 目標練習法有定義明確的具體目標 ex: 已適當的速度將曲子毫無錯誤的從頭彈到尾連續三次 p.54 講求專注
     Like  Bookmark