This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* @return HasOne | |
*/ | |
public function statusReviews(): HasOne | |
{ | |
return $this->hasOne(DailyReview::class, 'weekly_review_id', 'id') | |
->select('weekly_review_id', | |
DB::raw('daily_reviews.approved_by IS NOT NULL as daily_reviews_is_approved') | |
) | |
->groupBy('weekly_review_id'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
## Task optimize query for echo count_profiles and amount for each charity | |
### bad practice | |
SELECT | |
`charities`.`id`, | |
`charities`.`name`, | |
COUNT(DISTINCT `charity_profile`.`giving_profile_id`) AS `count_profiles`, | |
SUM(`donate_to_charities`.`amount`) as `amount` | |
FROM | |
`donate_to_charities` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import $ from "jquery"; | |
window.jQuery = $ | |
window.$ = $ | |
import { Howl } from 'howler'; | |
import axios from "axios"; | |
export function initSoundcloud() { | |
const SoundCloudClientId = 'f17476445ba4b72bc5760aa679820d27' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
select *, (IF(ISNULL(profile_note.metric_id), 'General', metrics.metric)) as sortable | |
from `profile_note` | |
left join `metrics_index` as `metrics` on `profile_note`.`metric_id` = `metrics`.`id` | |
where (`created_by` in (select `id` from `users` where `account_id` = 27)) | |
and `profile_id` = 75 | |
order by sortable asc |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Shell script for switching between Brew-installed PHP versions | |
# | |
# Copyright (c) 2023 Andy Miller | |
# Released under the MIT License | |
# | |
# Creator: Phil Cook | |
# Modified: Andy Miller | |
# | |
# More information: https://github.com/rhukster/sphp.sh |