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
# I find this https://discussions.apple.com/thread/8160651 | |
# but it not match my 2018 version MacBook with macos 10.14 | |
# | |
# On my local, gpuswitch value is | |
# 0 -> does not use dedicated graphics | |
# 1 -> use dedicated graphics | |
# 2 -> switch automaticly (I guess), because 2 is default value when "automatic graphics switching" selected | |
# in energy in preference. | |
# check settings depended on charger/battery |
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
<?php | |
declare(strict_types=1); | |
namespace Form\Validator\Constraints; | |
use Symfony\Component\Validator\Constraint; | |
use Symfony\Component\Validator\Exception\UnexpectedTypeException; | |
/** |
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
<?php | |
function map(string $a): array | |
{ | |
$len = \strlen($a); | |
$map = new SplFixedArray(127); | |
for ($i = 0; $i < $len; ++$i) { | |
$code = \ord($a[$i]); | |
$map[$code] = ($map[$code] ?? 0) + 1; | |
} |
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 YEAR(u.birthdate) as year, | |
SUM(IF(u.gender = 'M', 1, 0)) as male, | |
SUM(IF(u.gender = 'F', 1, 0)) as female | |
from users u | |
left join users_banned ub on u.id = ub.user_id | |
where ub.user_id is null | |
group by year | |
order by year; |
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 n.category_id, n.id, n.price | |
from products n | |
left join products j | |
on j.category_id = n.category_id and j.price >= n.price and n.id != j.price | |
group by n.id, n.category_id, n.price | |
having count(*) < 3 | |
order by category_id, price desc |
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
<div class="row"> | |
{%- for month in months -%} | |
<div class="col-6"> | |
<table class="table table-condensed table-calendar bg-white"> | |
<thead> | |
<tr> | |
<th colspan="7"> | |
{{- month|format_date('medium', 'MMM') -}} | |
</th> | |
</tr> |
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
Homebrew build logs for php on macOS 10.13.3 | |
Build date: 2018-03-14 14:10:31 |