$users = App\User::with(['posts' => function ($query) {
$query->where('title', 'like', '%first%');
}])->get();
This file contains hidden or 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 pickle | |
import os | |
import mimetypes | |
import face_recognition | |
from heapq import nsmallest | |
import shutil | |
dump = 'data.dat' | |
allowedMimetypes = [ |
$teams = App\Team::with([
'portfolios' => function ($query) use ($user) {
// Only include portfolios where...
$query->whereHas('wallets', function ($query) use ($user) {
// ...there are wallets...
$query->whereHas('transactions', function ($query) {
// ...with pending transactions...
$query->whereStatus('pending');
});
$teams = App\Team::whereHas('portfolios', function ($query) use ($user) {
// Only include teams with portfolios where...
$query->whereHas('wallets', function ($query) use ($user) {
// ...there are wallets...
$query->whereHas('transactions', function ($query) {
// ...with pending transactions...
$query->whereStatus('pending');
});
You might encounter the following error between Yarn upgrades using Brew on macOS:
"gyp: No Xcode or CLT version detected!"
Normally you'd easily resolve this issue by installing Xcode command line tools. If you stumble upon the following message after an installation attempt, use the solution below.
"xcode-select: error: command line tools are already installed, use "Software Update" to install updates"
sudo rm -R -f $(xcode-select --print-path)
This file contains hidden or 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
brew services stop elasticsearch | |
sleep 2 | |
brew uninstall elasticsearch | |
rm -Rf /usr/local/etc/elasticsearch | |
rm -Rf /usr/local/var/lib/elasticsearch/ | |
brew install https://raw.githubusercontent.com/ankane/homebrew-core/63f95f490c63758eba124d97803f26be3e3362ba/Formula/elasticsearch.rb | |
brew services start elasticsearch | |
sleep 35 | |
open -a http://localhost:9200 |
This file contains hidden or 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
// Settings in here override those in "Default/Preferences.sublime-settings", | |
// and are overridden in turn by syntax-specific settings. | |
{ | |
"rulers": [80, 120], | |
"translate_tabs_to_spaces": true, | |
"trim_trailing_white_space_on_save": "all", | |
"trim_only_modified_white_space": false, | |
"ensure_newline_at_eof_on_save": true, | |
"bold_folder_labels": true, | |
"show_git_status": false, |
This file contains hidden or 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 -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)" | |
echo 'eval "$(/opt/homebrew/bin/brew shellenv)"' >> ~/.zprofile | |
eval "$(/opt/homebrew/bin/brew shellenv)" | |
mkdir -p .local/bin | |
echo 'export PATH="$HOME/.local/bin:$PATH"' >> ~/.zprofile | |
export PATH="$HOME/.local/bin:$PATH" | |
echo 'export PATH="/Applications/Sublime Text.app/Contents/SharedSupport/bin:$PATH"' >> ~/.zprofile |
This file contains hidden or 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
<?php | |
declare(strict_types=1); | |
use Rector\CodeQuality\Rector\Class_\InlineConstructorDefaultToPropertyRector; | |
use Rector\Config\RectorConfig; | |
use Rector\DeadCode\Rector\StaticCall\RemoveParentCallWithoutParentRector; | |
use Rector\Php81\Rector\FuncCall\NullToStrictStringFuncCallArgRector; | |
use Rector\Php81\Rector\Property\ReadOnlyPropertyRector; | |
use Rector\PHPUnit\AnnotationsToAttributes\Rector\ClassMethod\DataProviderAnnotationToAttributeRector; |
This file contains hidden or 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
// Settings in here override those in "Default/Preferences.sublime-settings", | |
// and are overridden in turn by syntax-specific settings. | |
{ | |
"rulers": [80, 120], | |
"translate_tabs_to_spaces": true, | |
"trim_trailing_white_space_on_save": "all", | |
"trim_only_modified_white_space": false, | |
"ensure_newline_at_eof_on_save": true, | |
"bold_folder_labels": true, | |
"show_git_status": false, |