Skip to content

Instantly share code, notes, and snippets.

import React from 'react';
import PropTypes from 'prop-types';
import {t} from 'app/locale';
import SentryTypes from 'app/sentryTypes';
import {getInterval, useShortInterval} from 'app/components/charts/utils';
import {getFormattedDate} from 'app/utils/dates';
import EventsRequest from 'app/views/organizationEvents/utils/eventsRequest';
import LineChart from 'app/components/charts/lineChart';
import MarkLine from 'app/components/charts/components/markLine';
/*
SQLyog Ultimate v12.15 (64 bit)
MySQL - 5.7.24-0ubuntu0.18.04.1 : Database - pim_cake
*********************************************************************
*/
/*!40101 SET NAMES utf8 */;
/*!40101 SET SQL_MODE=''*/;
@markstory
markstory / BugShell.php
Created November 11, 2018 03:20
CakePHP Issue 12485 repo
<?php
namespace App\Shell;
use Cake\Console\Shell;
use Cake\ORM\TableRegistry;
class BugShell extends Shell
{
public function main()
{
title sidebar_order
Bulk Remove a List of Issues
5

DELETE /api/0/projects/{organization_slug}/{project_slug}/issues/

: Permanently remove the given issues. The list of issues tomodify is given through the id query parameter. It is repeatedfor each issue that should be removed.Only queries by 'id' are accepted.If any ids are out of scope this operation will succeed withoutany data mutation.

@markstory
markstory / bool-type-effected
Created July 6, 2018 17:07
Methods effected by bool type changes.
// List built with
// ack --noheading 'return.*\|bool' src/
// ack --noheading 'return.*bool\|' src/
src/Auth/BaseAuthenticate.php:113: * @return bool|array Either false on failure, or an array of user data.
src/Auth/DefaultPasswordHasher.php:44: * @return bool|string Password hash or false on failure
src/Auth/DigestAuthenticate.php:135: * @return array|bool Array of digest information.
src/Cache/CacheEngine.php:153: * @return bool|int New incremented value, false otherwise
src/Cache/CacheEngine.php:162: * @return bool|int New incremented value, false otherwise
src/Cache/CacheEngine.php:248: * @return bool|string string key or false
<?php
// In config/bootstrap.php
use Cake\I18n\I18n;
use Cake\I18n\ChainMessagesLoader;
use Cake\I18n\MessagesFileLoader;
// Turn off 'default' as a fallback
I18n::translators()->useFallback(false);
// Create a custom fallback.
@markstory
markstory / Marshaller.php.diff
Created September 12, 2017 02:43
Should the Marshaller warn on 'extra' properties. We could log, but it will add a dependency to the ORM package.
diff --git a/src/ORM/Marshaller.php b/src/ORM/Marshaller.php
index e4a1894..f7c092b 100644
--- a/src/ORM/Marshaller.php
+++ b/src/ORM/Marshaller.php
@@ -16,6 +16,7 @@ namespace Cake\ORM;
use ArrayObject;
use Cake\Collection\Collection;
+use Cake\Core\Configure;
use Cake\Database\Expression\TupleComparison;
<?php
namespace App\Model\Behavior;
use Cake\ORM\Behavior;
class AlgoliaBehavior extends Behavior
{
protected $_defaultConfig = [
'index' => '',
// Other Algolia API key configuration
@markstory
markstory / TreeBehaviorNumberTest.php
Created January 17, 2017 03:13
cakephp issue 10005
<?php
// This test method was added to the bottom of lib/Cake/TestCase/Model/Behavior/TreeBehaviorNumberTest.php
public function testSaveRecursiveTree() {
extract($this->settings);
$this->Tree = new $modelClass();
$this->Tree->Behaviors->attach('Tree', array('level' => 'level'));
$this->completeTreeSave(array(
'app' => array(
'GroupPermissions' => array(
<?php
namespace App\Test\Fixture;
use Cake\TestSuite\Fixture\TestFixture;
/**
* TimeSheetsFixture
*
*/
class TimeSheetsFixture extends TestFixture