Skip to content

Instantly share code, notes, and snippets.

@acapps
acapps / mysql_no_relation.sql
Created February 2, 2017 17:54
MySQL select records that do not have relation with second table
SELECT *
FROM table_one
WHERE NOT EXISTS(SELECT *
FROM table_two
WHERE table_one.id = table_two.table_one_id);
@acapps
acapps / inheritance.php
Created February 3, 2017 06:44
PHP Inheritance Example
<?php
class Supervisor {
private $prop1;
private $prop2;
protected $key;
protected function set($key, $val) {
$this->$key = $val;
}
<?php
class Supervisor {
private $prop1;
private $prop2;
protected $key;
protected function set($key, $val) {
$this->$key = $val;
}
<?php
$jsonInput = '
[{
"_id": "58b5c92eb2f1c45f9b7d5bfd",
"ap_mac": "80:2a:a8:80:d8:f3",
"authorized_by": "api",
"end": 1496084526,
"mac": "00:26:08:db:ec:d4",
"site_id": "58261efcaa83e82c6b230cff",
<?php
/**
* Interface ApplicantAPI
*/
interface ApplicantAPI {
/**
* @param $title
* @return int|null
*/