diff --git a/content/threads/weekly-thread-2021-01.md b/content/threads/weekly-thread-2021-01.md deleted file mode 100644 index a44bc77..0000000 --- a/content/threads/weekly-thread-2021-01.md +++ /dev/null @@ -1,11 +0,0 @@ ---- -slug: weekly-thread-2021-01 -title: 'Weekly thread #01 of 2022' -tweet_id: '1479467928818892800' -author_username: archtechx -created_at: 2022-01-07T16:35:34+00:00 -links: { } ---- -🔥 Latest code tips for Laravel developers - -First week's special: news from the past 3 weeks 🧵 \ No newline at end of file diff --git a/content/threads/weekly-thread-2021-50.md b/content/threads/weekly-thread-2021-50.md new file mode 100644 index 0000000..582f53a --- /dev/null +++ b/content/threads/weekly-thread-2021-50.md @@ -0,0 +1,11 @@ +--- +slug: weekly-thread-2021-50 +title: 'Weekly thread #50 of 2021' +tweet_id: '1471864631312404492' +author_username: archtechx +created_at: 2022-01-07T16:35:34+00:00 +links: { } +--- +🔥 Latest code tips for Laravel developers + +A weekly thread 🧵 diff --git a/content/tips/adding-where-scopes-which-use-an-indexed-column-to-a-query-thats-primarily-filtered-by-another-column-is-a-great-way-to-speed-up-db-performance.md b/content/tips/adding-where-scopes-which-use-an-indexed-column-to-a-query-thats-primarily-filtered-by-another-column-is-a-great-way-to-speed-up-db-performance.md index 5f6ac5c..dec3e0b 100644 --- a/content/tips/adding-where-scopes-which-use-an-indexed-column-to-a-query-thats-primarily-filtered-by-another-column-is-a-great-way-to-speed-up-db-performance.md +++ b/content/tips/adding-where-scopes-which-use-an-indexed-column-to-a-query-thats-primarily-filtered-by-another-column-is-a-great-way-to-speed-up-db-performance.md @@ -1,7 +1,7 @@ --- title: 'Adding WHERE scopes which use an indexed column to a query that''s primarily filtered by another column is a great way to speed up DB performance' tweet_id: '1471864653491974151' -thread_slug: weekly-thread-2021-01 +thread_slug: weekly-thread-2021-50 author_username: tobias_petry images: - 'https://pbs.twimg.com/media/FGafd_JXMAEDgP5.jpg' @@ -10,4 +10,4 @@ slug: adding-where-scopes-which-use-an-indexed-column-to-a-query-thats-primarily --- ⚡️ Database Tip -Sometimes you have seldom used queries and you can't add an index on columns for these queries. A nice trick is to use another indexed condition so the rows are filtered by the indexable column first and afterwards again for the more limiting condition. \ No newline at end of file +Sometimes you have seldom used queries and you can't add an index on columns for these queries. A nice trick is to use another indexed condition so the rows are filtered by the indexable column first and afterwards again for the more limiting condition. diff --git a/content/tips/use-match-or-switch-statements-to-conditionally-scope-database-queries-based-on-query-strings-in-the-request.md b/content/tips/use-match-or-switch-statements-to-conditionally-scope-database-queries-based-on-query-strings-in-the-request.md index 70c3f7d..27e6128 100644 --- a/content/tips/use-match-or-switch-statements-to-conditionally-scope-database-queries-based-on-query-strings-in-the-request.md +++ b/content/tips/use-match-or-switch-statements-to-conditionally-scope-database-queries-based-on-query-strings-in-the-request.md @@ -1,13 +1,13 @@ --- title: 'Use match () or switch () statements to conditionally scope database queries based on query strings in the request' tweet_id: '1471864655710670854' -thread_slug: weekly-thread-2021-01 +thread_slug: weekly-thread-2021-50 author_username: archtechx images: - 'https://pbs.twimg.com/media/FGmQH5nXEAs4mnv.jpg' created_at: 2021-12-17T15:27:34+00:00 slug: use-match-or-switch-statements-to-conditionally-scope-database-queries-based-on-query-strings-in-the-request --- -Remembered this great tip recently, and it's nice to see how fast PHP evolves +Remembered this great tip recently, and it's nice to see how fast PHP evolves -The exact same behavior can be implemented using match () with a default value, which also removes the need for the second callback ⚡️ https://twitter.com/reinink/status/1233017064492761088 \ No newline at end of file +The exact same behavior can be implemented using match () with a default value, which also removes the need for the second callback ⚡️ https://twitter.com/reinink/status/1233017064492761088 diff --git a/content/tips/use-retry-for-callbacks-that-may-randomly-fail.md b/content/tips/use-retry-for-callbacks-that-may-randomly-fail.md index ddb53b1..952ce67 100644 --- a/content/tips/use-retry-for-callbacks-that-may-randomly-fail.md +++ b/content/tips/use-retry-for-callbacks-that-may-randomly-fail.md @@ -1,7 +1,7 @@ --- title: 'Use retry() for callbacks that may randomly fail' tweet_id: '1471864638199451648' -thread_slug: weekly-thread-2021-01 +thread_slug: weekly-thread-2021-50 author_username: alexjgarrett images: - 'https://pbs.twimg.com/media/FGP3MSQWQAYKjSm.jpg' @@ -12,4 +12,4 @@ slug: use-retry-for-callbacks-that-may-randomly-fail I was hitting a shaky API that sometimes failed. -Here, the retry function tries the callback 3 times, with a 2 second interval in-between retries. \ No newline at end of file +Here, the retry function tries the callback 3 times, with a 2 second interval in-between retries. diff --git a/content/tips/you-can-add-a-refresh-flag-to-the-artisan-down-command-to-send-a-refresh-header-to-the-browser.md b/content/tips/you-can-add-a-refresh-flag-to-the-artisan-down-command-to-send-a-refresh-header-to-the-browser.md index 6f70135..1ef1ab7 100644 --- a/content/tips/you-can-add-a-refresh-flag-to-the-artisan-down-command-to-send-a-refresh-header-to-the-browser.md +++ b/content/tips/you-can-add-a-refresh-flag-to-the-artisan-down-command-to-send-a-refresh-header-to-the-browser.md @@ -1,7 +1,7 @@ --- title: 'You can add a --refresh flag to the artisan down command to send a refresh header to the browser' tweet_id: '1471864676652826626' -thread_slug: weekly-thread-2021-01 +thread_slug: weekly-thread-2021-50 author_username: DianaWebdev images: - 'https://pbs.twimg.com/media/FG0dHeBXwAw3bvc.jpg' diff --git a/content/tips/you-can-refactor-cluttered-if-conditions-using-lookup-tables-match-statements-and-switch-statements.md b/content/tips/you-can-refactor-cluttered-if-conditions-using-lookup-tables-match-statements-and-switch-statements.md index 0bf31f8..c8389f8 100644 --- a/content/tips/you-can-refactor-cluttered-if-conditions-using-lookup-tables-match-statements-and-switch-statements.md +++ b/content/tips/you-can-refactor-cluttered-if-conditions-using-lookup-tables-match-statements-and-switch-statements.md @@ -1,7 +1,7 @@ --- title: 'You can refactor cluttered if () conditions using lookup tables, match statements, and switch statements' tweet_id: '1471864664661311488' -thread_slug: weekly-thread-2021-01 +thread_slug: weekly-thread-2021-50 author_username: archtechx images: - 'https://pbs.twimg.com/media/FGVrAKdVgAIWfwk.jpg' @@ -12,4 +12,4 @@ slug: you-can-refactor-cluttered-if-conditions-using-lookup-tables-match-stateme First: lookup tables 👇 -These are great for refactoring complex conditions with lots of else if () cases \ No newline at end of file +These are great for refactoring complex conditions with lots of else if () cases diff --git a/content/tips/you-can-use-the-array-spread-syntax-to-pass-an-array-of-arguments-to-another-function.md b/content/tips/you-can-use-the-array-spread-syntax-to-pass-an-array-of-arguments-to-another-function.md index adbe5df..390d983 100644 --- a/content/tips/you-can-use-the-array-spread-syntax-to-pass-an-array-of-arguments-to-another-function.md +++ b/content/tips/you-can-use-the-array-spread-syntax-to-pass-an-array-of-arguments-to-another-function.md @@ -1,7 +1,7 @@ --- title: 'You can use the array spread syntax to pass an array of arguments to another function' tweet_id: '1471864644562305025' -thread_slug: weekly-thread-2021-01 +thread_slug: weekly-thread-2021-50 author_username: freekmurze images: - 'https://pbs.twimg.com/media/FGepj8mWQAUf2R_.jpg' @@ -14,4 +14,4 @@ Here’s a self-contained example where we spread the array output of sys_getloa https://github.com/spatie/cpu-load-health-check/blob/70f387d5167c24d4000d825a5bddab2504d557fb/src/CpuLoad.php#L17 -#php \ No newline at end of file +#php