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
NSOpenPanel *openPanel = [[NSOpenPanel alloc] init]; | |
[openPanel setCanChooseFiles:NO]; | |
[openPanel setCanChooseDirectories:YES]; | |
[openPanel setCanCreateDirectories:YES]; | |
[openPanel beginWithCompletionHandler:^(NSInteger result) { | |
if (result == NSModalResponseOK) { | |
for (NSURL *fileURL in [openPanel URLs]) { | |
NSString *filename = [fileURL path]; | |
[[NSUserDefaults standardUserDefaults] setObject:filename forKey:@"your_key_for_bookmark"]; |
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
#!/usr/bin/env php | |
<?php | |
const JIRA_HOST = ''; // ex. github.atlassian.net | |
const USERNAME = ''; // ex. iivanov@github.com | |
const TOKEN = ''; // from https://id.atlassian.com/manage-profile/security/api-tokens | |
[, $task, $time] = $argv; | |
$ch = curl_init(); |
- В колонке
result
учитывается состояние модели полученное хендлером (не БД) - Required - означает, что поле должно фигурировать в запросе, иначе ошибка.
- Default - если значение по умолчанию не было задано, оно рассматривается как
null
.
Есть три основных параметра, которые передаются в формате массива/значения
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 | |
// here installed https://github.com/dragonmantank/cron-expression | |
require_once '/Users/ekuznetsov/projects/pamyatki/vendor/autoload.php'; | |
// current time is 2022-08-18 18:30:30 | |
date_default_timezone_set('Europe/Moscow'); | |
$c = new \Cron\CronExpression('0 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
launchctl stop com.apple.Dock.agent |
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 App\Controller; | |
use App\Entity\Article; | |
use App\Entity\ArticleHasTag; | |
use App\Entity\Tag; | |
use Doctrine\Common\Collections\ArrayCollection; |
X | IX | S | IS | |
---|---|---|---|---|
X | Conflict | Conflict | Conflict | Conflict |
IX | Conflict | Compatible | Conflict | Compatible |
S | Conflict | Conflict | Compatible | Compatible |
IS | Conflict | Compatible | Compatible | Compatible |
- A shared (S) lock permits the transaction that holds the lock to read a row.
- An exclusive (X) lock permits the transaction that holds the lock to update or delete a row.
- An intention shared lock (IS) indicates that a transaction intends to set a shared lock on individual rows in a table.
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
# Majority Grouping | |
select concat(repeat('*', floor(a.trCount / 100))) as bar, | |
floor(avg(a.trCount)) as avgTrCnt, | |
max(a.trCount) as maxTrCnt, | |
min(a.trCount) as minTrCnt, | |
count(*) as accountCnt | |
from Account a | |
where 1 | |
and a.trCount > 10 | |
group by bar |
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
# Complete mapping of ISO 3166 2-letter country codes to descriptions used in Google calendar URLs, accurate as of 29 July 2021. | |
iso_to_gcal_description = { | |
"ad": "ad", | |
"ae": "ae", | |
"af": "af", | |
"ag": "ag", | |
"ai": "ai", | |
"al": "al", | |
"am": "am", |