Skip to content

Instantly share code, notes, and snippets.

View bingogg14's full-sized avatar

Pavlo Harashchenko bingogg14

  • Tallinn
  • 09:17 (UTC +03:00)
View GitHub Profile
/**
* @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');
## 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`
import $ from "jquery";
window.jQuery = $
window.$ = $
import { Howl } from 'howler';
import axios from "axios";
export function initSoundcloud() {
const SoundCloudClientId = 'f17476445ba4b72bc5760aa679820d27'
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
@bingogg14
bingogg14 / sphp.sh
Last active January 11, 2024 17:28
#!/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