Skip to content

Instantly share code, notes, and snippets.

View addiks's full-sized avatar

Gerrit Addiks addiks

View GitHub Profile
@addiks
addiks / mysql_merge_unique_index.sql
Created January 8, 2019 15:22
Demonstration of a MERGE in MySQL that only applies when same PK
CREATE TABLE `sandbox`.`new_table` (
`id` INT NOT NULL,
`name` VARCHAR(45) NULL,
`email` VARCHAR(45) NULL,
PRIMARY KEY (`id`),
UNIQUE INDEX `email_UNIQUE` (`email` ASC));
INSERT INTO new_table
(id, name, email)
VALUES
<?php
interface MyEntityInterface
{
function foo(string $a): int;
function bar(int $b): string;
}
final class MyEntity implements MyEntityInterface
{
@addiks
addiks / ruleset_xml_schema.xsd
Created January 28, 2018 09:36
New ruleset_xml_schema.xsd
<?xml version="1.0"?>
<xs:schema
xmlns:xs="http://www.w3.org/2001/XMLSchema"
xmlns="http://pmd.sf.net/ruleset/1.0.0"
targetNamespace="http://pmd.sf.net/ruleset/1.0.0"
elementFormDefault="qualified">
<xs:element name="ruleset">
<xs:complexType>
<xs:sequence>
@addiks
addiks / ruleset-refs.xml
Created January 28, 2018 09:35
New ruleset-refs.xml
<?xml version="1.0" encoding="UTF-8"?>
<ruleset
name="phpmd-phpincludepath-test"
xmlns="http://pmd.sf.net/ruleset/1.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://pmd.sf.net/ruleset/1.0.0 http://pmd.sf.net/ruleset_xml_schema.xsd"
xsi:noNamespaceSchemaLocation="http://pmd.sf.net/ruleset_xml_schema.xsd">
<description>First description...</description>